Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 22 additions & 18 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,35 @@
name: Publish Package
name: Publish NPM packages

permissions:
id-token: write # Required for OIDC
contents: read # Recommended security best practice

on:
workflow_dispatch:
workflow_dispatch:

jobs:
publish:
# prevents this action from running on forks
if: github.repository == 'thesysdev/create-c1-app'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Install pnpm
uses: pnpm/action-setup@v4.1.0
- uses: actions/checkout@v4
with:
version: 9

- name: Set node version to 22
uses: actions/setup-node@v4
fetch-depth: 0
- uses: pnpm/action-setup@v2
with:
node-version: 22
registry-url: https://registry.npmjs.org/
version: 9.15.4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
cache: pnpm
cache-dependency-path: "**/pnpm-lock.yaml"

# CRITICAL: npm 11.5.1+ required for trusted publishing
- name: Install npm 11.6.4
run: npm install -g npm@11.6.4

- name: Install deps
run: pnpm install
Expand All @@ -33,6 +38,5 @@ jobs:
run: pnpm run build

- name: Publish package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm publish --access public
# Note: provenance is automatically generated with trusted publishing