Consolidate publish workflows, fix GitHub Packages scope

This commit is contained in:
Adam Ladachowski
2026-02-08 03:53:01 +01:00
parent 0142e1ac54
commit 6138d7c878
2 changed files with 6 additions and 40 deletions
-36
View File
@@ -1,36 +0,0 @@
# 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: Node.js Package
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm test
publish-gpr:
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
+6 -4
View File
@@ -31,13 +31,12 @@ jobs:
- name: Run checks
run: npm run check
# Create GitHub Release
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
# Publish to npm
# Publish to npm as @saiden/browse
- uses: actions/setup-node@v4
with:
node-version: '20'
@@ -48,13 +47,16 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# Publish to GitHub Packages
# Publish to GitHub Packages as @saiden-dev/browse
- uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://npm.pkg.github.com'
scope: '@saiden-dev'
- name: Publish to GitHub Packages
run: npm publish
run: |
npm pkg set name='@saiden-dev/browse'
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}