Skip to content

Commit

Permalink
Merge pull request #10 from stephenyeargin/publish-to-github-packages
Browse files Browse the repository at this point in the history
Publish to GitHub Packages
  • Loading branch information
stephenyeargin authored Oct 27, 2024
2 parents dce54e9 + fc168a6 commit 04f82d1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
node-version: [16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand All @@ -32,4 +32,4 @@ jobs:
npm test
env:
CI: true

14 changes: 13 additions & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,31 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3

- uses: actions/setup-node@v4
with:
node-version: "20"

- run: npm ci

- run: npm test

- uses: JS-DevTools/npm-publish@v3
id: publish
with:
token: ${{ secrets.NPM_AUTH_TOKEN }}

- if: ${{ steps.publish.outputs.type }}
name: Create Release
env:
GH_TOKEN: ${{ github.token }}
run: |
VERSION="v${{ steps.publish.outputs.version }}"
gh release create $VERSION --generate-notes
- if: ${{ steps.publish.outputs.type }}
name: Publish to GitHub Packages
env:
NODE_AUTH_TOKEN: ${{ github.token }}
run: |
npm publish --registry=https://npm.pkg.github.com/

0 comments on commit 04f82d1

Please sign in to comment.