Add a Github workflow to publish releases
parent
fea127f7b2
commit
ee6fbbcfc7
|
@ -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 }}
|
Loading…
Reference in New Issue