Skip to content

Commit 560a0a3

Browse files
committed
refactor the pkg-pr piece into its own action
1 parent c455a6f commit 560a0a3

File tree

5 files changed

+40
-78
lines changed

5 files changed

+40
-78
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 prepublishOnly
24+
cd src/mina-signer
25+
npm ci
26+
npm run prepublishOnly
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/pkg_pr_release.yml

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

.github/workflows/pull_requests.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ 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: release-pkg-pr-version
22+
uses: ./.github/actions/release-pkg-pr-version
23+
1624
Check-npm-deps:
1725
name: Check npmDepsHash is correct
1826
runs-on: ubuntu-latest

.github/workflows/push_main.yml

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -72,42 +72,10 @@ 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: Restore repository
83-
uses: actions/cache@v4
84-
with:
85-
path: .
86-
key: repo-${{ github.sha }}
87-
- name: Setup Node.JS ${{ matrix.node }}
88-
uses: actions/setup-node@v4
89-
with:
90-
node-version: ${{ matrix.node }}
91-
- name: build
92-
uses: ./.github/actions/build
93-
- name: Build o1js and mina-signer
94-
run: |
95-
npm run prepublishOnly
96-
cd src/mina-signer
97-
npm ci
98-
npm run prepublishOnly
99-
- name: Publish o1js and mina-signer on pkg-pr-new
100-
run: npx pkg-pr-new publish ./ ./src/mina-signer # Enable `--compact` once published to NPM with `repository` in package.json
101-
102-
# TODO is this redundant with the last step?
103-
- name: Publish to NPM if version has changed
104-
uses: JS-DevTools/npm-publish@v3
105-
with:
106-
token: ${{ secrets.NPM_TOKEN }}
107-
package: './src/mina-signer/package.json'
108-
strategy: upgrade
109-
env:
110-
INPUT_TOKEN: ${{ secrets.NPM_TOKEN }}
77+
- name: release-pkg-pr-version
78+
uses: ./.github/actions/release-pkg-pr-version
11179

11280
Release-on-NPM:
11381
if: github.ref == 'refs/heads/main'

0 commit comments

Comments
 (0)