grafana/toolkit: Unpublish previous "next" version when releasing a new one (#18552)

* Unpublish previous canary when releasing a new one

* Update scripts/circle-release-next-packages.sh

* Shellcheck fix
pull/18569/head
Dominik Prokop 6 years ago committed by GitHub
parent e27731bc7a
commit 15711ba2d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      scripts/circle-release-next-packages.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
function parse_git_hash() {
git rev-parse --short HEAD 2> /dev/null | sed "s/\(.*\)/\1/"
@ -11,9 +11,20 @@ function prapare_version_commit () {
git commit -am "Version commit"
}
#Get current version from lerna.json
function unpublish_previous_canary () {
echo $'\nUnpublishing previous canary packages'
for PACKAGE in ui toolkit data runtime
do
# dist-tag next to be changed to canary when https://github.com/grafana/grafana/pull/18195 is merged
CURRENT_CANARY=$(npm view @grafana/${PACKAGE} dist-tags.next)
echo "Unpublish @grafana/${PACKAGE}@${CURRENT_CANARY}"
npm unpublish "@grafana/${PACKAGE}@${CURRENT_CANARY}"
done
}
# Get current version from lerna.json
PACKAGE_VERSION=$(grep '"version"' lerna.json | cut -d '"' -f 4)
# Get short current commit's has
# Get current commit's short hash
GIT_SHA=$(parse_git_hash)
echo "Commit: ${GIT_SHA}"
@ -31,11 +42,14 @@ else
echo $'\nGit status:'
git status -s
echo $'\nBuilding packages'
yarn packages:build
prapare_version_commit
unpublish_previous_canary
echo $'\nPublishing packages'
yarn packages:publishNext
fi

Loading…
Cancel
Save