-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a6965c0
commit 34a4a3f
Showing
1 changed file
with
23 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,35 @@ | ||
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created | ||
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages | ||
|
||
name: Node.js Package | ||
|
||
name: Release | ||
on: | ||
release: | ||
types: [created] | ||
# Triggers the workflow on push or pull request events but only for the master branch | ||
push: | ||
branches: | ||
- master | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
release: | ||
if: github.event.repository.fork == false | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
node-version: 16 | ||
- run: npm install --package-lock-only | ||
- run: npm ci | ||
- run: npm test | ||
|
||
publish-npm: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16 | ||
registry-url: https://registry.npmjs.org/ | ||
- run: npm ci | ||
- run: npm publish | ||
- name: Install dependencies | ||
run: yarn ci:install | ||
- name: Release | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.npm_token}} | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.npm_token }} | ||
run: yarn ci:shipit |