Repository navigation
amcli says with respect to and for, where it said over #97
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 'Terminal release' | |
| # Self-contained builds of the Terminal for seven runtimes, zipped, and .debs for Linux, | |
| # 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: | |
| release: | |
| types: [published] | |
| pull_request: | |
| paths: | |
| - '.github/workflows/TerminalNightly.yml' | |
| - 'Sources/Terminal/AngouriMath.Terminal/publish.sh' | |
| - 'Sources/Terminal/AngouriMath.Terminal/pack-deb-linux.sh' | |
| - 'Sources/Terminal/AngouriMath.Terminal/amcli.1' | |
| - 'Sources/Terminal/AngouriMath.Terminal/amcli.bash' | |
| 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 | |
| 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' | |
| # 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 | |
| ./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: | | |
| 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 -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 == 'release' || (github.event_name == 'workflow_dispatch' && inputs.release) | |
| env: | |
| GH_TOKEN: ${{ secrets.LAB_ACCESS_TOKEN }} | |
| VERSION: ${{ steps.version.outputs.version }} | |
| run: | | |
| gh release create "v$VERSION" \ | |
| '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-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" |