Skip to content

Commit bf4424f

Browse files
The Terminal's self-contained builds can be released again (#1496)
publish.sh asked for osx.12-arm64, a versioned runtime identifier that .NET 8 and later reject (NETSDK1083); it is osx-arm64 now, with -c Release. The workflow passes the lab token to gh as GH_TOKEN rather than writing it to a file, zips each runtime's folder rather than the repository path to it, and keeps the zips and debs as artifacts. Run by hand it builds and packs without releasing unless asked to, and a pull request that touches the workflow or its scripts builds and packs the same way. Part of #539. Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 8e3a270 commit bf4424f

2 files changed

Lines changed: 43 additions & 15 deletions

File tree

‎.github/workflows/TerminalNightly.yml‎

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,87 @@
11
name: 'Terminal nightly builds'
22

3+
# Self-contained builds of the Terminal for seven runtimes, zipped, and .debs for Linux,
4+
# released to AngouriMathLab when Sources/Terminal/VERSION changes on master. Run by hand, it
5+
# builds and packs without releasing unless asked to, and a pull request that touches the
6+
# workflow or its scripts builds and packs the same way.
7+
# https://github.com/asc-community/AngouriMath/issues/539
38
on:
49
push:
510
branches:
611
- master
712
paths:
813
- 'Sources/Terminal/VERSION/**'
14+
pull_request:
15+
paths:
16+
- '.github/workflows/TerminalNightly.yml'
17+
- 'Sources/Terminal/AngouriMath.Terminal/publish.sh'
18+
- 'Sources/Terminal/AngouriMath.Terminal/pack-deb-linux.sh'
19+
workflow_dispatch:
20+
inputs:
21+
release:
22+
description: 'Release the build to AngouriMathLab'
23+
type: boolean
24+
default: false
925

1026
jobs:
1127
TerminalBuild:
1228
runs-on: ubuntu-latest
13-
29+
1430
steps:
1531
- uses: actions/checkout@v6
1632
with:
1733
submodules: 'recursive'
18-
34+
1935
- name: Setup .NET 10
2036
uses: actions/setup-dotnet@v5
2137
with:
2238
dotnet-version: '10.x'
2339
dotnet-quality: 'preview'
24-
40+
2541
- name: 'Build terminal'
2642
run: |
2743
cd Sources/Terminal/AngouriMath.Terminal
2844
./publish.sh
2945
./pack-deb-linux.sh
3046
47+
# Zipped from inside publish-output, so that an archive holds its runtime's folder and not
48+
# the repository's path to it.
3149
- name: 'Pack'
3250
run: |
33-
for arch in linux-x64 linux-arm linux-arm64 win-x64 win-x86 osx-x64 osx.12-arm64
51+
cd Sources/Terminal/AngouriMath.Terminal/publish-output
52+
for arch in linux-x64 linux-arm linux-arm64 win-x64 win-x86 osx-x64 osx-arm64
3453
do
35-
zip -r "angourimath-terminal-${arch}.zip" ./Sources/Terminal/AngouriMath.Terminal/publish-output/$arch
54+
zip -qr "$GITHUB_WORKSPACE/angourimath-terminal-${arch}.zip" "$arch"
3655
done
37-
56+
cp angourimath-terminal-*.deb "$GITHUB_WORKSPACE"
57+
58+
- name: 'Keep the packages'
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: angourimath-terminal
62+
retention-days: 7
63+
path: |
64+
angourimath-terminal-*.zip
65+
angourimath-terminal-*.deb
66+
3867
- name: 'Release'
68+
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.release)
69+
env:
70+
GH_TOKEN: ${{ secrets.LAB_ACCESS_TOKEN }}
3971
run: |
4072
name=$(cat ./Sources/Terminal/VERSION/VERSION)
4173
echo "Version: $name"
42-
43-
cp ./Sources/Terminal/AngouriMath.Terminal/publish-output/angourimath-terminal-*.deb .
44-
45-
echo ${{ secrets.LAB_ACCESS_TOKEN }} > token.txt
46-
gh auth login --with-token < token.txt
4774
gh release create v$name \
4875
'angourimath-terminal-linux-x64.zip' \
4976
'angourimath-terminal-linux-arm.zip' \
5077
'angourimath-terminal-linux-arm64.zip' \
5178
'angourimath-terminal-win-x64.zip' \
5279
'angourimath-terminal-win-x86.zip' \
5380
'angourimath-terminal-osx-x64.zip' \
54-
'angourimath-terminal-osx.12-arm64.zip' \
81+
'angourimath-terminal-osx-arm64.zip' \
5582
'angourimath-terminal-amd64.deb' \
5683
'angourimath-terminal-arm.deb' \
5784
'angourimath-terminal-arm64.deb' \
5885
-R asc-community/AngouriMathLab \
5986
-t 'AngouriMath.Terminal' \
6087
-n "Expand 'assets' and choose the one for your OS"
61-

‎Sources/Terminal/AngouriMath.Terminal/publish.sh‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#!/bin/bash
22

33

4-
for arch in linux-x64 linux-arm linux-arm64 win-x64 win-x86 osx-x64 osx.12-arm64
4+
# Portable runtime identifiers: since .NET 8 a versioned one such as osx.12-arm64 is not
5+
# recognised, and the publish fails with NETSDK1083.
6+
for arch in linux-x64 linux-arm linux-arm64 win-x64 win-x86 osx-x64 osx-arm64
57
do
68
dotnet publish \
79
-r $arch \
8-
-c release \
10+
-c Release \
911
-o ./publish-output/$arch \
1012
--self-contained
1113
done

0 commit comments

Comments
 (0)