|
| 1 | + |
| 2 | +name: Build |
| 3 | + |
| 4 | +on: [push, pull_request] |
| 5 | + |
| 6 | +jobs: |
| 7 | + build: |
| 8 | + name: build-${{ matrix.os }} |
| 9 | + runs-on: ${{ matrix.os }} |
| 10 | + strategy: |
| 11 | + matrix: |
| 12 | + os: [windows-latest, macos-latest, ubuntu-20.04] |
| 13 | + fail-fast: false |
| 14 | + steps: |
| 15 | + - name: Expose GitHub Runtime |
| 16 | + uses: crazy-max/ghaction-github-runtime@v3 |
| 17 | + - name: Add msbuild to PATH |
| 18 | + if: runner.os == 'Windows' |
| 19 | + uses: microsoft/setup-msbuild@v1.0.2 |
| 20 | + - name: Install Linux dependencies |
| 21 | + if: runner.os == 'Linux' |
| 22 | + run: sudo apt-get install build-essential git make cmake autoconf automake pkg-config |
| 23 | + shell: bash |
| 24 | + - name: Clone repository |
| 25 | + uses: actions/checkout@v4 |
| 26 | + with: |
| 27 | + submodules: recursive |
| 28 | + - name: Run CAKE |
| 29 | + run: dotnet run --project ./build/Build.csproj -- --universalBinary=true |
| 30 | + env: |
| 31 | + ACTIONS_RUNTIME_TOKEN: ${{ env.ACTIONS_RUNTIME_TOKEN }} |
| 32 | + ACTIONS_RUNTIME_URL: "${{ env.ACTIONS_RUNTIME_URL }}" |
| 33 | + deploy: |
| 34 | + name: deploy |
| 35 | + runs-on: ubuntu-latest |
| 36 | + permissions: |
| 37 | + packages: write |
| 38 | + contents: write |
| 39 | + needs: [ build ] |
| 40 | + if: ${{ github.event_name == 'push' }} |
| 41 | + steps: |
| 42 | + - name: Expose GitHub Runtime |
| 43 | + uses: crazy-max/ghaction-github-runtime@v3 |
| 44 | + - name: Clone repository |
| 45 | + uses: actions/checkout@v4 |
| 46 | + with: |
| 47 | + submodules: recursive |
| 48 | + - name: Run CAKE |
| 49 | + run: dotnet run --project ./build/Build.csproj -- --target=Package --universalBinary=true --libraryname=MojoShader --licensepath=mojoshader/LICENSE.txt |
| 50 | + env: |
| 51 | + ACTIONS_RUNTIME_TOKEN: ${{ env.ACTIONS_RUNTIME_TOKEN }} |
| 52 | + ACTIONS_RUNTIME_URL: "${{ env.ACTIONS_RUNTIME_URL }}" |
| 53 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 54 | + - name: Make a release |
| 55 | + uses: ncipollo/release-action@v1 |
| 56 | + with: |
| 57 | + name: 'MonoGame.Library.MojoShader ${{ github.ref_name }}' |
| 58 | + tag: ${{ github.ref_name }} |
| 59 | + allowUpdates: true |
| 60 | + removeArtifacts: true |
| 61 | + artifacts: "bin/Release/*.nupkg" |
| 62 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 63 | + if: github.ref_type == 'tag' |
| 64 | + |
0 commit comments