Skip to content

Commit ee6fbbc

Browse files
authored
Add a Github workflow to publish releases
1 parent fea127f commit ee6fbbc

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Publish to NPM
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
publish:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v2
11+
- name: Setup Node.js
12+
uses: actions/setup-node@v2
13+
with:
14+
node-version: 16
15+
cache: 'yarn'
16+
- name: Install dependencies
17+
run: yarn install --frozen-lockfile
18+
- name: Get the release tag version
19+
id: get_version
20+
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
21+
- name: Set package version
22+
run: yarn version --new-version "${{ steps.get_version.outputs.VERSION }}" --no-git-tag-version
23+
- name: Publish package
24+
run: yarn publish --access public
25+
env:
26+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)