Skip to content

Commit

Permalink
chore: add aarch64 build (#7)
Browse files Browse the repository at this point in the history
- use binary cross
- add pre-built binaries to readme
  • Loading branch information
crazyscot authored Oct 28, 2024
1 parent dedfe22 commit 863eb71
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 9 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:
CARGO_TERM_COLOR: always

jobs:
# Build the app on all supported platforms
# Build the app on all supported platforms, at least for the time being
build:
strategy:
matrix:
Expand All @@ -24,24 +24,36 @@ jobs:
host: ubuntu-latest
target: x86_64-unknown-linux-musl
rust: stable
- build: aarch64-musl
host: ubuntu-latest
target: aarch64-unknown-linux-musl
rust: stable
runs-on: ${{ matrix.host }}
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.target }}
- uses: taiki-e/install-action@v2
with:
tool: cross
#- name: Set minimal profile (Windows only)
# if: matrix.host == 'windows-latest'
# run: rustup set profile minimal
- uses: Swatinem/rust-cache@v2
with:
key: "${{matrix.build}}"
key: "${{ matrix.build }}"
- name: install packages (ubuntu)
if: startsWith(matrix.host, 'ubuntu')
run: scripts/install-ubuntu-packages
- name: Build
run: cargo build --locked
run: cross build --locked --target ${{ matrix.target }}
- uses: actions/upload-artifact@v4
with:
name: qcp-bin-${{ matrix.target }}
path: target/${{ matrix.target }}/debug/qcp

# We only need to run the checks on a single platform
checks:
Expand Down
19 changes: 15 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ name: release
on:
release:
types: [published]
# useful for testing
# running on push is sometimes useful for testing; also enable WORKFLOW_TEST
#push:
# branches:
# - misc/ci-auto-release
# - misc/build-aarch64

env:
WORKFLOW_TEST: false

permissions:
contents: write
Expand All @@ -20,13 +23,21 @@ jobs:
host: ubuntu-latest
target: x86_64-unknown-linux-musl
rust: stable
- build: aarch64-musl
host: ubuntu-latest
target: aarch64-unknown-linux-musl
rust: stable
runs-on: ${{ matrix.host }}
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.target }}
- uses: taiki-e/install-action@v2
with:
tool: cross
- uses: Swatinem/rust-cache@v2
with:
key: "${{matrix.build}}"
Expand All @@ -43,9 +54,9 @@ jobs:
leading-dir: true
tar: unix
zip: windows
# dry_run: true # when testing the workflow
dry_run: ${{ env.WORKFLOW_TEST }}
# Uploading the artifact is useful when testing the workflow in dry-run mode
- uses: actions/upload-artifact@v4
with:
name: binary-${{ matrix.target }}
name: qcp-tarball-${{ matrix.target }}
path: ${{ steps.build.outputs.archive }}.tar.gz
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,5 @@ unescaped_backticks = "deny"

[package.metadata.cross.target.x86_64-unknown-linux-musl]
pre-build = [ "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install capnproto" ]
[package.metadata.cross.target.aarch64-unknown-linux-musl]
pre-build = [ "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install capnproto" ]
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ high-performance remote file copy utility for long-distance internet connections

#### Platform support status

- Well tested: Debian and Ubuntu using OpenSSH
- Tested: Ubuntu on WSL
- Well tested: Debian and Ubuntu on x86_64, using OpenSSH
- Tested: Ubuntu on WSL; aarch64 (Raspbian)
- Untested: OSX/BSD family
- Not currently supported: Windows

Expand All @@ -26,6 +26,17 @@ high-performance remote file copy utility for long-distance internet connections
* Install the `qcp` binary on both machines. It needs to be in your `PATH` on the remote machine.
* Run `qcp --help-buffers` and follow its instructions.

### Installing pre-built binaries

These can be found on the [latest release](https://github.com/crazyscot/qcp/releases/latest).

* Linux x86_64: x86_64-unknown-linux-musl
* Linux aarch64: aarch64-unknown-linux-musl

The binaries are statically linked. Linux builds should work on all recent distributions, as long as you have selected the correct CPU architecture.

### Installation from source

Install it from crates.io using `cargo`:

```bash
Expand Down

0 comments on commit 863eb71

Please sign in to comment.