mirror of
https://github.com/babichjacob/ac-qu-ai-nt.git
synced 2025-10-02 16:57:53 -04:00
105 lines
4.0 KiB
YAML
105 lines
4.0 KiB
YAML
name: Compile and publish binaries whenever a new release is cut
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
compile-and-publish:
|
|
strategy:
|
|
matrix:
|
|
supporteds:
|
|
- runner: macos-latest
|
|
target: aarch64-apple-darwin
|
|
|
|
- runner: macos-latest
|
|
target: x86_64-apple-darwin
|
|
|
|
- install_prerequisite: sudo apt-get update && sudo apt-get install musl-dev musl-tools gcc-aarch64-linux-gnu g++-aarch64-linux-gnu && sudo ln -s /bin/g++ /bin/musl-g++
|
|
runner: ubuntu-latest
|
|
target: aarch64-unknown-linux-gnu
|
|
|
|
- install_prerequisite: sudo apt-get update && sudo apt-get install musl-dev musl-tools gcc-aarch64-linux-gnu g++-aarch64-linux-gnu && sudo ln -s /bin/g++ /bin/musl-g++
|
|
runner: ubuntu-latest
|
|
target: aarch64-unknown-linux-musl
|
|
|
|
- runner: ubuntu-latest
|
|
target: x86_64-unknown-linux-gnu
|
|
|
|
- install_prerequisite: sudo apt-get update && sudo apt-get install musl-dev musl-tools && sudo ln -s /bin/g++ /bin/musl-g++
|
|
runner: ubuntu-latest
|
|
target: x86_64-unknown-linux-musl
|
|
|
|
# I would like to support this but I don't know how to install the dependencies to be able to
|
|
# - runner: windows-latest
|
|
# target: aarch64-pc-windows-gnullvm
|
|
|
|
- runner: windows-latest
|
|
target: aarch64-pc-windows-msvc
|
|
|
|
# I don't think supporting this is up to me
|
|
# I forgot where I learned this, but
|
|
# I don't think I can use a non-Rust dependency (i.e. llama.cpp) here
|
|
# - runner: windows-latest
|
|
# target: x86_64-pc-windows-gnu
|
|
|
|
- runner: windows-latest
|
|
target: x86_64-pc-windows-msvc
|
|
name: Compile ${{ matrix.supporteds.target }} for release (on ${{ matrix.supporteds.runner }})
|
|
runs-on: ${{ matrix.supporteds.runner }}
|
|
timeout-minutes: 10
|
|
env:
|
|
# https://github.com/rust-lang/stacker/issues/80#issuecomment-1547991131
|
|
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
|
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER: aarch64-linux-gnu-gcc # TODO: shouldn't this be something to do with musl, not gcc?
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install prerequisite build chain
|
|
if: matrix.supporteds.install_prerequisite
|
|
run: ${{ matrix.supporteds.install_prerequisite }}
|
|
|
|
- name: Install stable Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
shared-key: ${{ matrix.supporteds.target }}-latest
|
|
cache-on-failure: "true"
|
|
|
|
- name: Build for release
|
|
run: cargo build --release --verbose
|
|
|
|
# Have to do it like this because of https://github.com/actions/runner/issues/1985
|
|
- if: startsWith(github.event.release.tag_name, 'ac-qu-ai-nt-v')
|
|
uses: taiki-e/upload-rust-binary-action@v1
|
|
with:
|
|
bin: ac-qu-ai-nt
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
target: ${{ matrix.supporteds.target }}
|
|
|
|
- if: startsWith(github.event.release.tag_name, 'ac-qu-ai-nt-cli-clap-v')
|
|
uses: taiki-e/upload-rust-binary-action@v1
|
|
with:
|
|
bin: ac-qu-ai-nt-cli-clap
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
target: ${{ matrix.supporteds.target }}
|
|
|
|
- if: startsWith(github.event.release.tag_name, 'ac-qu-ai-nt-gui-eframe-v')
|
|
uses: taiki-e/upload-rust-binary-action@v1
|
|
with:
|
|
bin: ac-qu-ai-nt-gui-eframe
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
target: ${{ matrix.supporteds.target }}
|
|
|
|
- if: startsWith(github.event.release.tag_name, 'ac-qu-ai-nt-tui-ratatui-v')
|
|
uses: taiki-e/upload-rust-binary-action@v1
|
|
with:
|
|
bin: ac-qu-ai-nt-tui-ratatui
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
target: ${{ matrix.supporteds.target }}
|