feat: update logs and hooks (backward compatibility breaking changes) #26
Workflow file for this run
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: Public NPM Package | |
on: | |
push: | |
tags: | |
- '*.*.*' | |
jobs: | |
build_and_test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '20.x' | |
registry-url: 'https://registry.npmjs.org' | |
- run: yarn install | |
- run: yarn keygen | |
- run: yarn test | |
- run: yarn test:coverage | |
# send test coverage | |
- run: bash <(curl -s https://codecov.io/bash) -f ./coverage/coverage.lcov | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: coverage | |
path: ./coverage/ | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: mochawesome-report | |
path: ./mochawesome-report/ | |
build_and_publish: | |
needs: [build_and_test] | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '20.x' | |
registry-url: 'https://registry.npmjs.org' | |
- run: yarn install | |
- run: yarn build | |
- run: yarn install --prod | |
- name: Extract git tag name | |
id: vars | |
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} | |
- name: Update package.json version based on a tag | |
run: | | |
node -e " \ | |
const package =JSON.parse(fs.readFileSync('package.json', 'utf8')); | |
package.version = '$RELEASE_VERSION'; \ | |
fs.writeFileSync('package.json', JSON.stringify(package)); \ | |
" | |
env: | |
RELEASE_VERSION: ${{ steps.vars.outputs.tag }} | |
- run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |