Skip to content

Commit

Permalink
Add build deps in gh pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
crazystylus committed Apr 8, 2023
1 parent a4d56e3 commit 577846a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 12 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,26 @@ jobs:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
deb: true
dpkg-arch: amd64
- os: ubuntu-latest
target: arm-unknown-linux-musleabihf
dpkg-arch: armhf
- os: ubuntu-latest
target: armv7-unknown-linux-musleabihf
dpkg-arch: armhf
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
deb: true
dpkg-arch: arm64

- os: macos-11
target: x86_64-apple-darwin
- os: macos-11
target: aarch64-apple-darwin

- os: windows-latest
target: x86_64-pc-windows-msvc
- os: windows-latest
target: aarch64-pc-windows-msvc
# - os: windows-latest
# target: x86_64-pc-windows-msvc
# - os: windows-latest
# target: aarch64-pc-windows-msvc
steps:
- name: Checkout repository
uses: actions/checkout@dc323e67f16fb5f7663d20ff7941f27f5809e9b6 # v2.6.0
Expand All @@ -63,20 +65,23 @@ jobs:
with:
key: ${{ matrix.target }}

- name: Install build deps for macos
if: runner.os == 'macOS'
run: brew install xz protobuf

- name: Build binary
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
with:
command: build
args: --release --locked --target=${{ matrix.target }} --color=always --verbose
use-cross: ${{ runner.os == 'Linux' }}

- name: Package (*nix)
- name: Package for (*nix)
if: runner.os != 'Windows'
run: >
tar -cv
LICENSE README.md
man/
-C contrib/ completions/ -C ../
-C ../
-C target/${{ matrix.target }}/release/ otadump
| gzip --best
> 'otadump-${{ steps.get_version.outputs.value }}-${{ matrix.target }}.tar.gz'
Expand Down
3 changes: 1 addition & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ indicatif = "0.17.3"
memmap2 = "0.5.10"
prost = "0.11.8"
rayon = "1.7.0"
rust-lzma = "0.5.1"
rust-lzma = { git = "https://github.com/crazystylus/rust-lzma", branch = "feat-static-linking", version = "0.5.1", features = ["static"] }
sha2 = "0.10.6"
sync-unsafe-cell = "0.1.0"

Expand Down
15 changes: 15 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[target.x86_64-unknown-linux-gnu]
image = "ghcr.io/cross-rs/x86_64-unknown-linux-gnu:main"
pre-build = ["apt-get update", "apt install -y liblzma-dev protobuf-compiler"]

[target.aarch64-unknown-linux-gnu]
image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main"
pre-build = ["dpkg --add-architecture arm64","apt-get update", "apt install -y liblzma-dev:arm64 protobuf-compiler"]

[target.arm-unknown-linux-gnueabihf]
image = "ghcr.io/cross-rs/arm-unknown-linux-gnueabihf:main"
pre-build = ["dpkg --add-architecture armhf","apt-get update", "apt install -y liblzma-dev:armhf protobuf-compiler"]

[target.armv7-unknown-linux-gnueabihf]
image = "ghcr.io/cross-rs/armv7-unknown-linux-gnueabihf:main"
pre-build = ["dpkg --add-architecture armhf","apt-get update", "apt install -y liblzma-dev:armhf protobuf-compiler"]

0 comments on commit 577846a

Please sign in to comment.