wip #5
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: | |
- main | |
- ci/* | |
pull_request: | |
concurrency: # Spend CI time only on latest ref: https://docs.github.com/en/actions/using-jobs/using-concurrency | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build binaries | |
strategy: | |
matrix: | |
include: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
name: tuxmux-x86_64-unknown-linux-gnu.tar.gz | |
- target: aarch64-unknown-linux-gnu | |
os: ubuntu-latest | |
name: tuxmux-aarch64-unknown-linux-gnu.tar.gz | |
- target: x86_64-apple-darwin | |
os: macos-latest | |
name: tuxmux-x86_64-apple-darwin.tar.gz | |
- target: aarch64-apple-darwin | |
os: macos-latest | |
name: tuxmux-aarch64-apple-darwin.tar.gz | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Setup | Checkout | |
uses: actions/checkout@v4 | |
- name: Setup | Rust | |
uses: dtolnay/rust-toolchain @v1 | |
with: | |
toolchain: stable | |
targets: ${{matrix.target}} | |
- name: Setup | Install cross [Linux] | |
if: matrix.os == 'ubuntu-latest' | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cross | |
- name: Build | Build [Cargo] | |
if: matrix.os != 'ubuntu-latest' | |
run: cargo build --locked --target ${{ matrix.target }} | |
- name: Build | Build [Cross] | |
if: matrix.os == 'ubuntu-latest' | |
run: cross build --locked --target ${{ matrix.target }} | |
- name: Post | Prepare artifacts | |
run: | | |
RESULT="target-${{ matrix.target }}" | |
mkdir $RESULT | |
cp target/${{ matrix.target }}/debug/tm $RESULT | |
cp -r target/${{ matrix.target }}/man $RESULT | |
cp -r target/${{ matrix.target }}/completions $RESULT | |
tar czvf ${{ matrix.name }} $RESULT | |
- name: Release | Upload artifacts | |
uses: actions/upload-artifact @v3 | |
with: | |
name: ${{ matrix.name }} | |
path: ${{ matrix.name }} | |