tommy d59480631d
All checks were successful
Rust / build (, linux, x86_64-unknown-linux-gnu) (push) Successful in 59s
Rust / build (.exe, windows, x86_64-pc-windows-gnu) (push) Successful in 1m10s
that did not work first try
2025-06-03 01:32:34 -04:00

61 lines
1.8 KiB
YAML

name: Rust
on:
push:
branches: ["master"]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- x86_64-pc-windows-gnu
- x86_64-unknown-linux-gnu
include:
- target: x86_64-pc-windows-gnu
os: windows
extension: .exe
- target: x86_64-unknown-linux-gnu
os: linux
extension: ""
steps:
- uses: actions/checkout@v3
- name: Install rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross compilation tools
run: |
sudo apt-get update
if [ "${{ matrix.target }}" = "x86_64-pc-windows-gnu" ]; then
sudo apt-get install mingw-w64 -y
elif [ "${{ matrix.target }}" = "x86_64-unknown-linux-gnu" ]; then
sudo apt-get install gcc-x86-64-linux-gnu -y
fi
- name: Configure cross compilation
run: |
if [ "${{ matrix.target }}" = "x86_64-unknown-linux-gnu" ]; then
echo "CC_x86_64_unknown_linux_gnu=x86_64-linux-gnu-gcc" >> $GITHUB_ENV
echo "CXX_x86_64_unknown_linux_gnu=x86_64-linux-gnu-g++" >> $GITHUB_ENV
echo "AR_x86_64_unknown_linux_gnu=x86_64-linux-gnu-ar" >> $GITHUB_ENV
echo "CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-linux-gnu-gcc" >> $GITHUB_ENV
fi
- name: Setup Cache
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Build release
run: cargo build --verbose --locked --release --target ${{ matrix.target }}
- name: Archive build
uses: actions/upload-artifact@v3
with:
name: alt_enter_fix-${{ matrix.os }}
path: target/${{ matrix.target }}/release/alt_enter_fix${{ matrix.extension }}