Skip to content

Commit

Permalink
Add publishing workflow (#21)
Browse files Browse the repository at this point in the history
* Add publishing workflow

* Remove `master` branch push trigger for test workflow

* Update publisher's Node version to 20 from 16
  • Loading branch information
danyalaytekin authored Oct 27, 2023
1 parent 31bed98 commit 05ebdf9
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
on:
release:
types: [created, edited, published]
workflow_dispatch:
inputs:
dryRun:
description: "Dry run only"
required: true
default: true
type: boolean

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
- run: npm ci

- name: Publish package
env:
NODE_AUTH_TOKEN: ${{ secrets.REGISTRY_PUBLISH_TOKEN }}
if: >
(github.event_name == 'release' && github.event.action == 'published') ||
(github.event_name == 'workflow_dispatch' && !inputs.dryRun)
run: npm publish

- name: Publish package (dry run)
env:
NODE_AUTH_TOKEN: ${{ secrets.REGISTRY_PUBLISH_TOKEN }}
if: >
(github.event_name == 'release' && github.event.action != 'published') ||
(github.event_name == 'workflow_dispatch' && inputs.dryRun)
run: npm publish --dry-run
1 change: 0 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
on:
push:
branches:
- master
- main
pull_request:

Expand Down

0 comments on commit 05ebdf9

Please sign in to comment.