Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Commit

Permalink
Add npm publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
timkendall committed Dec 27, 2020
1 parent 10951f9 commit b98a96a
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
on:
release:
types: [published]

name: Publish to NPM

jobs:
name: npm-publish
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '14'

- name: 'Cache node_modules'
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: |
**/node_modules
**/packages/**/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: 'Yarn Install'
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
yarn install --frozen-lockfile
- name: 'Build'
run: yarn build

- name: 'Test'
run: yarn test

- name: 'NPM Publish'
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
access: "public"
check-version: true

0 comments on commit b98a96a

Please sign in to comment.