Skip to content

Commit

Permalink
ci: build test
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardoRodriguesF committed Aug 5, 2023
1 parent f1793ab commit 03b6704
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
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

0 comments on commit 03b6704

Please sign in to comment.