mirror of
https://github.com/samsonjs/agate.git
synced 2026-03-25 09:05:50 +00:00
use cargo cross
The problems I had using podman were resolved by realizing that ubuntu-latest does not actually mean the latest version of Ubuntu (for now) so explicitly stating the Ubuntu version, installing podman works fine and can build binaries for Raspberry Pi properly.
This commit is contained in:
parent
cd821a32c1
commit
3089a4034a
4 changed files with 14 additions and 18 deletions
|
|
@ -1,8 +0,0 @@
|
||||||
[target.aarch64-unknown-linux-gnu]
|
|
||||||
linker = "aarch64-linux-gnu-gcc"
|
|
||||||
|
|
||||||
[target.arm-unknown-linux-gnueabihf]
|
|
||||||
linker = "arm-linux-gnueabihf-gcc"
|
|
||||||
|
|
||||||
[target.armv7-unknown-linux-gnueabihf]
|
|
||||||
linker = "arm-linux-gnueabihf-gcc"
|
|
||||||
14
.github/workflows/rust.yml
vendored
14
.github/workflows/rust.yml
vendored
|
|
@ -25,7 +25,7 @@ jobs:
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
|
||||||
build_ubuntu:
|
build_ubuntu:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
needs: create_release
|
needs: create_release
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
|
|
@ -73,19 +73,21 @@ jobs:
|
||||||
needs: create_release
|
needs: create_release
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- run: rustc -Vv
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --verbose --release
|
run: cargo build --verbose --release
|
||||||
|
- name: strip names
|
||||||
|
run: strip target/release/agate.exe
|
||||||
|
- name: compress
|
||||||
|
run: gzip -c target/release/agate.exe > ./agate.exe.gz
|
||||||
- name: upload release asset win
|
- name: upload release asset win
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/upload-release-asset@v1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ needs.create_release.outputs.upload_url }}
|
upload_url: ${{ needs.create_release.outputs.upload_url }}
|
||||||
asset_name: agate.x86_64-pc-windows-msvc.exe
|
asset_name: agate.x86_64-pc-windows-msvc.exe.gz
|
||||||
# TODO: this one is not zipped and not stripped
|
asset_path: agate.exe.gz
|
||||||
asset_path: target/release/agate.exe
|
asset_content_type: application/gzip
|
||||||
asset_content_type: application/vnd.microsoft.portable-executable
|
|
||||||
|
|
||||||
build_macos:
|
build_macos:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
|
|
|
||||||
2
Cross.toml
Normal file
2
Cross.toml
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
[target.arm-unknown-linux-gnueabihf]
|
||||||
|
image = "zenria/cross:arm-rpi-4.9.3-linux-gnueabihf"
|
||||||
|
|
@ -5,13 +5,13 @@ set -e
|
||||||
|
|
||||||
# Cross-compiling needs a linker for the respective platforms. If you are on a Debian-based x86_64 Linux,
|
# Cross-compiling needs a linker for the respective platforms. If you are on a Debian-based x86_64 Linux,
|
||||||
# you can install them with:
|
# you can install them with:
|
||||||
sudo apt -y install gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu
|
sudo apt -y install podman gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu
|
||||||
|
# Also install cross compilation tool for cargo
|
||||||
|
cargo install cross
|
||||||
|
|
||||||
for i in x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu arm-unknown-linux-gnueabihf armv7-unknown-linux-gnueabihf
|
for i in x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu arm-unknown-linux-gnueabihf armv7-unknown-linux-gnueabihf
|
||||||
do
|
do
|
||||||
# Make sure the cross-compiled std crate is available.
|
cross build --verbose --release --target $i
|
||||||
rustup target add $i
|
|
||||||
cargo build --verbose --release --target $i
|
|
||||||
cp target/$i/release/agate agate.$i
|
cp target/$i/release/agate agate.$i
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue