Skip to content

Commit 3ba7475

Browse files
ci: merge publish workflows to enable single trusted publisher
1 parent 385bd5c commit 3ba7475

File tree

3 files changed

+35
-38
lines changed

3 files changed

+35
-38
lines changed

.github/workflows/npm-latest.yml

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

.github/workflows/npm-publish.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: npm publish
2+
3+
on:
4+
# For staging releases
5+
workflow_dispatch:
6+
# For latest releases
7+
release:
8+
types: [published]
9+
10+
permissions:
11+
id-token: write # Required for OIDC
12+
packages: write
13+
contents: read
14+
15+
jobs:
16+
compute-staging-version:
17+
# Only run for manual dispatch (staging)
18+
if: github.event_name == 'workflow_dispatch'
19+
uses: ./.github/workflows/reusable-compute-staging-version.yml
20+
21+
npm-publish-staging:
22+
# Only run for manual dispatch (staging)
23+
if: github.event_name == 'workflow_dispatch'
24+
uses: ./.github/workflows/reusable-npm.yml
25+
needs: [compute-staging-version]
26+
with:
27+
version: ${{ needs.compute-staging-version.outputs.version }}
28+
tag: ${{ needs.compute-staging-version.outputs.dist-tag }}
29+
30+
npm-publish-latest:
31+
# Only run for release published (latest)
32+
if: github.event_name == 'release'
33+
uses: ./.github/workflows/reusable-npm.yml
34+
with:
35+
tag: latest

.github/workflows/npm-staging.yml

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

0 commit comments

Comments
 (0)