99 - ' *'
1010
1111jobs :
12- build :
12+ build-native :
1313 strategy :
1414 fail-fast : false
1515 matrix :
@@ -19,15 +19,89 @@ jobs:
1919 DOTNET_SKIP_FIRST_TIME_EXPERIENCE : true
2020 DOTNET_CLI_TELEMETRY_OPTOUT : true
2121 DOTNET_NOLOGO : true
22- NUGET_API_KEY : ${{ secrets.NUGET_API_KEY }}
2322 steps :
2423 - uses : actions/checkout@main
24+
25+ - name : Install latest .NET SDK
26+ uses : Elskom/setup-latest-dotnet@main
27+ with :
28+ SDK_VERSION : ' 10.0.100'
29+ RUNTIME_VERSIONS : ' 8.0.x'
30+
31+ - name : Clone madler/zlib for ZlibSharp.Native.
32+ run : |
33+ cd src/ZlibSharp.Native
34+ git clone https://github.com/madler/zlib.git
35+ cd ../..
36+ shell : pwsh
37+
38+ - name : Set up Visual Studio Dev shell
39+ if : runner.OS == 'Windows'
40+ uses : egor-tensin/vs-shell@master
41+ with :
42+ arch : x64
43+
44+ - name : build native library (win-x86, win-x64, win-arm, win-arm64)
45+ if : runner.OS == 'Windows'
46+ run : |
47+ cd src/ZlibSharp.Native
48+ ./build-windows.ps1
49+ cd ../..
50+ shell : pwsh
51+
52+ - name : build native library (linux-x86, linux-x64, linux-arm, linux-arm64)
53+ if : runner.OS == 'Linux'
54+ run : |
55+ cd src/ZlibSharp.Native
56+ chmod +x ./build-linux.sh
57+ ./build-linux.sh
58+ cd ../..
59+ shell : pwsh
60+
61+ - name : build native library (osx-x64, osx-arm64)
62+ if : runner.OS == 'MacOS'
63+ run : |
64+ cd src/ZlibSharp.Native
65+ chmod +x ./build-osx.sh
66+ ./build-osx.sh
67+ cd ../..
68+ shell : pwsh
69+
70+ - name : Upload artifacts
71+ uses : actions/upload-artifact@main
72+ with :
73+ name : artifacts-${{ runner.os }}
74+ path : artifacts/*
75+
76+ build :
77+ needs : build-native
78+ runs-on : ubuntu-latest
79+ permissions :
80+ contents : write
81+ env :
82+ DOTNET_SKIP_FIRST_TIME_EXPERIENCE : true
83+ DOTNET_CLI_TELEMETRY_OPTOUT : true
84+ DOTNET_NOLOGO : true
85+ steps :
86+ - uses : actions/checkout@main
87+
2588 - name : Install latest .NET SDK
2689 uses : Elskom/setup-latest-dotnet@main
2790 with :
28- SDK_VERSION : ' 9 .0.100'
91+ SDK_VERSION : ' 10 .0.100'
2992 RUNTIME_VERSIONS : ' 8.0.x'
3093
94+ - name : Download artifacts
95+ uses : actions/download-artifact@main
96+ with :
97+ pattern : artifacts-*
98+ path : artifacts/
99+ merge-multiple : true
100+
101+ - uses : geekyeggo/delete-artifact@main
102+ with :
103+ name : artifacts-*
104+
31105 - name : Restore, Build, Test, Pack, and Push.
32106 uses : Elskom/build-dotnet@main
33107 with :
0 commit comments