Skip to content

✨ Texture2D & Sprite extraction (#38) #17

✨ Texture2D & Sprite extraction (#38)

✨ Texture2D & Sprite extraction (#38) #17

Workflow file for this run

name: Build
on:
push:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build project
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: Check out
uses: actions/checkout@v3
with:
submodules: true
- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy
- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build
run: |
cargo build --release
- name: Get git commit hash (Windows)
if: ${{ contains('Windows', runner.os) }}
id: hash_windows
run: echo "hash=$("${{ github.sha }}".SubString(0, 10))" >> $env:GITHUB_OUTPUT
- name: Get git commit hash
if: ${{ !contains('Windows', runner.os) }}
id: hash
run: echo "hash=${GITHUB_SHA:0:10}" >> $GITHUB_OUTPUT
- name: Rename artifact (Windows)
if: ${{ contains('Windows', runner.os) }}
run: mv target/release/mltd.exe mltd-git-${{ steps.hash_windows.outputs.hash }}-Windows.exe
- name: Rename artifact
if: ${{ !contains('Windows', runner.os) }}
run: mv target/release/mltd mltd-git-${{ steps.hash.outputs.hash }}-${{ runner.os }}
- name: Publish artifact (Windows)
if: ${{ contains('Windows', runner.os) }}
uses: actions/upload-artifact@v3
with:
name: mltd-git-${{ steps.hash_windows.outputs.hash }}-Windows.exe
path: mltd-git-${{ steps.hash_windows.outputs.hash }}-Windows.exe
- name: Publish artifact
if: ${{ !contains('Windows', runner.os) }}
uses: actions/upload-artifact@v3
with:
name: mltd-git-${{ steps.hash.outputs.hash }}-${{ runner.os }}
path: mltd-git-${{ steps.hash.outputs.hash }}-${{ runner.os }}