diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index cd06b02..eca0d3c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -9,6 +9,58 @@ env: RUST_TOOLCHAIN: 1.86.0 jobs: + build: + strategy: + matrix: + include: + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + artifact_name: pacman + - os: macos-13 + target: x86_64-apple-darwin + artifact_name: pacman + - os: windows-latest + target: x86_64-pc-windows-gnu + artifact_name: pacman.exe + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Rust Toolchain + uses: dtolnay/rust-toolchain@master + with: + target: ${{ matrix.target }} + toolchain: ${{ env.RUST_TOOLCHAIN }} + + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + + - name: Vcpkg + run: | + cargo install cargo-vcpkg + cargo vcpkg -v build + - name: Build + run: cargo build --release + + - name: Install Cargo Binstall + uses: cargo-bins/cargo-binstall@main + + - name: Acquire Package Version + shell: bash + run: | + cargo binstall toml-cli -y + PACKAGE_VERSION=$(toml get ./Cargo.toml package.version --raw) + echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: "pacman-${{ env.PACKAGE_VERSION }}-${{ matrix.target }}" + path: ./target/release/${{ matrix.artifact_name }} + retention-days: 7 + if-no-files-found: error + wasm: runs-on: ubuntu-latest permissions: @@ -50,137 +102,3 @@ jobs: - name: Deploy uses: actions/deploy-pages@v4 - - linux: - runs-on: ubuntu-latest - env: - TARGET: x86_64-unknown-linux-gnu - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Rust Toolchain (Linux) - uses: dtolnay/rust-toolchain@master - with: - target: ${{ env.TARGET }} - toolchain: ${{ env.RUST_TOOLCHAIN }} - - - name: Rust Cache - uses: Swatinem/rust-cache@v2 - - - name: Vcpkg - run: | - cargo install cargo-vcpkg - cargo vcpkg -v build - - - name: Build - run: cargo build --release - - - name: Install Cargo Binstall - uses: cargo-bins/cargo-binstall@main - - - name: Acquire Package Version - run: | - cargo binstall toml-cli -y - PACKAGE_VERSION=$(toml get ./Cargo.toml package.version --raw) - echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: "pacman-${{ env.PACKAGE_VERSION }}-${{ env.TARGET }}" - path: ./target/release/pacman - retention-days: 7 - if-no-files-found: error - - macos: - runs-on: macos-13 - env: - TARGET: x86_64-apple-darwin - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Rust Toolchain (MacOS) - uses: dtolnay/rust-toolchain@master - with: - target: ${{ env.TARGET }} - toolchain: ${{ env.RUST_TOOLCHAIN }} - - - name: Rust Cache - uses: Swatinem/rust-cache@v2 - - - name: Vcpkg - run: | - cargo install cargo-vcpkg - cargo vcpkg build - - - name: Build - run: cargo build --release - - - name: Install Cargo Binstall - uses: cargo-bins/cargo-binstall@main - - - name: Acquire Package Version - run: | - cargo binstall toml-cli -y - PACKAGE_VERSION=$(toml get ./Cargo.toml package.version --raw) - echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: "pacman-${{ env.PACKAGE_VERSION }}-${{ env.TARGET }}" - path: ./target/release/pacman - retention-days: 7 - if-no-files-found: error - - windows: - env: - TARGET: x86_64-pc-windows-gnu - SDL2: 2.30.2 - SDL2_TTF: 2.22.0 - SDL2_MIXER: 2.8.0 - SDL2_IMAGE: 2.8.2 - # SDL2_GFX: 1.0.4 - runs-on: windows-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Rust (Windows) - uses: dtolnay/rust-toolchain@master - with: - target: ${{ env.TARGET }} - toolchain: ${{ env.RUST_TOOLCHAIN }} - - - name: Rust Cache - uses: Swatinem/rust-cache@v2 - - - name: Vcpkg - run: | - cargo install cargo-vcpkg - cargo vcpkg build - - - name: Build - run: cargo build --release - - - name: Install Cargo Binstall - uses: cargo-bins/cargo-binstall@main - - - name: Acquire Package Version - run: | - cargo binstall toml-cli -y - PACKAGE_VERSION=$(toml get ./Cargo.toml package.version --raw) - echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $env:GITHUB_ENV - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: "pacman-${{ env.PACKAGE_VERSION }}-${{ env.TARGET }}" - path: ./target/release/pacman.exe - retention-days: 7 - if-no-files-found: error