2626jobs :
2727 build :
2828 runs-on : ${{ matrix.os }}
29+ permissions :
30+ contents : write
2931 strategy :
3032 matrix :
3133 include :
3234 - os : windows-latest
3335 rid : win-x64
36+ artifact-rid : win-x64
3437 binary-extension : ' .exe'
3538 - os : macos-latest
3639 rid : osx-arm64
40+ artifact-rid : osx-arm64
3741 binary-extension : ' '
3842 - os : ubuntu-latest
39- rid : linux-x64
43+ rid : linux-musl-x64
44+ artifact-rid : linux-x64
45+ binary-extension : ' '
46+ - os : ubuntu-24.04-arm
47+ rid : linux-musl-arm64
48+ artifact-rid : linux-arm64
4049 binary-extension : ' '
4150
4251 env :
4352 RUNTIME_IDENTIFIER : ${{ matrix.rid }}
4453
4554 steps :
46- - name : Install Linux Dependencies
47- if : matrix.os == 'ubuntu-latest'
48- run : sudo apt-get update && sudo apt-get install -y clang zlib1g-dev
49-
5055 - name : Setup .NET SDK
5156 uses : actions/setup-dotnet@v4
5257 with :
@@ -55,18 +60,36 @@ jobs:
5560 - name : Checkout code
5661 uses : actions/checkout@v4
5762
58- - name : Publish
63+ - name : Publish on non-Linux
64+ if : runner.os != 'Linux'
5965 run : dotnet publish Lagrange.Milky -c Release -r ${{ matrix.rid }}
6066
61- - if : github.event_name != 'pull_request'
62- uses : actions/upload-artifact@v4
63- with :
64- name : Lagrange.Milky-${{ matrix.rid }}
65- path : Lagrange.Milky/bin/Release/net10.0/${{ matrix.rid }}/publish/Lagrange.Milky${{ matrix.binary-extension }}
66- - if : github.event_name != 'pull_request'
67- uses : actions/upload-artifact@v4
67+ - name : Publish on Linux
68+ if : runner.os == 'Linux'
69+ run : |
70+ docker run --rm \
71+ -e HOME=/tmp \
72+ -e DOTNET_CLI_HOME=/tmp/dotnet \
73+ -e NUGET_PACKAGES=/tmp/nuget/packages \
74+ -e DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 \
75+ -v "$PWD:/src" \
76+ -w /src \
77+ mcr.microsoft.com/dotnet/sdk:10.0-alpine-aot \
78+ sh -lc "apk add --no-cache ca-certificates cmake make pkgconf openssl-dev openssl-libs-static zlib-static && mkdir -p /tmp/dotnet /tmp/nuget/packages && dotnet publish Lagrange.Milky -c Release -r ${{ matrix.rid }} && chmod -R a+rwX /src/Lagrange.Milky/bin"
79+
80+ - name : Rename Binary
81+ if : github.event_name != 'pull_request'
82+ shell : bash
83+ run : |
84+ mv "Lagrange.Milky/bin/Release/net10.0/${{ matrix.rid }}/publish/Lagrange.Milky${{ matrix.binary-extension }}" \
85+ "Lagrange.Milky/bin/Release/net10.0/${{ matrix.rid }}/publish/Lagrange.Milky-${{ matrix.artifact-rid }}${{ matrix.binary-extension }}"
86+
87+ - name : Upload to Pre-Release
88+ if : github.event_name != 'pull_request'
89+ uses : softprops/action-gh-release@v2
6890 with :
69- name : Lagrange.Milky-${{ matrix.rid }}-symbol-files
70- path : |
71- Lagrange.Milky/bin/Release/net10.0/${{ matrix.rid }}/publish/*
72- !Lagrange.Milky/bin/Release/net10.0/${{ matrix.rid }}/publish/Lagrange.Milky${{ matrix.binary-extension }}
91+ tag_name : nightly
92+ name : Nightly Build
93+ prerelease : true
94+ make_latest : false
95+ files : Lagrange.Milky/bin/Release/net10.0/${{ matrix.rid }}/publish/Lagrange.Milky-${{ matrix.artifact-rid }}${{ matrix.binary-extension }}
0 commit comments