Something went wrong. Try again.
forked from crunchy-labs/crunchy-cli
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146name: build
on: push: branches: - '*' pull_request: workflow_dispatch:
jobs: build-linux: runs-on: ubuntu-latest strategy: matrix: include: - arch: x86_64 toolchain: x86_64-unknown-linux-musl - arch: aarch64 toolchain: aarch64-unknown-linux-musl steps: - name: Checkout uses: actions/checkout@v4
- name: Cargo cache uses: actions/cache@v4 with: path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ key: ${{ matrix.toolchain }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Setup Rust uses: dtolnay/rust-toolchain@stable with: toolchain: stable
- name: Install cross run: cargo install --force cross
- name: Build run: cross build --locked --release --no-default-features --features openssl-tls-static --target ${{ matrix.toolchain }}
- name: Upload binary artifact uses: actions/upload-artifact@v4 with: name: crunchy-cli-linux-${{ matrix.arch }} path: ./target/${{ matrix.toolchain }}/release/crunchy-cli if-no-files-found: error
- name: Upload manpages artifact if: ${{ matrix.arch == 'x86_64' }} # only upload the manpages once uses: actions/upload-artifact@v4 with: name: manpages path: ./target/${{ matrix.toolchain }}/release/manpages if-no-files-found: error
- name: Upload completions artifact if: ${{ matrix.arch == 'x86_64' }} # only upload the completions once uses: actions/upload-artifact@v4 with: name: completions path: ./target/${{ matrix.toolchain }}/release/completions if-no-files-found: error
build-mac: runs-on: ${{ matrix.os }} strategy: matrix: # macos-13 uses x86_64, macos-14 aarch64 # see https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources include: - os: macos-13 arch: x86_64 toolchain: x86_64-apple-darwin - os: macos-14 arch: aarch64 toolchain: aarch64-apple-darwin steps: - name: Checkout uses: actions/checkout@v4
- name: Cargo cache if: ${{ matrix.os != 'macos-13' }} # when using cache, the 'Setup Rust' step fails for macos 13 uses: actions/cache@v4 with: path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ key: x86_64-apple-darwin-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Setup Rust uses: dtolnay/rust-toolchain@stable with: toolchain: stable
- name: Build run: cargo build --locked --release --target ${{ matrix.toolchain }}
- name: Upload binary artifact uses: actions/upload-artifact@v4 with: name: crunchy-cli-darwin-${{ matrix.arch }} path: ./target/${{ matrix.toolchain }}/release/crunchy-cli if-no-files-found: error
build-windows: runs-on: windows-latest steps: - name: Checkout uses: actions/checkout@v4
- name: Cargo cache uses: actions/cache@v4 with: path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ key: x86_64-pc-windows-gnu-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install system dependencies uses: msys2/setup-msys2@v2 with: update: true install: mingw-w64-x86_64-rust base-devel
- name: Build shell: msys2 {0} run: cargo build --locked --release --target x86_64-pc-windows-gnu
- name: Upload binary artifact uses: actions/upload-artifact@v4 with: name: crunchy-cli-windows-x86_64 path: ./target/x86_64-pc-windows-gnu/release/crunchy-cli.exe if-no-files-found: error