1.12.0 #24
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
# This workflow will run tests using node and then emit a package to GitHub Packages when a release is created | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages | |
name: Publishing Package | |
on: | |
release: | |
types: [created] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Install dependencies | |
run: npm ci | |
- name: Run tests | |
run: npm run test:unit | |
publish-npm: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
registry-url: https://npm.pkg.github.com/ | |
scope: '@yaohaixiao' | |
- name: Install dependencies | |
run: npm ci | |
- name: Create Temporary .npmrc | |
run: echo @yaohaixiao:registry=https://npm.pkg.github.com >> .npmrc | |
- name: Publish Package | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.PUBLISH_TOKEN}} |