This repository has been archived by the owner on May 2, 2024. It is now read-only.
Rust Build #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust Build | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
debug: | ||
description: Make debug build | ||
required: false | ||
type: boolean | ||
env: | ||
CARGO_TERM_COLOR: always | ||
MODIO_API_KEY: ${{ secrets.MODIO_API_KEY }} | ||
jobs: | ||
build-windows: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
- name: Build release | ||
if: ${{ !steps.debug }} | ||
run: cargo build --release --verbose | ||
- name: Upload release artifact | ||
if: ${{ !steps.debug }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: bonelab_mod_manager-${{ runner.os }}-release | ||
path: target/release/bonelab_mod_manager.exe | ||
- name: Build debug | ||
if: ${{ steps.debug }} | ||
run: cargo build --verbose | ||
- name: Upload debug artifact | ||
if: ${{ steps.debug }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: bonelab_mod_manager-${{ runner.os }}-debug | ||
path: target/debug/bonelab_mod_manager.exe | ||
build-macos: | ||
if: ${{ !steps.debug }} | ||
Check failure on line 48 in .github/workflows/rust-build.yml GitHub Actions / Rust BuildInvalid workflow file
|
||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
- name: Build x86_64 | ||
run: cargo build --release --target x86_64-apple-darwin --verbose | ||
- name: Add aarch64 target | ||
run: rustup target add aarch64-apple-darwin | ||
- name: Build aarch64 | ||
run: cargo build --release --target aarch64-apple-darwin --verbose | ||
- name: Create universal executable | ||
run: | | ||
lipo \ | ||
target/x86_64-apple-darwin/release/bonelab_mod_manager \ | ||
target/aarch64-apple-darwin/release/bonelab_mod_manager \ | ||
-create \ | ||
-output "Bonelab Mod Manager Installer/Bonelab Mod Manager.app/Contents/Resources/bonelab_mod_manager" | ||
- name: Make Applications alias | ||
run: ln -s /Applications "Bonelab Mod Manager Installer" | ||
- name: Create DMG | ||
run: | | ||
hdiutil \ | ||
create \ | ||
-srcfolder "Bonelab Mod Manager Installer" \ | ||
bonelab_mod_manager.dmg | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: bonelab_mod_manager-${{ runner.os }} | ||
path: bonelab_mod_manager.dmg | ||
build-linux: | ||
if: ${{ !steps.debug }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/cache@v3 | ||
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 --verbose | ||
- name: Create TAR | ||
run: tar -czvf bonelab_mod_manager.tar.gz -C target/release bonelab_mod_manager | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: bonelab_mod_manager-${{ runner.os }} | ||
path: bonelab_mod_manager.tar.gz |