Skip to content

Commit

Permalink
Add cross-building on Github Action (#8)
Browse files Browse the repository at this point in the history
Following platforms are added:

- armv7-unknown-linux-gnueabihf
- aarch64-linux-android --release
- mips-unknown-linux-musl
  • Loading branch information
sorz committed Apr 15, 2021
1 parent 11f7186 commit 6aea5eb
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion .github/workflows/build-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
build-linux:
name: Build for
name: Build for Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -40,3 +40,32 @@ jobs:
artifacts: target/release/*.exe.xz
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
build-linux-cross:
name: Cross-build for various on Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --target armv7-unknown-linux-gnueabihf --release
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --target aarch64-linux-android --release
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --target mips-unknown-linux-musl --release
- run: xz -kfS "_${GITHUB_REF#*/v}_linux_armv7_gnueabihf.bin.xz" target/armv7-unknown-linux-gnueabihf/release/moproxy
- run: xz -kfS "_${GITHUB_REF#*/v}_linux_aarch64_android.bin.xz" target/aarch64-linux-android/release/moproxy
- run: xz -kfS "_${GITHUB_REF#*/v}_linux_mips_musl.bin.xz" target/mips-unknown-linux-musl/release/moproxy
- uses: ncipollo/release-action@v1
with:
artifacts: "target/**/*.bin.xz"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true

0 comments on commit 6aea5eb

Please sign in to comment.