|
| 1 | +name: Build MIR |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + tags: |
| 8 | + - '*' |
| 9 | + pull_request: |
| 10 | + branches: |
| 11 | + - main |
| 12 | + - dev |
| 13 | + |
| 14 | +jobs: |
| 15 | + build-linux: |
| 16 | + name: Linux |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - name: Checkout code |
| 20 | + uses: actions/checkout@v3 |
| 21 | + |
| 22 | + - name: Initialize and update git submodules |
| 23 | + run: | |
| 24 | + git submodule init |
| 25 | + git submodule update --remote |
| 26 | +
|
| 27 | + - name: Set up .NET SDK 9 |
| 28 | + uses: actions/setup-dotnet@v3 |
| 29 | + with: |
| 30 | + dotnet-version: '9.x' |
| 31 | + |
| 32 | + - name: Build the project |
| 33 | + working-directory: ./src/MadnessInteractiveReloaded |
| 34 | + run: dotnet build --runtime linux-x64 -c Release --self-contained true |
| 35 | + |
| 36 | + - name: Compress artifacts |
| 37 | + working-directory: ./src/MadnessInteractiveReloaded/bin/Release/net9.0 |
| 38 | + run: | |
| 39 | + tar cf - linux-x64 | xz -z --threads=0 - > MIR-linux-x64.tar.xz |
| 40 | +
|
| 41 | + - name: Upload artifact |
| 42 | + uses: actions/upload-artifact@v4 |
| 43 | + with: |
| 44 | + name: MIR-linux-x64.tar.xz |
| 45 | + path: | |
| 46 | + ./src/MadnessInteractiveReloaded/bin/Release/net9.0/MIR-linux-x64.tar.xz |
| 47 | + |
| 48 | + - name: Release |
| 49 | + uses: softprops/action-gh-release@v2 |
| 50 | + if: startsWith(github.ref, 'refs/tags/') |
| 51 | + with: |
| 52 | + files: ./src/MadnessInteractiveReloaded/bin/Release/net9.0/MIR-linux-x64.tar.xz |
| 53 | + |
| 54 | + build-windows: |
| 55 | + name: Windows |
| 56 | + runs-on: windows-latest |
| 57 | + steps: |
| 58 | + - name: Checkout code |
| 59 | + uses: actions/checkout@v3 |
| 60 | + |
| 61 | + - name: Initialize and update git submodules |
| 62 | + run: | |
| 63 | + git submodule init |
| 64 | + git submodule update --remote |
| 65 | +
|
| 66 | + - name: Set up .NET SDK 9 |
| 67 | + uses: actions/setup-dotnet@v3 |
| 68 | + with: |
| 69 | + dotnet-version: '9.x' |
| 70 | + |
| 71 | + - name: Build the project |
| 72 | + working-directory: ./src/MadnessInteractiveReloaded |
| 73 | + run: dotnet build --runtime win-x64 -c Release --self-contained true |
| 74 | + |
| 75 | + - name: Compress artifacts |
| 76 | + working-directory: ./src/MadnessInteractiveReloaded/bin/Release/net9.0 |
| 77 | + run: | |
| 78 | + tar cf - win-x64 | xz -z --threads=0 - > MIR-win-x64.tar.xz |
| 79 | +
|
| 80 | + - name: Upload artifact |
| 81 | + uses: actions/upload-artifact@v4 |
| 82 | + with: |
| 83 | + name: MIR-win-x64.tar.xz |
| 84 | + path: | |
| 85 | + ./src/MadnessInteractiveReloaded/bin/Release/net9.0/MIR-win-x64.tar.xz |
| 86 | + |
| 87 | + - name: Release |
| 88 | + uses: softprops/action-gh-release@v2 |
| 89 | + if: startsWith(github.ref, 'refs/tags/') |
| 90 | + with: |
| 91 | + files: ./src/MadnessInteractiveReloaded/bin/Release/net9.0/MIR-win-x64.tar.xz |
0 commit comments