|
| 1 | +name: CD RawrrAssembly |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + release: |
| 5 | + types: [created] |
| 6 | +env: |
| 7 | + DOTNET_DOCKER: mcr.microsoft.com/dotnet/sdk:8.0 |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + name: Build Assembly |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v4 |
| 14 | + - name: Pull image |
| 15 | + run: docker pull $DOTNET_DOCKER |
| 16 | + - name: Build |
| 17 | + run: cd inst/rawrrassembly && docker run --rm -v $PWD:/app -w /app $DOTNET_DOCKER /app/build.sh /app /app/out |
| 18 | + - name: Publish results |
| 19 | + uses: actions/upload-artifact@v4 |
| 20 | + with: |
| 21 | + name: rawrr |
| 22 | + path: inst/rawrrassembly/out |
| 23 | + retention-days: 1 |
| 24 | + verify-linux: |
| 25 | + name: Verify on Linux |
| 26 | + runs-on: ubuntu-latest |
| 27 | + needs: build |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v4 |
| 30 | + - name: Download results |
| 31 | + uses: actions/download-artifact@v4 |
| 32 | + with: |
| 33 | + name: rawrr |
| 34 | + - name: List result |
| 35 | + run: tree |
| 36 | + - name: Make executable |
| 37 | + run: chmod +x rawrr-linux-x64 |
| 38 | + - name: Execute on test file |
| 39 | + run: ./rawrr-linux-x64 ./inst/extdata/sample.raw index |
| 40 | + verify-windows: |
| 41 | + name: Verify on Windows |
| 42 | + runs-on: windows-latest |
| 43 | + needs: build |
| 44 | + steps: |
| 45 | + - uses: actions/checkout@v4 |
| 46 | + - name: Download results |
| 47 | + uses: actions/download-artifact@v4 |
| 48 | + with: |
| 49 | + name: rawrr |
| 50 | + - name: List result |
| 51 | + run: dir |
| 52 | + - name: Execute on test file |
| 53 | + run: .\rawrr-win-x64.exe .\inst\extdata\sample.raw index |
| 54 | + verify-macos: |
| 55 | + name: Verify on MacOS |
| 56 | + runs-on: macos-latest |
| 57 | + needs: build |
| 58 | + steps: |
| 59 | + - uses: actions/checkout@v4 |
| 60 | + - name: Download results |
| 61 | + uses: actions/download-artifact@v4 |
| 62 | + with: |
| 63 | + name: rawrr |
| 64 | + - name: List result |
| 65 | + run: ls -l |
| 66 | + - name: Make executable |
| 67 | + run: chmod +x rawrr-osx-x64 |
| 68 | + - name: Execute on test file |
| 69 | + run: ./rawrr-osx-x64 ./inst/extdata/sample.raw index |
| 70 | + upload-release-artifacts: |
| 71 | + name: Upload Release Artifacts |
| 72 | + runs-on: ubuntu-latest |
| 73 | + needs: |
| 74 | + - verify-linux |
| 75 | + - verify-windows |
| 76 | + - verify-macos |
| 77 | + if: github.event_name == 'release' |
| 78 | + steps: |
| 79 | + - uses: actions/checkout@v4 |
| 80 | + - name: Download all artifacts |
| 81 | + uses: actions/download-artifact@v4 |
| 82 | + with: |
| 83 | + name: rawrr |
| 84 | + path: dist |
| 85 | + - name: Upload Release Assets |
| 86 | + uses: softprops/action-gh-release@v1 |
| 87 | + with: |
| 88 | + files: | |
| 89 | + dist/rawrr-linux-x64 |
| 90 | + dist/rawrr-win-x64.exe |
| 91 | + dist/rawrr-osx-x64 |
| 92 | + env: |
| 93 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments