mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-25 04:11:14 -03:00
Extract a github action to reduce the number of references to our MSRV and stable (to be pinned in the next commit). While at it, use the MSRV for macOS builds; this means that we'll be less like accidentally to break the macOS build when bumping the MSRV. I don't think there is a reason for using 1.73 specifically, other than "it's the highest we can use on old macOS", so using an even older one should be fine.
77 lines
2.5 KiB
YAML
77 lines
2.5 KiB
YAML
name: staticbuilds
|
|
|
|
on:
|
|
# release:
|
|
# types: [published]
|
|
# schedule:
|
|
# - cron: "14 13 * * *"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
staticbuilds-linux:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- uses: ./.github/actions/rust-toolchain@oldest-supported
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Prepare
|
|
run: |
|
|
sudo apt install python3-sphinx
|
|
rustup target add x86_64-unknown-linux-musl
|
|
rustup target add aarch64-unknown-linux-musl
|
|
sudo apt install musl-tools crossbuild-essential-arm64 python3-pexpect tmux -y
|
|
- name: Build
|
|
run: |
|
|
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2" CMAKE_WITH_GETTEXT=0 CC=aarch64-linux-gnu-gcc RUSTFLAGS="-C linker=aarch64-linux-gnu-gcc -C link-arg=-lgcc -C link-arg=-D_FORTIFY_SOURCE=0" cargo build --release --target aarch64-unknown-linux-musl --bin fish
|
|
cargo build --release --target x86_64-unknown-linux-musl
|
|
- name: Test
|
|
run: |
|
|
tests/test_driver.py target/x86_64-unknown-linux-musl/release/
|
|
- name: Compress
|
|
run: |
|
|
tar -cazf fish-static-x86_64-$(git describe).tar.xz -C target/x86_64-unknown-linux-musl/release/ fish
|
|
tar -cazf fish-static-aarch64-$(git describe).tar.xz -C target/aarch64-unknown-linux-musl/release/ fish
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: fish-static-linux
|
|
path: |
|
|
fish-*.tar.xz
|
|
retention-days: 14
|
|
staticbuilds-macos:
|
|
|
|
runs-on: macos-latest
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- uses: ./.github/actions/rust-toolchain@oldest-supported
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Prepare
|
|
run: |
|
|
sudo pip3 install --break-system-packages sphinx
|
|
rustup target add x86_64-apple-darwin
|
|
rustup target add aarch64-apple-darwin
|
|
- name: Build
|
|
run: |
|
|
PCRE2_SYS_STATIC=1 cargo build --release --target aarch64-apple-darwin --bin fish
|
|
PCRE2_SYS_STATIC=1 cargo build --release --target x86_64-apple-darwin --bin fish
|
|
- name: Compress
|
|
run: |
|
|
tar -cazf fish-macos-aarch64.tar.xz -C target/aarch64-apple-darwin/release/ fish
|
|
tar -cazf fish-macos-x86_64.tar.xz -C target/x86_64-apple-darwin/release/ fish
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: fish-static-macos
|
|
path: |
|
|
fish-macos-*.tar.xz
|
|
retention-days: 14
|