forked from rancher/dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update publish shell workflow to allow for independent release of eit…
…her shell or creators packages (rancher#11697) * add step for checking tag version matching + remove unused tmp_dir var + update creators version to match what was published on npm * add missing env var + script cleanup * updated publish-shell script to allow for independent publish of shell or creators pkgs via tag + minor changes to have it work on a PR just for testing * update string * update string * update string check with sed * revert wf and publish-shell to correct form * address pr comments * fix TAG export * stringify case strings + fix publish-shell script with path for creators pkg publish * re-trigger gates * add check if npm tag should be pre-release
- Loading branch information
Showing
5 changed files
with
109 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env bash | ||
echo "Checking package tag version matching" | ||
|
||
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" | ||
BASE_DIR="$( | ||
cd $SCRIPT_DIR && cd ../.. & | ||
pwd | ||
)" | ||
SHELL_DIR=$BASE_DIR/shell | ||
CREATORS_DIR=$BASE_DIR/shell/creators/extension | ||
|
||
echo "TAG ${TAG}" | ||
|
||
# let's get the package name and version from the tag | ||
PKG_NAME=$(sed 's/-pkg-v.*//' <<< "$TAG") | ||
PKG_VERSION=$(sed 's/.*-pkg-v//'<<< "$TAG") | ||
|
||
echo "PKG_NAME ${PKG_NAME}" | ||
echo "PKG_VERSION ${PKG_VERSION}" | ||
|
||
# version comparison checks | ||
case $PKG_NAME in | ||
"shell") | ||
SHELL_VERSION=$(jq -r .version ${SHELL_DIR}/package.json) | ||
if [ "$SHELL_VERSION" == "$PKG_VERSION" ]; then | ||
echo "tag check: shell versions match" | ||
exit 0 | ||
else | ||
echo "Version mismatch for the shell package publish => shell: ${SHELL_VERSION} vs tag: ${PKG_VERSION}. Please redo the tagging properly" | ||
exit 1 | ||
fi | ||
;; | ||
"creators") | ||
CREATORS_VERSION=$(jq -r .version ${CREATORS_DIR}/package.json) | ||
if [ "$CREATORS_VERSION" == "$PKG_VERSION" ]; then | ||
echo "tag check: creators versions match" | ||
exit 0 | ||
else | ||
echo "Version mismatch for the creators package publish => creators: ${CREATORS_VERSION} vs tag: ${PKG_VERSION}. Please redo the tagging properly" | ||
exit 1 | ||
fi | ||
;; | ||
*) | ||
echo "something went wrong with the tagging or versioning => TAG: ${TAG} , PKG_NAME: ${PKG_NAME}, PKG_VERSION: ${PKG_VERSION}" | ||
exit 1 | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters