Skip to content
Closed
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
21 changes: 17 additions & 4 deletions .github/workflows/sdk-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ jobs:
timeout-minutes: 15
permissions:
contents: write
# Required for `npm publish --provenance`. setup-node + OIDC sign
# the package against this workflow run; provenance lands on
# npmjs.com/package/.../access as a tamper-evident attestation.
id-token: write

steps:
- name: Checkout
Expand Down Expand Up @@ -57,17 +61,26 @@ jobs:
working-directory: packages/sdk-typescript
run: npm run build && npm run bundle:cli

# Trusted Publishing: npm exchanges the GitHub OIDC token (id-token:
# write at job level) for a short-lived publish credential. Same OIDC
# token also drives --provenance.
#
# Prerequisite (one-time, npm UI):
# npmjs.com/package/@protolabsai/sdk/access →
# Trusted Publishers → Add → GitHub Actions
# repository: protoLabsAI/protoCLI
# workflow filename: sdk-release.yml
# environment: (none)

- name: Publish to npm
if: ${{ !inputs.dry_run }}
working-directory: packages/sdk-typescript
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access public --provenance

- name: Dry run publish
if: ${{ inputs.dry_run }}
working-directory: packages/sdk-typescript
run: npm publish --access public --dry-run
run: npm publish --access public --provenance --dry-run

- name: Create GitHub Release
if: ${{ !inputs.dry_run }}
Expand Down