mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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
This commit is contained in:
parent
e27731bc7a
commit
15711ba2d1
@ -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…
Reference in New Issue
Block a user