From 97b7a0345bf3ab34bac46b68f73bdb3900113160 Mon Sep 17 00:00:00 2001 From: Xevion Date: Wed, 24 Apr 2024 15:52:00 -0500 Subject: [PATCH] extend binstall version getters & artifact name interpolation into linux/windows builds --- .github/workflows/build.yaml | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a77b433..dc6b6c7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -50,6 +50,8 @@ jobs: linux: runs-on: ubuntu-latest + env: + TARGET: x86_64-unknown-linux-gnu steps: - name: Checkout @@ -61,7 +63,7 @@ jobs: - name: Setup Rust Toolchain (Linux) uses: dtolnay/rust-toolchain@stable with: - target: x86_64-unknown-linux-gnu + target: ${{ env.TARGET }} - name: Rust Cache uses: Swatinem/rust-cache@v2 @@ -76,11 +78,19 @@ jobs: chmod a+x /tmp/example/spiritus mkdir /tmp/example/assets cp ./assets/TerminalVector.ttf ./assets/fruit.png /tmp/example/assets + + - name: Install Cargo Binstall + uses: cargo-bins/cargo-binstall@main + + - name: Acquire Package Version + run: | + cargo binstall toml-cli -y + echo "PACKAGE_VERSION=$(toml get ./Cargo.toml package.version --raw)" >> $GITHUB_ENV - name: Upload Artifact uses: actions/upload-artifact@v4 with: - name: Linux_x64 + name: "spiritus-${{ env.PACKAGE_VERSION }}-${{ env.TARGET }}" path: /tmp/example/ retention-days: 7 if-no-files-found: error @@ -132,12 +142,13 @@ jobs: if-no-files-found: error windows: - env: + 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 + # SDL2_GFX: 1.0.4 runs-on: windows-latest steps: @@ -178,7 +189,7 @@ jobs: - name: Setup Rust (Windows) uses: dtolnay/rust-toolchain@stable with: - targets: x86_64-pc-windows-gnu + targets: ${{ env.TARGET }} - name: Rust Cache uses: Swatinem/rust-cache@v2 @@ -194,10 +205,19 @@ jobs: New-Item -Type Directory ./release/assets/ Move-Item -Path ./assets/TerminalVector.ttf, ./assets/fruit.png -Destination ./release/assets/ + - name: Install Cargo Binstall + uses: cargo-bins/cargo-binstall@main + + - name: Acquire Package Version + run: | + cargo binstall toml-cli -y + echo "PACKAGE_VERSION=$(toml get ./Cargo.toml package.version --raw)" >> $GITHUB_ENV + + - name: Upload Artifact uses: actions/upload-artifact@v4 with: - name: Windows_x64 + name: "spiritus-${{ env.PACKAGE_VERSION }}-${{ env.TARGET }}" path: ./release/ retention-days: 7 if-no-files-found: error \ No newline at end of file