Skip to content

Commit

Permalink
commit to save work
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Alves authored and Alexandre Alves committed Nov 30, 2023
1 parent 08fcccc commit a668c75
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/release-shell-pkg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish Shell Package

on:
push:
tags:
- 'shell-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

- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
scope: '@rancher'

- name: Validate Plugin build system
run: ./shell/scripts/test-plugins-build.sh
shell: bash

- name: Publish Shell Package to npm
run: yarn publish-shell-reset-reg
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"publish-pkg": "./shell/scripts/publish-pkg.sh",
"serve-pkgs": "./shell/scripts/serve-pkgs",
"publish-shell": "./shell/scripts/publish-shell.sh",
"publish-shell-reset-reg": "./shell/scripts/publish-shell.sh -reset",
"clean": "./shell/scripts/clean",
"lint": "./node_modules/.bin/eslint --max-warnings 0 --ext .js,.ts,.vue .",
"lint:lib": "cd pkg/rancher-components && yarn lint",
Expand Down
10 changes: 10 additions & 0 deletions shell/scripts/publish-shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ BASE_DIR="$(
SHELL_DIR=$BASE_DIR/shell/
TMP_DIR=$BASE_DIR/tmp
PUBLISH_ARGS="--no-git-tag-version --access public $PUBLISH_ARGS"
DEFAULT_YARN_REGISTRY="https://registry.npmjs.org"
RESET_YARN_REGISTRY="false"

if [ "$1" == "-reset" ]; then
RESET_YARN_REGISTRY="true"
fi

if [ ! -d "${BASE_DIR}/node_modules" ]; then
echo "You need to run 'yarn install' first"
Expand All @@ -22,6 +28,10 @@ echo "Publishing Shell Packages"

# To set a token for NPM registry auth: `npm config set //registry.npmjs.org/:_authToken <TOKEN>``

if [ "$RESET_YARN_REGISTRY" == "true" ]; then
export YARN_REGISTRY=$DEFAULT_YARN_REGISTRY
fi

PKG_DIST=$BASE_DIR/dist-pkg/creators
mkdir -p ${PKG_DIST}
rm -rf ${PKG_DIST}/app
Expand Down

0 comments on commit a668c75

Please sign in to comment.