NPM Canary release #1
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: Canary release | |
on: workflow_dispatch | |
permissions: | |
packages: write | |
contents: read | |
jobs: | |
canary-publish: | |
name: Publish Packages (canary) | |
if: github.repository == 'hai-on-op/sdk-private' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
cache: 'yarn' | |
registry-url: 'https://npm.pkg.github.com' | |
scope: '@hai-on-op' | |
- run: yarn | |
- run: yarn build | |
- name: Set up Git user | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
- name: Publish Canary Version | |
run: | | |
echo "Publishing canary version..." | |
npm version prerelease --preid "${GITHUB_SHA::8}" --no-git-tag-version | |
npm publish --tag canary | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |