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
7 changes: 3 additions & 4 deletions .github/workflows/EverythingBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ jobs:
run: dotnet build Sources/Wrappers/AngouriMath.Interactive/AngouriMath.Interactive.fsproj

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

Expand Down
49 changes: 36 additions & 13 deletions .github/workflows/TerminalNightly.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
name: 'Terminal nightly builds'
name: 'Terminal release'

# 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.
# released to AngouriMathLab alongside each release of the packages and under the same
# version, read from the release's tag as Nuget.yml reads it. 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/**'
release:
types: [published]
pull_request:
paths:
- '.github/workflows/TerminalNightly.yml'
- 'Sources/Terminal/AngouriMath.Terminal/publish.sh'
- 'Sources/Terminal/AngouriMath.Terminal/pack-deb-linux.sh'
workflow_dispatch:
inputs:
version:
description: 'The version to pack, and to release under if releasing'
type: string
default: '0.0.0'
release:
description: 'Release the build to AngouriMathLab'
type: boolean
Expand All @@ -38,7 +40,29 @@ jobs:
dotnet-version: '10.x'
dotnet-quality: 'preview'

# The release's tag without its 'v', as Nuget.yml reads it, so that the Terminal is released
# under the packages' version; by hand, the version asked for; for a pull request, 0.0.0.
- name: 'Determine version'
id: version
env:
TAG: ${{ github.event.release.tag_name }}
ASKED: ${{ inputs.version }}
run: |
if [ "${{ github.event_name }}" = 'release' ]; then
version="${TAG#v}"
else
version="${ASKED:-0.0.0}"
fi
if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$ ]]; then
echo "Error: '$version' is not a version such as 2.6.0 or 2.6.0-beta.1"
exit 1
fi
echo "Version: $version"
echo "version=$version" >> "$GITHUB_OUTPUT"

- name: 'Build terminal'
env:
TERMINAL_VERSION: ${{ steps.version.outputs.version }}
run: |
cd Sources/Terminal/AngouriMath.Terminal
./publish.sh
Expand All @@ -65,13 +89,12 @@ jobs:
angourimath-terminal-*.deb

- name: 'Release'
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.release)
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.release)
env:
GH_TOKEN: ${{ secrets.LAB_ACCESS_TOKEN }}
VERSION: ${{ steps.version.outputs.version }}
run: |
name=$(cat ./Sources/Terminal/VERSION/VERSION)
echo "Version: $name"
gh release create v$name \
gh release create "v$VERSION" \
'angourimath-terminal-linux-x64.zip' \
'angourimath-terminal-linux-arm.zip' \
'angourimath-terminal-linux-arm64.zip' \
Expand Down
4 changes: 3 additions & 1 deletion Sources/Terminal/AngouriMath.Terminal/pack-deb-linux.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash
# The .deb's version is the release's: TerminalNightly.yml passes the packages' version, read
# from the release's tag.
version="${TERMINAL_VERSION:?set TERMINAL_VERSION to the version to pack, such as 2.6.0}"
cd publish-output

for arch in amd64 arm arm64
Expand All @@ -14,7 +17,6 @@ do
dotnet_arch='linux-arm64'
fi

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

rm -r $filename
Expand Down
1 change: 0 additions & 1 deletion Sources/Terminal/VERSION/VERSION

This file was deleted.

Loading