|
| 1 | +# Copied mostly from https://github.com/srcwr/srcwrtimer/blob/main/.github/workflows/build-everything.yml |
| 2 | + |
| 3 | +name: Build everything |
| 4 | + |
| 5 | +# TODO: Print hashes to ghactions "summary" info and/or setup some of the ghactions attestation shit... |
| 6 | +# Steal from this maybe: https://github.com/zhongfly/mpv-winbuild/blob/main/.github/workflows/mpv.yml |
| 7 | + |
| 8 | +# TODO: add another job that only builds sourcepawn files when only those are touched |
| 9 | +on: |
| 10 | + push: |
| 11 | + paths: ['**.rs', '**.h', '**.hpp', '**.c', '**.cpp', '**.sp', '**.inc', '**.toml', '**.lock', '**.yml'] |
| 12 | + pull_request: |
| 13 | + paths: ['**.rs', '**.h', '**.hpp', '**.c', '**.cpp', '**.sp', '**.inc', '**.toml', '**.lock', '**.yml'] |
| 14 | + workflow_dispatch: |
| 15 | + |
| 16 | +env: |
| 17 | + CARGO_TERM_COLOR: always |
| 18 | + |
| 19 | +jobs: |
| 20 | + build_everything: |
| 21 | + runs-on: windows-latest |
| 22 | + |
| 23 | + steps: |
| 24 | + - name: Prepare env |
| 25 | + shell: bash |
| 26 | + run: echo "GITHUB_SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV |
| 27 | + # checkout current repo... |
| 28 | + - uses: actions/checkout@v4 |
| 29 | + # checkout srcwrtimer since we use it for shit... |
| 30 | + - uses: actions/checkout@v4 |
| 31 | + with: |
| 32 | + repository: srcwr/srcwrtimer |
| 33 | + path: .. |
| 34 | + - name: Install cargo-binstall |
| 35 | + uses: cargo-bins/[email protected] |
| 36 | + - name: Install the cargo bins we use... |
| 37 | + shell: pwsh |
| 38 | + run: | |
| 39 | + cargo binstall -y cargo-make |
| 40 | + cargo binstall -y cargo-zigbuild |
| 41 | + # This is `cargo make full` but turned into steps so you can have better progress visibility |
| 42 | + - name: Install Rust toolchains |
| 43 | + run: | |
| 44 | + cargo make rustup-linux |
| 45 | + cargo make rustup-msvc |
| 46 | + - name: Clone alliedmodders repositories |
| 47 | + run: cargo make clone-alliedmodders |
| 48 | + - name: Setup SourcePawn Compiler |
| 49 | + uses: rumblefrog/[email protected] |
| 50 | + with: |
| 51 | + version: '1.12.7177' ### UPDATE Makefile.toml whenever this is updated. |
| 52 | + - name: Setup Zig |
| 53 | + uses: mlugg/setup-zig@v1 |
| 54 | + with: |
| 55 | + version: '0.13.0' ### UPDATE Makefile.toml whenever this is updated. |
| 56 | + - name: Build extensions for Linux |
| 57 | + run: cargo make linux |
| 58 | + - name: Build extensions for Windows/MSVC |
| 59 | + run: cargo make msvc |
| 60 | + - name: Copy things to _package |
| 61 | + run: | |
| 62 | + cargo make copy-srcwrtimer |
| 63 | + cargo make copy-extensions |
| 64 | + - name: Build plugins |
| 65 | + run: cargo make compile-srcwrtimer-scripts |
| 66 | + - name: Upload package |
| 67 | + uses: actions/upload-artifact@v4 |
| 68 | + with: |
| 69 | + name: srcwrtimer-${{ github.head_ref || github.ref_name }}-${{ env.GITHUB_SHA_SHORT }} |
| 70 | + path: _package/srcwrtimer |
0 commit comments