Update npm-publish-github-packages.yml

This commit is contained in:
암냥 (imnyang) 2025-06-06 03:52:08 +09:00 committed by GitHub
commit 20b77c1610
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,35 +1,41 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created name: Release & Publish to GitHub Packages
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
name: Node.js Package
on: on:
push: push:
branches:
- release
jobs: jobs:
build: release:
runs-on: ubuntu-latest 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: permissions:
contents: read contents: write
packages: write packages: write
issues: write
pull-requests: write
steps: steps:
- uses: actions/checkout@v4 - name: Checkout code
- uses: actions/setup-node@v4 uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js 20
uses: actions/setup-node@v4
with: with:
node-version: 20 node-version: 20
cache: 'pnpm'
registry-url: https://npm.pkg.github.com/ registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm publish - name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run tests
run: pnpm test
- name: Release with semantic-release to GitHub Packages only
env: env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: pnpm run release