Skip to content

Commit 406161a

Browse files
committed
Build on workflow dispatch instead of push to main
1 parent 0b479df commit 406161a

4 files changed

Lines changed: 74 additions & 9 deletions

File tree

.github/workflows/build.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: build
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
sha:
7+
description: "The full SHA of the commit to build (defaults to the latest commit on main)."
8+
type: string
9+
required: false
10+
11+
env:
12+
FORCE_COLOR: 1
13+
14+
permissions: {}
15+
16+
jobs:
17+
linux:
18+
uses: ./.github/workflows/linux.yml
19+
with:
20+
ref: ${{ inputs.sha || github.sha }}
21+
permissions:
22+
packages: write
23+
id-token: write
24+
attestations: write
25+
26+
macos:
27+
uses: ./.github/workflows/macos.yml
28+
with:
29+
ref: ${{ inputs.sha || github.sha }}
30+
permissions:
31+
id-token: write
32+
attestations: write
33+
34+
windows:
35+
uses: ./.github/workflows/windows.yml
36+
with:
37+
ref: ${{ inputs.sha || github.sha }}
38+
permissions:
39+
id-token: write
40+
attestations: write

.github/workflows/linux.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
name: linux
22

33
on:
4-
push:
5-
branches: [ main ]
64
pull_request:
5+
workflow_call:
6+
inputs:
7+
ref:
8+
description: "The git ref to build."
9+
type: string
10+
required: false
11+
default: ''
712

813
concurrency:
9-
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
14+
group: linux-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
1015
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
1116

1217
env:
@@ -26,6 +31,7 @@ jobs:
2631
steps:
2732
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2833
with:
34+
ref: ${{ inputs.ref || '' }}
2935
persist-credentials: false
3036

3137
- name: Emit rustc version
@@ -64,6 +70,7 @@ jobs:
6470
steps:
6571
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6672
with:
73+
ref: ${{ inputs.ref || '' }}
6774
persist-credentials: false
6875

6976
- name: Set up uv
@@ -142,6 +149,7 @@ jobs:
142149
steps:
143150
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
144151
with:
152+
ref: ${{ inputs.ref || '' }}
145153
fetch-depth: 0
146154
persist-credentials: false
147155

@@ -216,6 +224,7 @@ jobs:
216224
steps: &build_steps
217225
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
218226
with:
227+
ref: ${{ inputs.ref || '' }}
219228
fetch-depth: 0
220229
persist-credentials: false
221230

.github/workflows/macos.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
name: macos
22

33
on:
4-
push:
5-
branches: [ main ]
64
pull_request:
5+
workflow_call:
6+
inputs:
7+
ref:
8+
description: "The git ref to build."
9+
type: string
10+
required: false
11+
default: ''
712

813
concurrency:
9-
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
14+
group: macos-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
1015
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
1116

1217
env:
@@ -26,6 +31,7 @@ jobs:
2631
steps:
2732
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2833
with:
34+
ref: ${{ inputs.ref || '' }}
2935
persist-credentials: false
3036

3137
- name: Emit rustc version
@@ -60,6 +66,7 @@ jobs:
6066
steps:
6167
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6268
with:
69+
ref: ${{ inputs.ref || '' }}
6370
fetch-depth: 0
6471
persist-credentials: false
6572

@@ -127,6 +134,7 @@ jobs:
127134
steps:
128135
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
129136
with:
137+
ref: ${{ inputs.ref || '' }}
130138
fetch-depth: 0
131139
persist-credentials: false
132140

.github/workflows/windows.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
name: windows
22

33
on:
4-
push:
5-
branches: [ main ]
64
pull_request:
5+
workflow_call:
6+
inputs:
7+
ref:
8+
description: "The git ref to build."
9+
type: string
10+
required: false
11+
default: ''
712

813
concurrency:
9-
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
14+
group: windows-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
1015
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
1116

1217
env:
@@ -26,6 +31,7 @@ jobs:
2631
steps:
2732
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2833
with:
34+
ref: ${{ inputs.ref || '' }}
2935
persist-credentials: false
3036

3137
- name: Emit rustc version
@@ -60,6 +66,7 @@ jobs:
6066
steps:
6167
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6268
with:
69+
ref: ${{ inputs.ref || '' }}
6370
fetch-depth: 0
6471
persist-credentials: false
6572

@@ -128,6 +135,7 @@ jobs:
128135
steps:
129136
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
130137
with:
138+
ref: ${{ inputs.ref || '' }}
131139
fetch-depth: 0
132140
persist-credentials: false
133141

0 commit comments

Comments
 (0)