Skip to content

1.0.0

1.0.0 #10

Workflow file for this run

name: Publish
on:
workflow_dispatch:
push:
tags: 'v*.*.*'
jobs:
publish:
strategy:
matrix:
os: [ubuntu-latest]
node: [20]
runs-on: ${{ matrix.os }}
steps:
- name: Wait for the CI workflow to complete
id: wait-for-ci
uses: fountainhead/[email protected]
with:
checkName: ci
token: ${{ secrets.GITHUB_TOKEN }}
- name: Fail if CI has failed
if: steps.wait-for-ci.outputs.conclusion == 'failure'
run: exit 1
- name: Check out the repository
uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Download the build
uses: dawidd6/action-download-artifact@v2
with:
workflow: ci.yml
name: build
path: build
commit: ${{ github.sha }}
- name: Make the package public
run: npx json -I -f package.json -e "delete this.private"
- name: Publish to NPM
run: npm publish --registry=https://registry.npmjs.org/ --//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
- name: Add the repository owner as the scope if it's not set
run: 'npx json -I -f package.json -e "this.name[0] !== ''@'' && (this.name = ''@${{ github.repository_owner }}/'' + this.name)"'
- name: Publish to GPR
run: npm publish --registry=https://npm.pkg.github.com/ --//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}