Skip to content

Commit a0b3ae3

Browse files
The Terminal is released with the packages, under their version (#1541)
The self-contained builds and .debs were released to AngouriMathLab when Sources/Terminal/VERSION changed on master, and that file still read 1.0.0.6. They are now released on the event that publishes the packages, `release: published`, under the version Nuget.yml reads from the release's tag, so a 2.6.0 release carries a 2.6.0 Terminal. VERSION is gone, and pack-deb-linux.sh takes the version from the workflow. Run by hand, the workflow packs the version it is given and releases only when asked; a pull request packs 0.0.0. Part of #539. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 40b7e58 commit a0b3ae3

4 files changed

Lines changed: 42 additions & 19 deletions

File tree

‎.github/workflows/EverythingBuild.yml‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ jobs:
3333
run: dotnet build Sources/Wrappers/AngouriMath.Interactive/AngouriMath.Interactive.fsproj
3434

3535
# AngouriMath.Terminal is a published package -- Nuget.yml packs and pushes it as a
36-
# dotnet tool -- and no pre-merge job built it. TerminalNightly.yml is the only job
37-
# that does, and it fires on push to master behind a path filter on
38-
# Sources/Terminal/VERSION/**, so a change that breaks the terminal is not seen until
39-
# somebody bumps that file or cuts a release.
36+
# dotnet tool -- and no pre-merge job built it. TerminalNightly.yml is the only other job
37+
# that does, and it fires on a release, so a change that breaks the terminal would not be
38+
# seen until a release was cut.
4039
- name: Build Terminal
4140
run: dotnet build Sources/Terminal/AngouriMath.Terminal/AngouriMath.Terminal.fsproj
4241

‎.github/workflows/TerminalNightly.yml‎

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
1-
name: 'Terminal nightly builds'
1+
name: 'Terminal release'
22

33
# 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.
4+
# released to AngouriMathLab alongside each release of the packages and under the same
5+
# version, read from the release's tag as Nuget.yml reads it. Run by hand, it builds and packs
6+
# without releasing unless asked to, and a pull request that touches the workflow or its
7+
# scripts builds and packs the same way.
78
# https://github.com/asc-community/AngouriMath/issues/539
89
on:
9-
push:
10-
branches:
11-
- master
12-
paths:
13-
- 'Sources/Terminal/VERSION/**'
10+
release:
11+
types: [published]
1412
pull_request:
1513
paths:
1614
- '.github/workflows/TerminalNightly.yml'
1715
- 'Sources/Terminal/AngouriMath.Terminal/publish.sh'
1816
- 'Sources/Terminal/AngouriMath.Terminal/pack-deb-linux.sh'
1917
workflow_dispatch:
2018
inputs:
19+
version:
20+
description: 'The version to pack, and to release under if releasing'
21+
type: string
22+
default: '0.0.0'
2123
release:
2224
description: 'Release the build to AngouriMathLab'
2325
type: boolean
@@ -38,7 +40,29 @@ jobs:
3840
dotnet-version: '10.x'
3941
dotnet-quality: 'preview'
4042

43+
# The release's tag without its 'v', as Nuget.yml reads it, so that the Terminal is released
44+
# under the packages' version; by hand, the version asked for; for a pull request, 0.0.0.
45+
- name: 'Determine version'
46+
id: version
47+
env:
48+
TAG: ${{ github.event.release.tag_name }}
49+
ASKED: ${{ inputs.version }}
50+
run: |
51+
if [ "${{ github.event_name }}" = 'release' ]; then
52+
version="${TAG#v}"
53+
else
54+
version="${ASKED:-0.0.0}"
55+
fi
56+
if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$ ]]; then
57+
echo "Error: '$version' is not a version such as 2.6.0 or 2.6.0-beta.1"
58+
exit 1
59+
fi
60+
echo "Version: $version"
61+
echo "version=$version" >> "$GITHUB_OUTPUT"
62+
4163
- name: 'Build terminal'
64+
env:
65+
TERMINAL_VERSION: ${{ steps.version.outputs.version }}
4266
run: |
4367
cd Sources/Terminal/AngouriMath.Terminal
4468
./publish.sh
@@ -65,13 +89,12 @@ jobs:
6589
angourimath-terminal-*.deb
6690
6791
- name: 'Release'
68-
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.release)
92+
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.release)
6993
env:
7094
GH_TOKEN: ${{ secrets.LAB_ACCESS_TOKEN }}
95+
VERSION: ${{ steps.version.outputs.version }}
7196
run: |
72-
name=$(cat ./Sources/Terminal/VERSION/VERSION)
73-
echo "Version: $name"
74-
gh release create v$name \
97+
gh release create "v$VERSION" \
7598
'angourimath-terminal-linux-x64.zip' \
7699
'angourimath-terminal-linux-arm.zip' \
77100
'angourimath-terminal-linux-arm64.zip' \

‎Sources/Terminal/AngouriMath.Terminal/pack-deb-linux.sh‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/bin/bash
2+
# The .deb's version is the release's: TerminalNightly.yml passes the packages' version, read
3+
# from the release's tag.
4+
version="${TERMINAL_VERSION:?set TERMINAL_VERSION to the version to pack, such as 2.6.0}"
25
cd publish-output
36

47
for arch in amd64 arm arm64
@@ -14,7 +17,6 @@ do
1417
dotnet_arch='linux-arm64'
1518
fi
1619

17-
version=$(cat ../../VERSION/VERSION)
1820
filename="angourimath-terminal_${version}_${arch}"
1921

2022
rm -r $filename

‎Sources/Terminal/VERSION/VERSION‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)