Skip to content

Commit 03c58dd

Browse files
committed
fix release action workflow
1 parent d81d462 commit 03c58dd

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
11
name: Release
22

33
on:
4-
push:
5-
branches:
6-
- main
4+
release:
5+
types: [published]
76

87
jobs:
98
release:
109
name: Release
10+
if: github.repository == 'reach/reach-ui'
1111
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [14.x]
16+
1217
env:
1318
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1419

15-
if: ${{ startsWith(github.ref, 'refs/tags/v') && github.repository == 'reach/reach-ui' }}
16-
1720
steps:
1821
- name: Checkout
1922
uses: actions/checkout@v2
2023

21-
- name: Use Node 14
24+
- name: Use Node.js ${{ matrix.node-version }}
2225
uses: actions/setup-node@v1
2326
with:
24-
version: 14.x
27+
node-version: ${{ matrix.node-version }}
2528

2629
- name: Restore Lerna (Cache)
2730
uses: actions/cache@v2
@@ -31,8 +34,6 @@ jobs:
3134
*/*/node_modules
3235
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
3336

34-
- run: echo "RELEASE_TAG=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV
35-
3637
- name: Install Dependencies
3738
run: yarn --frozen-lockfile
3839

@@ -42,7 +43,7 @@ jobs:
4243
- name: Test
4344
run: yarn test
4445

45-
- run: echo "Publishing $RELEASE_TAG to npm ..."
46+
- run: echo "Publishing to npm..."
4647
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > "$HOME/.npmrc"
4748

4849
- name: Publish Packages

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ $ git log -p
139139
# If everything looks good, push to GitHub along with the new tag:
140140
$ git push origin main --follow-tags
141141

142-
# Open up github.com/reach/reach-ui/actions and watch the build. There will
142+
# Open up https://github.com/reach/reach-ui/actions and watch the build. There will
143143
# be 2 builds, one for the push to the main branch and one for the
144144
# new tag. The tag build will run the build and all the tests and then
145145
# automatically publish to npm if everything passes. If there's a

0 commit comments

Comments
 (0)