Skip to content

Commit 6b3c6cc

Browse files
author
Enda Phelan
committed
ci: add npm release workflow
1 parent 0654fd5 commit 6b3c6cc

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Diff for: .github/workflows/main.yml

+21
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
pull_request:
88
branches:
99
- master
10+
release:
11+
types: [released, prereleased]
1012

1113
jobs:
1214
test:
@@ -54,3 +56,22 @@ jobs:
5456
else
5557
echo "Skipping canary publish due to a fork/PR..."
5658
fi
59+
60+
publish:
61+
# publish to npm only when doing the release
62+
if: ${{ github.event_name == 'release' }}
63+
name: Publish Release
64+
runs-on: ubuntu-latest
65+
steps:
66+
- name: Checkout Master
67+
uses: actions/checkout@v1
68+
- name: Use Node
69+
uses: actions/setup-node@v1
70+
with:
71+
node-version: 14
72+
- name: Install Dependencies using Yarn
73+
run: yarn install
74+
- name: Build
75+
run: yarn build
76+
- name: Release
77+
run: echo "//registry.npmjs.org/:_authToken=${{secrets.NODE_AUTH_TOKEN}}" > ~/.npmrc && TAG=${GITHUB_REF#"refs/tags/"} npm run release

0 commit comments

Comments
 (0)