|
9 | 9 | - '*' |
10 | 10 |
|
11 | 11 | jobs: |
12 | | - build: |
| 12 | + build-native: |
13 | 13 | strategy: |
14 | 14 | fail-fast: false |
15 | 15 | matrix: |
16 | | - os: [windows-latest, ubuntu-latest, macos-latest] |
| 16 | + os: [windows-11-arm, ubuntu-latest, macos-latest] |
17 | 17 | runs-on: ${{ matrix.os }} |
18 | 18 | env: |
19 | 19 | DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true |
20 | 20 | DOTNET_CLI_TELEMETRY_OPTOUT: true |
21 | 21 | DOTNET_NOLOGO: true |
22 | | - NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} |
23 | 22 | steps: |
24 | 23 | - 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 x86 shell |
| 39 | + if: runner.OS == 'Windows' |
| 40 | + uses: egor-tensin/vs-shell@master |
| 41 | + with: |
| 42 | + arch: x86 |
| 43 | + |
| 44 | + - name: CMake configure and build native library (win-x86) |
| 45 | + if: runner.OS == 'Windows' |
| 46 | + run: | |
| 47 | + cd src/ZlibSharp.Native |
| 48 | + cmake --workflow --preset win-x86 |
| 49 | + cd ../.. |
| 50 | + shell: pwsh |
| 51 | + |
| 52 | + - name: Set up Visual Studio x64 shell |
| 53 | + if: runner.OS == 'Windows' |
| 54 | + uses: egor-tensin/vs-shell@master |
| 55 | + with: |
| 56 | + arch: x64 |
| 57 | + |
| 58 | + - name: CMake configure and build native library (win-x64) |
| 59 | + if: runner.OS == 'Windows' |
| 60 | + run: | |
| 61 | + cd src/ZlibSharp.Native |
| 62 | + cmake --workflow --preset win-x64 |
| 63 | + cd ../.. |
| 64 | + shell: pwsh |
| 65 | + |
| 66 | + - name: Set up Visual Studio ARM64 shell |
| 67 | + if: runner.OS == 'Windows' |
| 68 | + uses: egor-tensin/vs-shell@master |
| 69 | + with: |
| 70 | + arch: ARM64 |
| 71 | + |
| 72 | + - name: CMake configure and build native library (win-arm64) |
| 73 | + if: runner.OS == 'Windows' |
| 74 | + run: | |
| 75 | + cd src/ZlibSharp.Native |
| 76 | + cmake --workflow --preset win-arm64 |
| 77 | + dotnet pack -c Release |
| 78 | + cd ../.. |
| 79 | + shell: pwsh |
| 80 | + |
| 81 | + - name: CMake configure and build native library (linux-x86, linux-x64, linux-arm64) |
| 82 | + if: runner.OS == 'Linux' |
| 83 | + run: | |
| 84 | + cd src/ZlibSharp.Native |
| 85 | + chmod +x ./build-linux.sh |
| 86 | + ./build-linux.sh |
| 87 | + cd ../.. |
| 88 | + shell: pwsh |
| 89 | + |
| 90 | + - name: CMake configure and build native library (osx-x64, osx-arm64) |
| 91 | + if: runner.OS == 'MacOS' |
| 92 | + run: | |
| 93 | + cd src/ZlibSharp.Native |
| 94 | + chmod +x ./build-osx.sh |
| 95 | + ./build-osx.sh |
| 96 | + cd ../.. |
| 97 | + shell: pwsh |
| 98 | + |
| 99 | + - name: Upload artifacts |
| 100 | + uses: actions/upload-artifact@main |
| 101 | + with: |
| 102 | + name: artifacts-${{ runner.os }} |
| 103 | + path: artifacts/* |
| 104 | + |
| 105 | + build: |
| 106 | + needs: build-native |
| 107 | + runs-on: ubuntu-latest |
| 108 | + permissions: |
| 109 | + contents: write |
| 110 | + env: |
| 111 | + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true |
| 112 | + DOTNET_CLI_TELEMETRY_OPTOUT: true |
| 113 | + DOTNET_NOLOGO: true |
| 114 | + steps: |
| 115 | + - uses: actions/checkout@main |
| 116 | + |
25 | 117 | - name: Install latest .NET SDK |
26 | 118 | uses: Elskom/setup-latest-dotnet@main |
27 | 119 | with: |
28 | | - SDK_VERSION: '9.0.100' |
| 120 | + SDK_VERSION: '10.0.100' |
29 | 121 | RUNTIME_VERSIONS: '8.0.x' |
30 | 122 |
|
| 123 | + - name: Download artifacts |
| 124 | + uses: actions/download-artifact@main |
| 125 | + with: |
| 126 | + pattern: artifacts-* |
| 127 | + path: artifacts/ |
| 128 | + merge-multiple: true |
| 129 | + |
31 | 130 | - name: Restore, Build, Test, Pack, and Push. |
32 | 131 | uses: Elskom/build-dotnet@main |
33 | 132 | with: |
|
0 commit comments