@@ -4,24 +4,24 @@ name: _build
4
4
on :
5
5
workflow_call :
6
6
inputs :
7
- should_run :
8
- description : Whether or not to run the build job
9
- type : boolean
10
- default : false
11
- artifact_prefix :
12
- description : Artifact prefix
7
+ builder_ref :
8
+ description : Git ref of build-emacs-for-macos to use
13
9
type : string
14
- required : false
10
+ required : true
15
11
os :
16
12
description : GitHub Actions runner OS
17
13
type : string
18
14
required : false
19
- default : " macos-12 "
15
+ default : " macos-13 "
20
16
build_os :
21
17
description : Target OS to build for
22
18
type : string
23
19
required : false
24
- default : " macos-12"
20
+ default : " macos-13"
21
+ artifact_prefix :
22
+ description : Artifact prefix for build_os
23
+ type : string
24
+ required : false
25
25
git_ref :
26
26
description : Git ref to build
27
27
type : string
65
65
AC_SIGN_IDENTITY :
66
66
description : Apple Connect Signing Identify
67
67
required : true
68
- TAP_REPO_TOKEN :
69
- description : Homebrew Tap Token
70
- required : true
71
68
outputs :
72
69
package_created :
73
70
description : " Whether or not a package was created"
74
71
value : ${{ jobs.package.result == 'success' }}
75
72
76
73
jobs :
77
- prepare :
78
- runs-on : ${{ inputs.os }}
79
- outputs :
80
- builder_sha : ${{ steps.builder_sha.outputs.sha }}
81
- emacs_sha_override : ${{ steps.emacs_sha.outputs.sha }}
82
- test_plan_args : ${{ steps.test_plan_args.outputs.args }}
83
- steps :
84
- - name : Download emacs-builder git SHA artifact
85
- uses : actions/download-artifact@v4
86
- with :
87
- name : emacs-builder-git-sha
88
- path : ./
89
- - name : Store builder Git SHA
90
- id : builder_sha
91
- run : >-
92
- echo "sha=$(cat emacs-builder-git-sha.txt)" >> $GITHUB_OUTPUT
93
- - name : Prepare plan test args
94
- id : test_plan_args
95
- if : ${{ inputs.test_build_name != '' }}
96
- run : >-
97
- echo "args=--test-build '${{ inputs.test_build_name }}' --test-release-type '${{ inputs.test_release_type }}'" >> $GITHUB_OUTPUT
98
- - name : Set git SHA override
99
- id : emacs_sha
100
- if : ${{ inputs.git_sha != '' }}
101
- run : >-
102
- echo "sha=--sha '${{ inputs.git_sha }}'" >> $GITHUB_OUTPUT
103
74
plan :
104
- needs : [prepare]
105
75
runs-on : ${{ inputs.build_os }}
106
76
outputs :
107
77
check : ${{ steps.check.outputs.result }}
@@ -110,32 +80,37 @@ jobs:
110
80
uses : actions/checkout@v4
111
81
with :
112
82
repository : jimeh/build-emacs-for-macos
113
- ref : ${{ needs.prepare.outputs.builder_sha }}
114
- - uses : actions/setup-go@v5
115
- if : ${{ inputs.os != inputs.build_os }}
116
- with :
117
- go-version : " 1.23"
118
- - name : Build emacs-builder tool
119
- if : ${{ inputs.os != inputs.build_os }}
120
- run : make build
83
+ ref : ${{ inputs.builder_ref }}
121
84
- name : Download pre-built emacs-builder artifact
122
- if : ${{ inputs.os == inputs.build_os }}
123
85
uses : actions/download-artifact@v4
124
86
with :
125
- name : emacs-builder
87
+ name : emacs-builder-${{ runner.arch }}
126
88
path : bin
127
89
- name : Ensure emacs-builder is executable
128
- if : ${{ inputs.os == inputs.build_os }}
129
90
run : chmod +x bin/emacs-builder
130
- - uses : DeterminateSystems/nix-installer-action@main
131
- - uses : DeterminateSystems/magic-nix-cache-action@main
91
+ - uses : nixbuild/nix-quick-install-action@v29
92
+ - uses : nix-community/cache-nix-action@v5
93
+ with :
94
+ primary-key : nix-${{ runner.arch }}-${{ hashFiles('**/flake.*') }}
95
+ - name : Install dependencies
96
+ run : nix develop --command nix flake metadata
97
+ - name : Prepare plan test args
98
+ id : test_plan_args
99
+ if : inputs.test_build_name != ''
100
+ run : >-
101
+ echo "args=--test-build '${{ inputs.test_build_name }}' --test-release-type '${{ inputs.test_release_type }}'" >> "$GITHUB_OUTPUT"
102
+ - name : Set git SHA override
103
+ id : emacs_sha
104
+ if : inputs.git_sha != ''
105
+ run : >-
106
+ echo "sha=--sha '${{ inputs.git_sha }}'" >> "$GITHUB_OUTPUT"
132
107
- name : Plan build
133
108
run : >-
134
109
nix develop --command
135
110
bin/emacs-builder -l debug plan --output build-plan.yml
136
111
--output-dir '${{ github.workspace }}/builds'
137
- ${{ needs.prepare .outputs.test_plan_args }}
138
- ${{ needs.prepare .outputs.emacs_sha_override }}
112
+ ${{ steps.test_plan_args .outputs.args }}
113
+ ${{ steps.emacs_sha .outputs.sha }}
139
114
'${{ inputs.git_ref }}'
140
115
env :
141
116
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
@@ -151,35 +126,39 @@ jobs:
151
126
id : check
152
127
continue-on-error : true
153
128
run : |
154
- echo "result=$((bin/emacs-builder -l debug release --plan build-plan.yml check && echo 'ok') || echo 'fail')" >> $GITHUB_OUTPUT
129
+ echo "result=$((bin/emacs-builder -l debug release --plan build-plan.yml check && echo 'ok') || echo 'fail')" >> " $GITHUB_OUTPUT"
155
130
env :
156
131
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
157
132
- run : echo 'Planned release already seems to exist.'
158
- if : ${{ steps.check.outputs.result == 'ok' }}
133
+ if : steps.check.outputs.result == 'ok'
159
134
160
135
build :
161
136
runs-on : ${{ inputs.build_os }}
162
- needs : [prepare, plan]
137
+ needs : [plan]
163
138
# Only run if check for existing release and asset failed.
164
- if : ${{ needs.plan.outputs.check == 'fail' }}
139
+ if : needs.plan.outputs.check == 'fail'
165
140
steps :
166
141
- name : Checkout build-emacs-for-macos repo
167
142
uses : actions/checkout@v4
168
143
with :
169
144
repository : jimeh/build-emacs-for-macos
170
- ref : ${{ needs.prepare.outputs.builder_sha }}
145
+ ref : ${{ inputs.builder_ref }}
171
146
path : builder
172
- - uses : DeterminateSystems/nix-installer-action@main
173
- - uses : DeterminateSystems/magic-nix-cache-action@main
147
+ - uses : nixbuild/nix-quick-install-action@v29
148
+ - uses : nix-community/cache-nix-action@v5
149
+ with :
150
+ primary-key : nix-${{ runner.arch }}-${{ hashFiles('**/flake.*') }}
174
151
- name : Download build-plan artifact
175
152
uses : actions/download-artifact@v4
176
153
with :
177
154
name : ${{ inputs.artifact_prefix }}build-plan
178
155
path : ./builder/
179
156
- name : Install dependencies
157
+ run : nix develop --command nix flake metadata
158
+ working-directory : builder
159
+ - name : Install Ruby dependencies
180
160
run : >-
181
- nix develop
182
- --command make bootstrap-ruby
161
+ nix develop --command make bootstrap-ruby
183
162
working-directory : builder
184
163
env :
185
164
BUNDLE_WITHOUT : " development"
@@ -209,21 +188,21 @@ jobs:
209
188
210
189
package :
211
190
runs-on : ${{ inputs.os }}
212
- needs : [prepare, plan, build]
191
+ needs : [plan, build]
213
192
steps :
214
- - uses : actions/setup-python@v5
215
- with :
216
- python-version : " 3.11"
217
- - name : Install dmgbuild
218
- run : |
219
- $(command -v pip3 || command -v pip) install --upgrade dmgbuild
220
193
- name : Download pre-built emacs-builder artifact
221
194
uses : actions/download-artifact@v4
222
195
with :
223
- name : emacs-builder
196
+ name : emacs-builder-${{ runner.arch }}
224
197
path : bin
225
198
- name : Ensure emacs-builder is executable
226
199
run : chmod +x bin/emacs-builder
200
+ - uses : actions/setup-python@v5
201
+ with :
202
+ python-version : " 3.11"
203
+ - name : Install dmgbuild
204
+ run : |
205
+ $(command -v pip3 || command -v pip) install --upgrade dmgbuild
227
206
- name : Download build-plan artifact
228
207
uses : actions/download-artifact@v4
229
208
with :
@@ -278,6 +257,6 @@ jobs:
278
257
builds/*.sha*
279
258
if-no-files-found : error
280
259
- name : Clean up keychain used for signing certificate
281
- if : ${{ always() }}
260
+ if : always()
282
261
run : |
283
262
security delete-keychain "$RUNNER_TEMP/app-signing.keychain-db"
0 commit comments