Merge branch 'chore/plm-6648-add-npm-publish' into release #70
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 Package | |
on: | |
push: | |
branches: | |
- release | |
jobs: | |
npm_publish: | |
if: "! contains(toJSON(github.event.commits.*.message), '[Version Bump]')" | |
name: NPM Publish | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.HOUZZ_CI_TOKEN }} | |
- name: Setup GIT | |
run: | | |
git config user.email "[email protected]" | |
git config user.name "houzz-ci" | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: https://npm.pkg.github.com/ | |
scope: houzz | |
- name: Bump up patch version and push to github | |
run: | | |
npm version patch -m "chore: [Version Bump] %s" | |
git push "https://github.com/$GITHUB_REPOSITORY" release --no-verify | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.HOUZZ_CI_TOKEN }} | |
- name: Publish package to github registry | |
run: | | |
npm publish --tag "latest" ./ > publish_message.txt | |
echo "##[set-output name=message;]$(cat publish_message.txt)" | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.HOUZZ_CI_TOKEN }} |