Skip to content

Commit

Permalink
Merge pull request #172 from openzim/npm-publish
Browse files Browse the repository at this point in the history
Publish on NPM
  • Loading branch information
kelson42 authored Dec 3, 2022
2 parents 628381e + 5e21410 commit 74cb253
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/publish.yml
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 }}

0 comments on commit 74cb253

Please sign in to comment.