Skip to content

Publish

Publish #11

Workflow file for this run

name: Publish
on:
workflow_run:
workflows: ["Tests"]
types:
- completed
jobs:
publish:
runs-on: ubuntu-latest
# not on PRs
if: github.event_name != 'pull_request'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_CI: true
steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
node-version: 18.12.0
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Increment version
run: npm run increment
- name: Publish @next
run: npm publish --tag next
if: ${{ github.ref == 'refs/heads/dev' }}
- name: Publish @latest
run: npm publish
if: ${{ github.ref == 'refs/heads/main' }}