Skip to content

Merge pull request #13 from fourlastor-alexandria/extra-json-support #85

Merge pull request #13 from fourlastor-alexandria/extra-json-support

Merge pull request #13 from fourlastor-alexandria/extra-json-support #85

Workflow file for this run

name: Distribution Builds
on:
push:
# Manual dispatch for testing
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ windows-latest, macos-latest, ubuntu-latest ]
steps:
- uses: actions/checkout@v4
- name: Build Windows
if: matrix.os == 'windows-latest'
run: |
mkdir out
mkdir tmp_build
rustup target add i686-pc-windows-msvc
cargo build --release
cargo build --target i686-pc-windows-msvc --release
copy target/release/roast.exe tmp_build/roast-win-64.exe
copy target/i686-pc-windows-msvc/release/roast.exe tmp_build/roast-win-32.exe
cargo build --release --features win_console
cargo build --target i686-pc-windows-msvc --release --features win_console
copy target/release/roast.exe tmp_build/roast-win-console-64.exe
copy target/i686-pc-windows-msvc/release/roast.exe tmp_build/roast-win-console-32.exe
cargo build --release --features win_no_gpu
cargo build --target i686-pc-windows-msvc --release --features win_no_gpu
copy target/release/roast.exe tmp_build/roast-win-no-gpu-64.exe
copy target/i686-pc-windows-msvc/release/roast.exe tmp_build/roast-win-no-gpu-32.exe
Compress-Archive -Path tmp_build/roast-win-64.exe -Destination out/roast-win-64.exe.zip
Compress-Archive -Path tmp_build/roast-win-32.exe -Destination out/roast-win-32.exe.zip
Compress-Archive -Path tmp_build/roast-win-console-64.exe -Destination out/roast-win-console-64.exe.zip
Compress-Archive -Path tmp_build/roast-win-console-32.exe -Destination out/roast-win-console-32.exe.zip
Compress-Archive -Path tmp_build/roast-win-no-gpu-64.exe -Destination out/roast-win-no-gpu-64.exe.zip
Compress-Archive -Path tmp_build/roast-win-no-gpu-32.exe -Destination out/roast-win-no-gpu-32.exe.zip
- name: Build MacOS (setup)
if: matrix.os == 'macos-latest'
run: |
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin
- name: Build MacOS (x86_64)
if: matrix.os == 'macos-latest'
env:
MACOSX_DEPLOYMENT_TARGET: '10.12'
run: |
cargo build --target x86_64-apple-darwin --release
- name: Build MacOS (aarch64)
if: matrix.os == 'macos-latest'
env:
MACOSX_DEPLOYMENT_TARGET: '11.0'
run: |
cargo build --target aarch64-apple-darwin --release
- name: Build MacOS (release)
if: matrix.os == 'macos-latest'
run: |
mkdir -p out
mv target/x86_64-apple-darwin/release/roast ./roast-macos-x86_64
mv target/aarch64-apple-darwin/release/roast ./roast-macos-aarch64
chmod +x ./roast-macos-x86_64 ./roast-macos-aarch64
zip out/roast-macos-x86_64.zip ./roast-macos-x86_64
zip out/roast-macos-aarch64.zip ./roast-macos-aarch64
- name: Build Linux
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt install -y gcc-aarch64-linux-gnu
rustup target add aarch64-unknown-linux-gnu
cargo build --release
cargo build --target aarch64-unknown-linux-gnu --release
mkdir -p out
mv target/release/roast ./roast-linux-x86_64
mv target/aarch64-unknown-linux-gnu/release/roast ./roast-linux-aarch64
chmod +x ./roast-linux-x86_64 ./roast-linux-aarch64
zip out/roast-linux-x86_64.zip ./roast-linux-x86_64
zip out/roast-linux-aarch64.zip ./roast-linux-aarch64
- name: Artifact upload
uses: actions/upload-artifact@v4
with:
name: outputs-${{ matrix.os }}
path: out
retention-days: 1
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: out/*