|
1 | 1 | name: 'Terminal nightly builds' |
2 | 2 |
|
| 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 |
3 | 8 | on: |
4 | 9 | push: |
5 | 10 | branches: |
6 | 11 | - master |
7 | 12 | paths: |
8 | 13 | - '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 |
9 | 25 |
|
10 | 26 | jobs: |
11 | 27 | TerminalBuild: |
12 | 28 | runs-on: ubuntu-latest |
13 | | - |
| 29 | + |
14 | 30 | steps: |
15 | 31 | - uses: actions/checkout@v6 |
16 | 32 | with: |
17 | 33 | submodules: 'recursive' |
18 | | - |
| 34 | + |
19 | 35 | - name: Setup .NET 10 |
20 | 36 | uses: actions/setup-dotnet@v5 |
21 | 37 | with: |
22 | 38 | dotnet-version: '10.x' |
23 | 39 | dotnet-quality: 'preview' |
24 | | - |
| 40 | + |
25 | 41 | - name: 'Build terminal' |
26 | 42 | run: | |
27 | 43 | cd Sources/Terminal/AngouriMath.Terminal |
28 | 44 | ./publish.sh |
29 | 45 | ./pack-deb-linux.sh |
30 | 46 |
|
| 47 | + # Zipped from inside publish-output, so that an archive holds its runtime's folder and not |
| 48 | + # the repository's path to it. |
31 | 49 | - name: 'Pack' |
32 | 50 | 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 |
34 | 53 | 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" |
36 | 55 | 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 | +
|
38 | 67 | - name: 'Release' |
| 68 | + if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.release) |
| 69 | + env: |
| 70 | + GH_TOKEN: ${{ secrets.LAB_ACCESS_TOKEN }} |
39 | 71 | run: | |
40 | 72 | name=$(cat ./Sources/Terminal/VERSION/VERSION) |
41 | 73 | 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 |
47 | 74 | gh release create v$name \ |
48 | 75 | 'angourimath-terminal-linux-x64.zip' \ |
49 | 76 | 'angourimath-terminal-linux-arm.zip' \ |
50 | 77 | 'angourimath-terminal-linux-arm64.zip' \ |
51 | 78 | 'angourimath-terminal-win-x64.zip' \ |
52 | 79 | 'angourimath-terminal-win-x86.zip' \ |
53 | 80 | 'angourimath-terminal-osx-x64.zip' \ |
54 | | - 'angourimath-terminal-osx.12-arm64.zip' \ |
| 81 | + 'angourimath-terminal-osx-arm64.zip' \ |
55 | 82 | 'angourimath-terminal-amd64.deb' \ |
56 | 83 | 'angourimath-terminal-arm.deb' \ |
57 | 84 | 'angourimath-terminal-arm64.deb' \ |
58 | 85 | -R asc-community/AngouriMathLab \ |
59 | 86 | -t 'AngouriMath.Terminal' \ |
60 | 87 | -n "Expand 'assets' and choose the one for your OS" |
61 | | - |
|
0 commit comments