V 5.3.0 #9
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
name: Release & Publish Package | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- CHANGELOG.md | |
jobs: | |
release: | |
name: Create release package | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout to code | |
uses: actions/checkout@v4 | |
- name: install Node js Version 20.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
- name: Retrieve Release Version | |
run: echo "PV=$(node version.js)" >> $GITHUB_ENV | |
- run: cat change-log | |
- name: Retrieve Release Body | |
run: | | |
{ | |
echo 'PB<<EOF' | |
cat change-log | |
echo EOF | |
} >> $GITHUB_ENV | |
- run: echo ${{env.PV}} | |
- name: Create Github Release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{env.PV}} | |
release_name: Release v${{env.PV}} | |
body: ${{env.PB}} | |
publish: | |
name: Publish to NPM | |
needs: release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout to code | |
uses: actions/checkout@v4 | |
- name: install Node js Version 20.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm ci | |
- name: publish to npm | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |