Publish Packages to npmjs #4
Workflow file for this run
This file contains hidden or 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
name: Publish Packages to npmjs | |
on: | |
release: | |
types: [published] | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '22.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install dependencies | |
run: npm install | |
- name: Set version from tag in infra | |
run: | | |
cd packages/infra | |
VERSION="${GITHUB_REF_NAME#v}" | |
npm version "$VERSION" | |
env: | |
GITHUB_REF_NAME: ${{ github.ref_name }} | |
- name: Set version from tag in management | |
run: | | |
cd packages/management | |
VERSION="${GITHUB_REF_NAME#v}" | |
npm version "$VERSION" | |
env: | |
GITHUB_REF_NAME: ${{ github.ref_name }} | |
- name: Build packages | |
run: npm run build | |
- name: Publish infra package | |
run: | | |
cd packages/infra | |
npm unpublish @chkp/quantum-infra@1.0.1 --force | |
npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish management package | |
run: | | |
cd packages/management | |
npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |