Add a Github workflow to publish releases

pull/58/head
Christiaan de Die le Clercq 2022-05-19 21:04:38 +02:00 committed by GitHub
parent fea127f7b2
commit ee6fbbcfc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 26 additions and 0 deletions

26
.github/workflows/publish.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: Publish to NPM
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 16
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Get the release tag version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Set package version
run: yarn version --new-version "${{ steps.get_version.outputs.VERSION }}" --no-git-tag-version
- name: Publish package
run: yarn publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}