From d90d8bad4551023a05abccaf26760f760549e919 Mon Sep 17 00:00:00 2001 From: drclaw Date: Tue, 29 Nov 2022 10:41:52 +0000 Subject: [PATCH] Add Android release (aarch64) --- .github/workflows/release.yml | 51 ++++++++++++++++++++++++++++++++++- Cross.toml | 2 ++ README.md | 6 ++++- 3 files changed, 57 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 04e7e5b..2159172 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,6 +50,50 @@ jobs: name: phetch-linux-armv7 path: target/armv7-unknown-linux-gnueabihf/release/phetch-${{ steps.get_version.outputs.VERSION }}-linux-armv7.tgz + build_aarch64: + name: Build for android aarch64 + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Cache cargo registry + uses: actions/cache@v3 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo index + uses: actions/cache@v3 + with: + path: ~/.cargo/git + key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo build + uses: actions/cache@v3 + with: + path: target + key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} + - name: Setup Toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: aarch64-linux-android + override: true + - name: Build release + uses: actions-rs/cargo@v1 + with: + use-cross: true + command: build + args: --release --locked --target aarch64-linux-android + - name: Get current version + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} + - name: Package Binary + run: cp doc/phetch.1 target/aarch64-linux-android/release && cd target/aarch64-linux-android/release && tar zcvf phetch-${{ steps.get_version.outputs.VERSION }}-android-aarch64.tgz phetch phetch.1 + - name: Upload Artifact + uses: actions/upload-artifact@v1 + with: + name: phetch-android-aarch64 + path: target/aarch64-linux-android/release/phetch-${{ steps.get_version.outputs.VERSION }}-android-aarch64.tgz + build_linux: name: Build for Linux x86_64 runs-on: ubuntu-latest @@ -128,7 +172,7 @@ jobs: create: name: Create Release - needs: [build_armv7, build_linux, build_macos] + needs: [build_armv7, build_aarch64, build_linux, build_macos] runs-on: ubuntu-latest steps: - name: Checkout @@ -148,6 +192,10 @@ jobs: uses: actions/download-artifact@v1 with: name: phetch-linux-armv7 + - name: Download Android (aarch64) artifact + uses: actions/download-artifact@v1 + with: + name: phetch-android-aarch64 - name: Create Release uses: softprops/action-gh-release@v1 with: @@ -157,6 +205,7 @@ jobs: phetch-macos/phetch-${{ steps.get_version.outputs.VERSION }}-macos.zip phetch-linux-x86_64/phetch-${{ steps.get_version.outputs.VERSION }}-linux-x86_64.tgz phetch-linux-armv7/phetch-${{ steps.get_version.outputs.VERSION }}-linux-armv7.tgz + phetch-android-aarch64/phetch-${{ steps.get_version.outputs.VERSION }}-android-aarch64.tgz body_path: CHANGELOG.md env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Cross.toml b/Cross.toml index 8a6fbdc..9b26b1e 100644 --- a/Cross.toml +++ b/Cross.toml @@ -1,2 +1,4 @@ [target.armv7-unknown-linux-gnueabihf] image = "rustembedded/cross:armv7-unknown-linux-gnueabihf-0.1.16" +[target.aarch64-linux-android] +image = "rustembedded/cross:aarch64-linux-android-0.1.16" diff --git a/README.md b/README.md index f2ed8c4..2af884b 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ On NetBSD, phetch is included in the main pkgsrc repo: pkgin install phetch -Binaries for Linux, Raspberry Pi, and Mac are available at +Binaries for Linux, Raspberry Pi, Mac and Android (termux) are available at https://github.com/xvxx/phetch/releases: - [phetch-v1.1.0-linux-x86_64.tgz][0] @@ -114,6 +114,10 @@ You can also build and install from source if you have `cargo`, cd phetch env PREFIX=/usr/local make install +For Termux use: + + env PREFIX=/data/data/com.termux/files/usr make install + ## development To build with TLS support on **Linux**, you need `openssl` and