Skip to content

Commit

Permalink
fix release action workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
chaance committed Oct 17, 2021
1 parent d81d462 commit 03c58dd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
name: Release

on:
push:
branches:
- main
release:
types: [published]

jobs:
release:
name: Release
if: github.repository == 'reach/reach-ui'
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x]

env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

if: ${{ startsWith(github.ref, 'refs/tags/v') && github.repository == 'reach/reach-ui' }}

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Use Node 14
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
version: 14.x
node-version: ${{ matrix.node-version }}

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

- run: echo "RELEASE_TAG=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV

- name: Install Dependencies
run: yarn --frozen-lockfile

Expand All @@ -42,7 +43,7 @@ jobs:
- name: Test
run: yarn test

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

- name: Publish Packages
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ $ git log -p
# If everything looks good, push to GitHub along with the new tag:
$ git push origin main --follow-tags

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

0 comments on commit 03c58dd

Please sign in to comment.