Skip to content

Commit ff0c8bf

Browse files
authored
Merge pull request #2543 from o1-labs/2025-10-pkg-pr-releases
make pkg pr flow for PRs
2 parents 032a15a + fb7e1d1 commit ff0c8bf

File tree

4 files changed

+45
-34
lines changed

4 files changed

+45
-34
lines changed

.github/actions/build/action.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: Build o1js
22
description: 'All of the building steps for o1js'
33

4-
permissions:
5-
contents: write
6-
74
inputs:
85
proof_systems_commit:
96
description: 'proof_systems commit to use'
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release pkg-pr version
2+
description: Release a new version of o1js and mina-signer using pkg-pr-new
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- uses: actions/checkout@v4
8+
- name: Restore repository
9+
uses: actions/cache@v4
10+
with:
11+
path: .
12+
key: repo-${{ github.sha }}
13+
- name: Setup Node.JS 20
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: 20
17+
- name: build
18+
uses: ./.github/actions/build
19+
- name: Build o1js and mina-signer
20+
shell: bash
21+
run: |
22+
npm ci
23+
npm run prepublish:full
24+
cd src/mina-signer
25+
npm ci
26+
npm run prepublish:full
27+
- name: Publish o1js and mina-signer on pkg-pr-new
28+
shell: bash
29+
run: npx pkg-pr-new publish ./ ./src/mina-signer
30+

.github/workflows/pull_requests.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ jobs:
1313
with:
1414
changelog: CHANGELOG.md
1515

16+
Pkg-pr-new:
17+
# Only run this job when the pull request contains the pkg‑pr‑release label.
18+
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'pkg-pr-release')
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
- name: release-pkg-pr-version
24+
uses: ./.github/actions/release-pkg-pr-version
25+
1626
Check-npm-deps:
1727
name: Check npmDepsHash is correct
1828
runs-on: ubuntu-latest
@@ -91,4 +101,4 @@ jobs:
91101

92102
- name: Fail if any checks fail
93103
if: failure()
94-
run: echo "Some checks failed, failing" && exit 1
104+
run: echo "Some checks failed, failing" && exit 1

.github/workflows/push_main.yml

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -72,37 +72,12 @@ jobs:
7272

7373

7474
Pkg-pr-new:
75-
strategy:
76-
matrix:
77-
node: [20]
78-
7975
runs-on: [ubuntu-latest]
8076
steps:
81-
- uses: actions/checkout@v4
82-
- name: Setup Node.JS ${{ matrix.node }}
83-
uses: actions/setup-node@v4
84-
with:
85-
node-version: ${{ matrix.node }}
86-
- name: build
87-
uses: ./.github/actions/build
88-
- name: Build o1js and mina-signer
89-
run: |
90-
npm run prepublish:full
91-
cd src/mina-signer
92-
npm ci
93-
npm run prepublish:full
94-
- name: Publish o1js and mina-signer on pkg-pr-new
95-
run: npx pkg-pr-new publish ./ ./src/mina-signer # Enable `--compact` once published to NPM with `repository` in package.json
96-
97-
# TODO is this redundant with the last step?
98-
- name: Publish to NPM if version has changed
99-
uses: JS-DevTools/npm-publish@v3
100-
with:
101-
token: ${{ secrets.NPM_TOKEN }}
102-
package: './src/mina-signer/package.json'
103-
strategy: upgrade
104-
env:
105-
INPUT_TOKEN: ${{ secrets.NPM_TOKEN }}
77+
- name: Checkout repository
78+
uses: actions/checkout@v4
79+
- name: release-pkg-pr-version
80+
uses: ./.github/actions/release-pkg-pr-version
10681

10782
Release-on-NPM:
10883
if: github.ref == 'refs/heads/main'
@@ -156,4 +131,3 @@ jobs:
156131
generateReleaseNotes: true
157132
name: Release ${{ steps.publish.outputs.version }}
158133
skipIfReleaseExists: true
159-

0 commit comments

Comments
 (0)