-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #172 from openzim/npm-publish
Publish on NPM
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Publish to npmjs.com | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v{0,1}[0-9]+.[0-9]+.[0-9]+' | ||
|
||
jobs: | ||
call-workflow: | ||
uses: ./.github/workflows/ci.yml | ||
secrets: inherit | ||
|
||
build: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18.x" | ||
registry-url: "https://registry.npmjs.org" | ||
|
||
- name: Check if tag is created on master branch | ||
if: endsWith(github.event.base_ref, '/master') == false | ||
run: echo "Please create the tag on master branch" && exit -1 | ||
|
||
- run: npm ci | ||
- run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |