Build #7
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: | |
workflow_call: | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash -euo pipefail {0} | |
jobs: | |
build: | |
name: ${{ matrix.target }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
use-cross: false | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-musl | |
use-cross: false | |
- os: ubuntu-latest | |
target: arm-unknown-linux-gnueabihf | |
use-cross: true | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
use-cross: false | |
- os: macos-latest | |
target: aarch64-apple-darwin | |
use-cross: false | |
- os: ubuntu-latest | |
target: aarch64-unknown-linux-musl | |
use-cross: true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: jdxcode/rtx-action@v1 | |
- name: Cache Cargo | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Setup Target | |
if: ${{ ! matrix.use-cross }} | |
run: rustup target add ${{ matrix.target }} | |
- name: Cargo Build | |
if: ${{ ! matrix.use-cross }} | |
run: cargo build --locked --release --all-features --target ${{ matrix.target }} | |
- name: Setup Cross | |
if: matrix.use-cross | |
run: | | |
cargo install cross --locked | |
rtx reshim rust | |
- name: Cross Build | |
if: matrix.use-cross | |
run: cross build --locked --release --all-features --target ${{ matrix.target }} | |
- name: Compress `ya` Binary for Upload | |
run: | | |
mv target/${{ matrix.target }}/release/ya ya | |
tar -czf ya-${{ matrix.target }}.tar.gz ya | |
- name: Compress `yadayada` Binary for Upload | |
run: | | |
mv target/${{ matrix.target }}/release/yadayada yyadayada | |
tar -czf yadayada-${{ matrix.target }}.tar.gz ya | |
- name: Upload `ya` tarball | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.target }} | |
path: ya-${{ matrix.target }}.tar.gz | |
- name: Upload `yadayada` tarball | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.target }} | |
path: yadayada-${{ matrix.target }}.tar.gz | |
- name: Upload Completions | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.target }}-completions | |
path: | | |
completions/release/* | |
!completions/release/.gitignore |