Package release before publishing (#42218)

* Package separately to publish

* Fix interpolation

* Windows format envvars

* More descriptive msg

* Won't publish from here

* Resolve docker issues in PR build

* Rename package docker step

* Correct npm release JSON structure
This commit is contained in:
malcolmholmes
2021-11-30 10:53:07 +00:00
committed by GitHub
parent 690ffdff56
commit 9c0a2a19fd
10 changed files with 499 additions and 272 deletions
+7
View File
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
# lerna bootstrap might have created yarn.lock
git checkout .
echo 'Building packages'
yarn packages:build
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
PACKAGES=("@grafana/ui" "@grafana/data" "@grafana/toolkit" "@grafana/runtime" "@grafana/e2e" "@grafana/e2e-selectors" "@grafana/schema")
GRAFANA_TAG=${1:-}
RELEASE_CHANNEL="latest"
@@ -39,9 +40,6 @@ fi
# Publish to NPM registry
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc
echo $'\nBuilding packages'
yarn packages:build
echo $'\nPublishing packages to NPM registry'
yarn packages:${SCRIPT}
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -e
GRAFANA_TAG=${1:-}
if echo "$GRAFANA_TAG" | grep -q "^v"; then
_grafana_version=$(echo "${GRAFANA_TAG}" | cut -d "v" -f 2)
else
echo "Provided tag is not a version tag, skipping packages release..."
exit
fi
echo "Retrieving prerelease NPM artifacts"
ZIPFILE=grafana-npm-${_grafana_version}.tgz
echo "${GCP_KEY}" | base64 -d > credentials.json
gcloud auth activate-service-account --key-file=credentials.json
gsutil cp "gs://${PRERELEASE_BUCKET}/artifacts/npm/$ZIPFILE" "$ZIPFILE"
tar -xzf "$ZIPFILE"
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -e
GRAFANA_TAG=${1:-}
if echo "$GRAFANA_TAG" | grep -q "^v"; then
_grafana_version=$(echo "${GRAFANA_TAG}" | cut -d "v" -f 2)
else
echo "Provided tag is not a version tag, skipping packages release..."
exit
fi
echo "Storing NPM artifacts"
ZIPFILE=grafana-npm-${_grafana_version}.tgz
tar -czf "$ZIPFILE" packages/*/dist packages/*/compiled
echo "${GCP_KEY}" | base64 -d > credentials.json
gcloud auth activate-service-account --key-file=credentials.json
gsutil cp "$ZIPFILE" "gs://${PRERELEASE_BUCKET}/artifacts/npm/$ZIPFILE"
echo "NPM artifacts successfully pushed to GCS."