Skip to content

Commit 15c76fa

Browse files
authored
Add publish & upgrade package version Github Actions (#126)
* infra: Add publish Github Action * infra: Add update package convenience Github Action * Update Github PAT secret name
1 parent e42d79a commit 15c76fa

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

.github/workflows/publish.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Publish package to npm
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: '14'
15+
- run: yarn
16+
- run: yarn prepare
17+
- uses: JS-DevTools/npm-publish@v1
18+
with:
19+
token: ${{ secrets.NPM_AUTH_TOKEN }}
20+
access: 'public'
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Update package version
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: 'New package version'
7+
required: true
8+
default: ''
9+
jobs:
10+
update_package_version:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
token: ${{ secrets.GH_PAT }}
16+
- uses: actions/setup-node@v2
17+
with:
18+
node-version: '14'
19+
- run: git config --global user.email "[email protected]"
20+
- run: git config --global user.name "${{ github.actor }}"
21+
- run: yarn version --new-version ${{ github.event.inputs.version }}
22+
- run: git push --tags
23+
- run: git push

0 commit comments

Comments
 (0)