2323 build :
2424 permissions :
2525 contents : write
26- runs-on : windows-latest
26+ strategy :
27+ matrix :
28+ include :
29+ - arch : x64
30+ runner : windows-latest
31+ python_arch : x64
32+ artifact_suffix : win64
33+ unsigned_exe_name : unsigned-exes-win64
34+ unsigned_msi_name : unsigned-msi-win64
35+ - arch : arm64
36+ runner : windows-11-arm
37+ python_arch : arm64
38+ artifact_suffix : aarch64
39+ unsigned_exe_name : unsigned-exes-arm64
40+ unsigned_msi_name : unsigned-msi-arm64
41+ runs-on : ${{ matrix.runner }}
42+ name : Build (${{ matrix.arch }})
2743 if : |
2844 github.event_name == 'workflow_dispatch' ||
2945 (github.event_name == 'pull_request' && github.event.action != 'closed')
3955 uses : actions/setup-python@v5
4056 with :
4157 python-version : ${{ env.PYTHON_VERSION }}
58+ architecture : ${{ matrix.python_arch }}
4259
4360 - name : Create virtual environment
4461 run : |
88105 if : github.event_name == 'workflow_dispatch'
89106 uses : actions/upload-artifact@v4
90107 with :
91- name : unsigned-exes
108+ name : ${{ matrix.unsigned_exe_name }}
92109 path : |
93110 src/dist/yasb.exe
94111 src/dist/yasbc.exe
@@ -98,14 +115,17 @@ jobs:
98115 if : github.event_name == 'workflow_dispatch'
99116 id : get_exes_artifact
100117 uses : actions/github-script@v7
118+ env :
119+ ARTIFACT_NAME : ${{ matrix.unsigned_exe_name }}
101120 with :
102121 github-token : ${{ secrets.PAT }}
103122 script : |
104123 const { owner, repo } = context.repo;
105124 const run_id = context.runId;
125+ const expectedName = process.env.ARTIFACT_NAME;
106126 const res = await github.rest.actions.listWorkflowRunArtifacts({ owner, repo, run_id });
107- const artifact = res.data.artifacts.find(a => a.name === 'unsigned-exes' );
108- if (!artifact) throw new Error('unsigned-exes artifact not found' );
127+ const artifact = res.data.artifacts.find(a => a.name === expectedName );
128+ if (!artifact) throw new Error(`${expectedName} artifact not found` );
109129 return artifact.id;
110130
111131 - name : Submit EXE signing request
@@ -161,21 +181,24 @@ jobs:
161181 if : github.event_name == 'workflow_dispatch'
162182 uses : actions/upload-artifact@v4
163183 with :
164- name : unsigned-msi
184+ name : ${{ matrix.unsigned_msi_name }}
165185 path : src/dist/out/*.msi
166186
167187 - name : Get unsigned-msi artifact id
168188 if : github.event_name == 'workflow_dispatch'
169189 id : get_msi_artifact
170190 uses : actions/github-script@v7
191+ env :
192+ ARTIFACT_NAME : ${{ matrix.unsigned_msi_name }}
171193 with :
172194 github-token : ${{ secrets.PAT }}
173195 script : |
174196 const { owner, repo } = context.repo;
175197 const run_id = context.runId;
198+ const expectedName = process.env.ARTIFACT_NAME;
176199 const res = await github.rest.actions.listWorkflowRunArtifacts({ owner, repo, run_id });
177- const artifact = res.data.artifacts.find(a => a.name === 'unsigned-msi' );
178- if (!artifact) throw new Error('unsigned-msi artifact not found' );
200+ const artifact = res.data.artifacts.find(a => a.name === expectedName );
201+ if (!artifact) throw new Error(`${expectedName} artifact not found` );
179202 return artifact.id;
180203
181204 - name : Submit MSI signing request
@@ -221,41 +244,33 @@ jobs:
221244 shell : pwsh
222245
223246 - name : Rename Artifacts File
247+ env :
248+ ARTIFACT_SUFFIX : ${{ matrix.artifact_suffix }}
224249 run : |
225- $sourceMsi = (Get-ChildItem -Path src/dist/out/*.msi).FullName
226- $targetMsi = "src/dist/out/yasb-dev-win64.msi"
250+ $msis = Get-ChildItem -Path src/dist/out/*.msi
251+ if (-not $msis) {
252+ Write-Error "No MSI files found to rename."
253+ exit 1
254+ }
255+ if ($msis.Count -gt 1) {
256+ Write-Warning "Multiple MSI files found; using the first entry ${msis[0].FullName}."
257+ }
258+ $sourceMsi = $msis[0].FullName
259+ $targetName = "yasb-dev-$($env:ARTIFACT_SUFFIX).msi"
260+ $targetMsi = Join-Path 'src/dist/out' $targetName
227261 Copy-Item -Path $sourceMsi -Destination $targetMsi -Force
228- Remove-Item -Path $sourceMsi
229- echo "FILENAME=yasb-dev-win64.msi" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
230- shell : pwsh
231-
232- - name : Generate Changelog
233- id : generate_changelog
234- if : github.event_name == 'workflow_dispatch'
235- run : |
236- # Find the latest version tag
237- $latestVersionTag = $(try { git tag --sort=-version:refname | Where-Object { $_ -match "^v\d+\.\d+\.\d+" } | Select-Object -First 1 } catch { $null })
238-
239- if ($latestVersionTag) {
240- $commits = $(git log "$latestVersionTag..HEAD" --pretty=format:"* %s (%h)" --no-merges)
241- } else {
242- $commits = $(git log -n 20 --pretty=format:"* %s (%h)" --no-merges)
262+ if ($sourceMsi -ne $targetMsi) {
263+ Remove-Item -Path $sourceMsi -Force
243264 }
244-
245- if ($commits) {
246- $changelog += $commits -join "`n"
247- } else {
248- $changelog += "* No significant changes detected since $latestVersionTag"
265+ if ($env:ARTIFACT_SUFFIX -eq 'win64') {
266+ echo "FILENAME=$targetName" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
249267 }
250-
251- # Save changelog to file for the release body
252- $changelog | Out-File -FilePath "CHANGELOG.md" -Encoding utf8
253268 shell : pwsh
254269
255270 - name : Upload Artifacts
256271 uses : actions/upload-artifact@v4
257272 with :
258- name : yasb-dev-${{ steps.get_info.outputs.COMMIT_HASH }}
273+ name : yasb-dev-${{ steps.get_info.outputs.COMMIT_HASH }}-${{ matrix.artifact_suffix }}
259274 path : |
260275 src/dist/out/*.msi
261276 retention-days : 10
@@ -268,25 +283,73 @@ jobs:
268283 unsigned-*
269284 signed-*
270285
286+ publish_dev_release :
287+ needs : build
288+ if : github.event_name == 'workflow_dispatch'
289+ permissions :
290+ contents : write
291+ runs-on : ubuntu-latest
292+ steps :
293+ - name : Checkout Repository
294+ uses : actions/checkout@v4
295+ with :
296+ fetch-depth : 0
297+ ref : ${{ github.ref }}
298+
299+ - name : Set release metadata
300+ id : release_info
301+ run : |
302+ currentDateTime=$(date -u +"%Y-%m-%d %H:%M:%S UTC")
303+ echo "BUILD_DATETIME=$currentDateTime" >> "$GITHUB_ENV"
304+ commitHash=$(git rev-parse --short HEAD)
305+ echo "COMMIT_HASH=$commitHash" >> "$GITHUB_ENV"
306+ echo "COMMIT_HASH=$commitHash" >> "$GITHUB_OUTPUT"
307+
308+ - name : Generate Changelog
309+ run : |
310+ latestVersionTag=$(git tag --sort=-version:refname | grep -E "^v[0-9]+\.[0-9]+\.[0-9]+" | head -n 1 || true)
311+ if [ -n "$latestVersionTag" ]; then
312+ commits=$(git log "$latestVersionTag..HEAD" --pretty=format:"* %s (%h)" --no-merges)
313+ else
314+ commits=$(git log -n 20 --pretty=format:"* %s (%h)" --no-merges)
315+ fi
316+ if [ -z "$commits" ]; then
317+ if [ -n "$latestVersionTag" ]; then
318+ commits="* No significant changes detected since $latestVersionTag"
319+ else
320+ commits="* No significant changes detected"
321+ fi
322+ fi
323+ printf '%s\n' "$commits" > CHANGELOG.md
324+
325+ - name : Download MSI artifacts
326+ uses : actions/download-artifact@v4
327+ with :
328+ pattern : yasb-dev-*
329+ path : artifacts
330+ merge-multiple : true
331+
332+ - name : Generate Checksums
333+ run : |
334+ cd artifacts
335+ sha256sum *.msi > checksums.txt
336+
271337 - name : Delete existing dev release
272- if : github.event_name == 'workflow_dispatch'
273338 run : |
274- # Delete existing release if it exists (ignore errors if it doesn't)
275339 gh release delete dev --yes || true
276- # Delete the tag locally and remotely
277340 git tag -d dev || true
278341 git push origin :refs/tags/dev || true
279342 env :
280343 GH_TOKEN : ${{ github.token }}
281- shell : pwsh
282344
283345 - name : Create GitHub Release
284- if : github.event_name == 'workflow_dispatch'
285346 uses : softprops/action-gh-release@v1
286347 with :
287- name : YASB Pre-release (${{ steps.get_info .outputs.COMMIT_HASH }})
348+ name : YASB Pre-release (${{ steps.release_info .outputs.COMMIT_HASH }})
288349 tag_name : dev
289350 prerelease : true
290351 files : |
291- src/dist/out/*.msi
352+ artifacts/*.msi
353+ artifacts/checksums.txt
292354 body_path : CHANGELOG.md
355+
0 commit comments