Skip to content

Commit 4ae0dc1

Browse files
committed
chore: Update publish flow
1 parent 1694ed0 commit 4ae0dc1

File tree

3 files changed

+41
-14
lines changed

3 files changed

+41
-14
lines changed

.github/workflows/publish.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish to NPM
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
dry_run:
7+
description: 'Dry Run'
8+
type: boolean
9+
default: true
10+
11+
workflow_call:
12+
secrets:
13+
PUBLISH_NPM:
14+
required: true
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
publish:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Setup
25+
uses: ./.github/actions/setup
26+
27+
- run: |
28+
pnpm i
29+
pnpm build
30+
31+
# Release Please has already incremented versions and published tags, so we just
32+
# need to publish all unpublished versions to NPM here
33+
# See: https://github.com/lerna/lerna/tree/main/commands/publish#bump-from-package
34+
- name: Publish to NPM
35+
env:
36+
NODE_AUTH_TOKEN: ${{secrets.PUBLISH_NPM}}
37+
run: pnpm publish packages/perf-bench ${{ (inputs.dry_run && '--dry-run') || '' }}

.github/workflows/release-please.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,9 @@ jobs:
2727
# cspell:ignore noreply
2828

2929
publish:
30-
runs-on: ubuntu-latest
3130
needs:
3231
- release-please
32+
uses: ./.github/workflows/publish.yml
33+
secrets:
34+
PUBLISH_NPM: ${{ secrets.PUBLISH_NPM }}
3335
if: ${{ needs.release-please.outputs.release_created }}
34-
steps:
35-
# The logic below handles the npm publication:
36-
- uses: actions/checkout@v4
37-
- name: Setup
38-
uses: ./.github/actions/setup
39-
40-
- run: |
41-
pnpm i
42-
pnpm build
43-
44-
- run: pnpm publish
45-
env:
46-
NODE_AUTH_TOKEN: ${{secrets.PUBLISH_NPM}}

.release-please-manifest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2+
".": "1.0.0",
23
"packages/perf-bench": "1.0.0"
34
}

0 commit comments

Comments
 (0)