Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 39 additions & 13 deletions .github/workflows/TerminalNightly.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,87 @@
name: 'Terminal nightly builds'

# Self-contained builds of the Terminal for seven runtimes, zipped, and .debs for Linux,
# released to AngouriMathLab when Sources/Terminal/VERSION changes on master. 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.
# https://github.com/asc-community/AngouriMath/issues/539
on:
push:
branches:
- master
paths:
- 'Sources/Terminal/VERSION/**'
pull_request:
paths:
- '.github/workflows/TerminalNightly.yml'
- 'Sources/Terminal/AngouriMath.Terminal/publish.sh'
- 'Sources/Terminal/AngouriMath.Terminal/pack-deb-linux.sh'
workflow_dispatch:
inputs:
release:
description: 'Release the build to AngouriMathLab'
type: boolean
default: false

jobs:
TerminalBuild:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
with:
submodules: 'recursive'

- name: Setup .NET 10
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.x'
dotnet-quality: 'preview'

- name: 'Build terminal'
run: |
cd Sources/Terminal/AngouriMath.Terminal
./publish.sh
./pack-deb-linux.sh

# Zipped from inside publish-output, so that an archive holds its runtime's folder and not
# the repository's path to it.
- name: 'Pack'
run: |
for arch in linux-x64 linux-arm linux-arm64 win-x64 win-x86 osx-x64 osx.12-arm64
cd Sources/Terminal/AngouriMath.Terminal/publish-output
for arch in linux-x64 linux-arm linux-arm64 win-x64 win-x86 osx-x64 osx-arm64
do
zip -r "angourimath-terminal-${arch}.zip" ./Sources/Terminal/AngouriMath.Terminal/publish-output/$arch
zip -qr "$GITHUB_WORKSPACE/angourimath-terminal-${arch}.zip" "$arch"
done

cp angourimath-terminal-*.deb "$GITHUB_WORKSPACE"

- name: 'Keep the packages'
uses: actions/upload-artifact@v4
with:
name: angourimath-terminal
retention-days: 7
path: |
angourimath-terminal-*.zip
angourimath-terminal-*.deb

- name: 'Release'
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.release)
env:
GH_TOKEN: ${{ secrets.LAB_ACCESS_TOKEN }}
run: |
name=$(cat ./Sources/Terminal/VERSION/VERSION)
echo "Version: $name"

cp ./Sources/Terminal/AngouriMath.Terminal/publish-output/angourimath-terminal-*.deb .

echo ${{ secrets.LAB_ACCESS_TOKEN }} > token.txt
gh auth login --with-token < token.txt
gh release create v$name \
'angourimath-terminal-linux-x64.zip' \
'angourimath-terminal-linux-arm.zip' \
'angourimath-terminal-linux-arm64.zip' \
'angourimath-terminal-win-x64.zip' \
'angourimath-terminal-win-x86.zip' \
'angourimath-terminal-osx-x64.zip' \
'angourimath-terminal-osx.12-arm64.zip' \
'angourimath-terminal-osx-arm64.zip' \
'angourimath-terminal-amd64.deb' \
'angourimath-terminal-arm.deb' \
'angourimath-terminal-arm64.deb' \
-R asc-community/AngouriMathLab \
-t 'AngouriMath.Terminal' \
-n "Expand 'assets' and choose the one for your OS"

6 changes: 4 additions & 2 deletions Sources/Terminal/AngouriMath.Terminal/publish.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/bin/bash


for arch in linux-x64 linux-arm linux-arm64 win-x64 win-x86 osx-x64 osx.12-arm64
# Portable runtime identifiers: since .NET 8 a versioned one such as osx.12-arm64 is not
# recognised, and the publish fails with NETSDK1083.
for arch in linux-x64 linux-arm linux-arm64 win-x64 win-x86 osx-x64 osx-arm64
do
dotnet publish \
-r $arch \
-c release \
-c Release \
-o ./publish-output/$arch \
--self-contained
done
Expand Down
Loading