-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[backport v2.8.next1] Update publish shell workflow to allow for inde…
…pendent release of either shell or creators packages (#11738) * backport of PR 11697 + tag to publish both shell and creator * fix publish shell * fix tag to v1 * update npm tag to legacy-v1 + add version check for pre-release * Ensure @rancher/shell version using tags (#11758) * Ensure @rancher/shell version using tags Enable corepack for extension builds Migrate creators outside of shell dir Update creators path - switch to npm publish * Add NPM_REGISTRY to publish args * Fix creators_dir path - Bump ext package * Add update package version function in test script * Fix gitignore file name * Add .yarnrc.yml for skeleton - revert node versions * Remove shell creators * Update publish-shell workflow with corepack (#11820) * Bump extension creator - Bump shell * Add NPM_TAG to publish-shell script * Remove unnecessary tag addition * Fix publish_args declaration and tag addition * Add step to setup node prior to corepack enable * Skip validate plugin build step due to node version mismatch --------- Co-authored-by: Jordon Leach <[email protected]> Co-authored-by: Jordon Leach <[email protected]>
- Loading branch information
1 parent
de683da
commit 9902250
Showing
42 changed files
with
1,075 additions
and
409 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
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,61 @@ | ||
name: Publish Shell Package | ||
|
||
on: | ||
push: | ||
tags: | ||
- "shell-pkg-v*" | ||
- "creators-pkg-v*" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '16.x' | ||
cache: 'yarn' | ||
|
||
- name: Check Tags Version Matching | ||
env: | ||
TAG: ${{github.ref_name}} | ||
run: ./.github/workflows/scripts/check-package-tag-version.sh | ||
shell: bash | ||
|
||
# Skipping due to node version mismatch | ||
# - name: Validate Plugin build system | ||
# run: ./shell/scripts/test-plugins-build.sh | ||
# shell: bash | ||
|
||
# Reset the local (ci) repository state because | ||
# The previous step (Validate Plugin build system) changes | ||
# the version number on package.json for Shell in order | ||
# to release it in verdaccio for it's tests | ||
- name: Reset repository (file system) | ||
run: | | ||
git reset --hard HEAD | ||
echo $NPM_REGISTRY | ||
cat ./shell/package.json | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "16.x" | ||
registry-url: "https://registry.npmjs.org" | ||
scope: "@rancher" | ||
|
||
- name: Install packages | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Publish Shell Package to npm | ||
run: ./shell/scripts/publish-shell.sh --npm | ||
env: | ||
TAG: ${{github.ref_name}} | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
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/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "NAME", | ||
"version": "0.1.0", | ||
"private": false, | ||
"engines": { | ||
"node": ">=16" | ||
}, | ||
"dependencies": { | ||
"cache-loader": "^4.1.0", | ||
"color": "4.2.3", | ||
"ip": "2.0.1", | ||
"node-polyfill-webpack-plugin": "^3.0.0" | ||
}, | ||
"resolutions": { | ||
"d3-color": "3.1.0", | ||
"ejs": "3.1.9", | ||
"follow-redirects": "1.15.2", | ||
"glob": "7.2.3", | ||
"glob-parent": "6.0.2", | ||
"json5": "2.2.3", | ||
"@types/lodash": "4.17.5", | ||
"merge": "2.1.1", | ||
"node-forge": "1.3.1", | ||
"nth-check": "2.1.1", | ||
"qs": "6.11.1", | ||
"roarr": "7.0.4", | ||
"semver": "7.5.4", | ||
"@vue/cli-service/html-webpack-plugin": "^5.0.0" | ||
} | ||
} |
File renamed without changes.
Oops, something went wrong.