1212jobs :
1313 build :
1414 strategy :
15+ fail-fast : false
1516 matrix :
1617 include :
1718 - os : ubuntu-latest
1819 rid : linux-x64
1920 artifact : nativegen-linux-x64
20- - os : ubuntu-latest
21- rid : linux-musl-x64
22- artifact : nativegen-linux-musl-x64
2321 - os : windows-latest
2422 rid : win-x64
2523 artifact : nativegen-win-x64.exe
2624
2725 runs-on : ${{ matrix.os }}
26+ permissions :
27+ contents : write
2828
2929 steps :
3030 - uses : actions/checkout@v4
@@ -43,41 +43,51 @@ jobs:
4343
4444 - name : Rename artifact (Unix)
4545 if : runner.os != 'Windows'
46- run : mv ./publish/nativegen ./publish/${{ matrix.artifact }}
46+ run : |
47+ mv ./publish/nativegen ./publish/${{ matrix.artifact }}
48+ chmod +x ./publish/${{ matrix.artifact }}
4749
4850 - name : Rename artifact (Windows)
4951 if : runner.os == 'Windows'
5052 run : move .\publish\nativegen.exe .\publish\${{ matrix.artifact }}
5153
52- - name : Upload artifact
53- uses : actions/upload-artifact@v4
54+ - name : Upload to Release
55+ uses : softprops/action-gh-release@v2
5456 with :
55- name : ${{ matrix.artifact }}
56- path : ./publish/${{ matrix.artifact }}
57+ files : ./publish/${{ matrix.artifact }}
58+ generate_release_notes : true
59+ draft : false
60+ prerelease : ${{ contains(github.ref, '-') }}
61+ env :
62+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5763
58- release :
59- needs : build
64+ build-musl :
6065 runs-on : ubuntu-latest
66+ container : mcr.microsoft.com/dotnet/sdk:10.0-preview-alpine
6167 permissions :
6268 contents : write
6369
6470 steps :
65- - name : Download all artifacts
66- uses : actions/download-artifact@v4
67- with :
68- path : ./artifacts
71+ - uses : actions/checkout@v4
72+
73+ - name : Install build dependencies
74+ run : apk add --no-cache clang build-base zlib-dev
75+
76+ - name : Restore dependencies
77+ run : dotnet restore NativeCodeGen.sln
78+
79+ - name : Publish
80+ run : dotnet publish src/NativeCodeGen.Cli/NativeCodeGen.Cli.csproj -c Release -r linux-musl-x64 -o ./publish
6981
70- - name : Prepare release files
82+ - name : Rename artifact
7183 run : |
72- mkdir -p release
73- find ./artifacts -type f -exec mv {} ./release/ \;
74- chmod +x ./release/nativegen-linux-* || true
75- ls -la ./release/
84+ mv ./publish/nativegen ./publish/nativegen-linux-musl-x64
85+ chmod +x ./publish/nativegen-linux-musl-x64
7686
77- - name : Create Release
87+ - name : Upload to Release
7888 uses : softprops/action-gh-release@v2
7989 with :
80- files : ./release/*
90+ files : ./publish/nativegen-linux-musl-x64
8191 generate_release_notes : true
8292 draft : false
8393 prerelease : ${{ contains(github.ref, '-') }}
0 commit comments