Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
marcokreeft87 committed Oct 13, 2023
1 parent c2ede33 commit 19096e0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# 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: Publish NPM

# Controls when the workflow will run
on:
# 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:
Expand All @@ -14,10 +21,11 @@ jobs:
with:
node-version: "18"
- name: Check for version change
run: echo $(jq -r .version package.json) >> $GITHUB_STATE/version.txt
id: version-check
run: echo "version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
- run: npm ci
- uses: JS-DevTools/npm-publish@v2
with:
access: public
token: ${{ secrets.npm_token }}
if: ${{ env.GITHUB_EVENT_NAME == 'push' && env.GITHUB_REF == 'refs/heads/master' && steps.version-check.outputs.version != env.GITHUB_STATE_BEFORE }}
if: steps.version-check.outputs.version != ${{ github.event.before }}.version

0 comments on commit 19096e0

Please sign in to comment.