ci: build test #1
Workflow file for this run
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: Build | |
on: | |
push: | |
branches: | |
- build-test | |
jobs: | |
build_archive: | |
name: Build archive | |
runs-on: ${{ matrix.os }} | |
permissions: | |
contents: write | |
env: | |
CARGO: cargo | |
# When CARGO is set to CROSS, this is set to `--target matrix.target`. | |
TARGET_FLAGS: "" | |
# When CARGO is set to CROSS, TARGET_DIR includes matrix.target. | |
TARGET_DIR: ./target | |
strategy: | |
fail-fast: false | |
matrix: | |
build: [linux-gnu, linux-gnu-aarch, linux-musl, linux-musl-aarch, macos, macos-arm] | |
include: | |
- build: linux-gnu | |
os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
- build: linux-gnu-aarch | |
os: ubuntu-latest | |
target: aarch64-unknown-linux-gnu | |
- build: linux-musl | |
os: ubuntu-latest | |
target: x86_64-unknown-linux-musl | |
- build: linux-musl-aarch | |
os: ubuntu-latest | |
target: aarch64-unknown-linux-musl | |
- build: macos | |
os: macos-latest | |
target: x86_64-apple-darwin | |
- build: macos-arm | |
os: macos-latest | |
target: aarch64-apple-darwin | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download man page | |
uses: actions/download-artifact@v3 | |
with: | |
name: quartz.1 | |
path: doc | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
target: ${{ matrix.target }} | |
- name: Use Cross | |
shell: bash | |
run: | | |
cargo install cross | |
- name: Build binary | |
run: cross build --verbose --release --target ${{ matrix.target }} | |
- name: Build archive | |
shell: bash | |
run: | | |
staging="quartz-${{ github.ref_name }}-${{ matrix.target }}" | |
mkdir -p "$staging"/doc | |
cp {README.md,LICENSE} "$staging/" | |
cp CHANGELOG.md "$staging/doc/" | |
cp doc/quartz.1 "$staging/doc/quartz.1" | |
cp "target/${{ matrix.target }}/release/quartz" "$staging/" | |
tar czf "$staging.tar.gz" "$staging" | |
echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV |