Skip to content

Commit 392c728

Browse files
ci: migrate to npm trusted publisher (#247)
1 parent 1c18cc1 commit 392c728

File tree

4 files changed

+35
-43
lines changed

4 files changed

+35
-43
lines changed

.github/workflows/cli-npm-latest.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# ⚠️ THIS WORKFLOW IS THE TRUSTED PUBLISHER CONFIGURED ON NPMJS.COM, DO NOT RENAME OR DELETE THIS FILE ⚠️
2+
name: CLI npm publish
3+
4+
on:
5+
# For staging releases
6+
workflow_dispatch:
7+
# For latest releases
8+
release:
9+
types: [published]
10+
11+
jobs:
12+
compute-staging-version:
13+
# Only run for manual dispatch (staging)
14+
if: github.event_name == 'workflow_dispatch'
15+
uses: ./.github/workflows/reusable-compute-staging-version.yml
16+
with:
17+
working-directory: cli
18+
19+
npm-publish-staging:
20+
# Only run for manual dispatch (staging)
21+
if: github.event_name == 'workflow_dispatch'
22+
uses: ./.github/workflows/reusable-cli-npm.yml
23+
needs: compute-staging-version
24+
with:
25+
version: ${{ needs.compute-staging-version.outputs.version }}
26+
tag: ${{ needs.compute-staging-version.outputs.dist-tag }}
27+
28+
npm-publish-latest:
29+
# Only run for releases with tag 'iapp-v*' as created by release-please for CLI
30+
if:
31+
${{ github.event_name == 'release' && startsWith(github.ref_name,'iapp-v') }}
32+
uses: ./.github/workflows/reusable-cli-npm.yml
33+
with:
34+
tag: 'latest'

.github/workflows/cli-npm-staging.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/reusable-cli-npm.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,10 @@ on:
1717
description: 'npm publish tag (e.g., latest, nightly)'
1818
default: ''
1919
type: string
20-
secrets:
21-
npm-token:
22-
description: 'NPM auth token (required unless `dry-run: true`)'
23-
required: false
2420

2521
jobs:
2622
npm-publish:
27-
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/publish-npm.yml@publish-npm-v1.5.0
23+
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/publish-npm.yml@publish-npm-v1.6.0
2824
with:
2925
working-directory: cli
3026
install-command: npm ci
@@ -34,5 +30,3 @@ jobs:
3430
version: ${{ inputs.version }}
3531
environment: ${{ (inputs.dry-run && '') || inputs.tag }}
3632
provenance: ${{ !inputs.dry-run }}
37-
secrets:
38-
npm-token: ${{ secrets.npm-token }}

0 commit comments

Comments
 (0)