extend binstall version getters & artifact name interpolation into linux/windows builds

This commit is contained in:
2024-04-24 15:52:00 -05:00
parent 899fac2445
commit 97b7a0345b

View File

@@ -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