add build action for setting latest #94
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
on: | ||
push: | ||
branches: | ||
- sdk7 | ||
pull_request: | ||
release: | ||
types: | ||
- created | ||
name: Publish NPM package | ||
jobs: | ||
install: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js 16.x | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16.x | ||
- name: install | ||
run: npm install | ||
- name: build | ||
run: npm run build | ||
- name: Publish with latest tag | ||
run: npm publish --access public --tag latest | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
- name: Add sdk7 tag | ||
run: npm dist-tag add your-package@${{ steps.get_version.outputs.version }} sdk7 | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
- name: Add latest tag (again, to ensure it is retained) | ||
run: npm dist-tag add your-package@${{ steps.get_version.outputs.version }} latest | ||
env: | ||
NODE_AUTH_TOKEN | ||