Skip to content

Commit

Permalink
Merge 30d1ef2 into b1f2e71
Browse files Browse the repository at this point in the history
  • Loading branch information
wcampbell0x2a authored Mar 24, 2024
2 parents b1f2e71 + 30d1ef2 commit d35a4bc
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 29 deletions.
38 changes: 24 additions & 14 deletions .github/workflows/binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,43 @@ jobs:
RUSTFLAGS: "-C target-feature=+crt-static"
strategy:
matrix:
targets:
- x86_64-unknown-linux-musl
- aarch64-unknown-linux-musl
- arm-unknown-linux-musleabi
job:
- { target: x86_64-unknown-linux-musl, os: ubuntu-latest, use-cross: true }
- { target: aarch64-unknown-linux-musl, os: ubuntu-latest, use-cross: true }
- { target: arm-unknown-linux-musleabi, os: ubuntu-latest, use-cross: true }
- { target: x86_64-apple-darwin, os: macos-12 }

env:
BUILD_CMD: cargo
steps:
- name: Overwrite build command env variable
if: matrix.job.use-cross
shell: bash
run: |
echo "BUILD_CMD=cross" >> $GITHUB_ENV
RUSTFLAGS="-C target-feature=-crt-static" cargo install cross --git https://github.com/cross-rs/cross
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Populate cache
uses: ./.github/workflows/cache

- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
target: ${{ matrix.targets }}
- run: RUSTFLAGS="-C target-feature=-crt-static" cargo install cross --git https://github.com/cross-rs/cross
- run: cross build -p backhand-cli --bin add-backhand --bin replace-backhand --locked --target ${{ matrix.targets }} --profile=dist
target: ${{ matrix.job.target }}

- run: $BUILD_CMD build -p backhand-cli --bin add-backhand --bin replace-backhand --locked --target ${{ matrix.job.target }} --profile=dist
# default features, but replace gzip with gzip-zune-inflate
- run: cross build -p backhand-cli --bin unsquashfs-backhand --locked --target ${{ matrix.targets }} --profile=dist --no-default-features --features zstd,xz,gzip-zune-inflate
- run: $BUILD_CMD build -p backhand-cli --bin unsquashfs-backhand --locked --target ${{ matrix.job.target }} --profile=dist --no-default-features --features zstd,xz,gzip-zune-inflate
- name: archive
run: |
tar -czvf backhand-${{ matrix.targets }}.tar.gz \
-C target/${{ matrix.targets }}/dist/ $BINS
tar -czvf backhand-${{ matrix.job.target }}.tar.gz \
-C target/${{ matrix.job.target }}/dist/ $BINS
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: backhand-${{ matrix.targets }}.tar.gz
path: backhand-${{ matrix.targets }}.tar.gz
name: backhand-${{ matrix.job.target }}.tar.gz
path: backhand-${{ matrix.job.target }}.tar.gz

# check semvar before release!
- name: Check semver
Expand All @@ -61,8 +71,8 @@ jobs:
uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: backhand-${{ matrix.targets }}.tar.gz
asset_name: backhand-${{ github.ref_name }}-${{ matrix.targets }}.tar.gz
file: backhand-${{ matrix.job.target }}.tar.gz
asset_name: backhand-${{ github.ref_name }}-${{ matrix.job.target }}.tar.gz
tag: ${{ github.ref }}
prerelease: true
overwrite: true
26 changes: 17 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ jobs:
# fixed one at a time.
fail-fast: false
matrix:
target:
- x86_64-unknown-linux-musl
- aarch64-unknown-linux-musl
- arm-unknown-linux-musleabi
- armv7-unknown-linux-musleabi
job:
- { target: x86_64-unknown-linux-musl, os: ubutnu-latest, use-cross: true }
- { target: aarch64-unknown-linux-musl, os: ubuntu-latest, use-cross: true }
- { target: arm-unknown-linux-musleabi, os: ubuntu-latest, use-cross: true }
- { target: armv7-unknown-linux-musleabi, os: ubuntu-latest, use-cross: true }
- { target: x86_64-apple-darwin, os: macos-12 }
toolchain:
- stable
# msrv of backhand-cli
Expand All @@ -35,20 +36,27 @@ jobs:
# default features
-

env:
BUILD_CMD: cargo
steps:
- name: Overwrite build command env variable
if: matrix.job.use-cross
shell: bash
run: |
echo "BUILD_CMD=cross" >> $GITHUB_ENV
RUSTFLAGS="-C target-feature=-crt-static" cargo install cross --git https://github.com/cross-rs/cross
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Populate cache
uses: ./.github/workflows/cache

- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
# install cross
- run: RUSTFLAGS="-C target-feature=-crt-static" cargo install cross --git https://github.com/cross-rs/cross
# build lib and bins with cross
- run: cross build ${{ matrix.features }} --target ${{ matrix.target }} --release --locked --workspace
- run: $BUILD_CMD build ${{ matrix.features }} --target ${{ matrix.target }} --release --locked --workspace
# test with cross, skipping slow test and tests that use more then qemu default memory
- run: CROSS_CONTAINER_OPTS="--network host" RUST_LOG=info cross test --workspace --release ${{ matrix.features }} --target ${{ matrix.target }} --locked -- --skip slow --skip no_qemu
- run: CROSS_CONTAINER_OPTS="--network host" RUST_LOG=info $BUILD_CMD test --workspace --release ${{ matrix.features }} --target ${{ matrix.target }} --locked -- --skip slow --skip no_qemu

# build/test all supported on native x86_64 arch for library and bins (all tests)
build-test-native:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v0.15.0] - 2024-03-24
### `backhand`
- Add support for `Socket` and `NamedFIFO` Inodes in library and extraction binaries. Thanks ([@tnias](https://github.com/tnias)) ([#472](https://github.com/wcampbell0x2a/backhand/pull/472), [#470](https://github.com/wcampbell0x2a/backhand/pull/470))
- Add `FilesytemWriter::push_fifo` and `FilesystemWriter::push_socket`
Expand Down
4 changes: 2 additions & 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 @@ -9,7 +9,7 @@ members = [
resolver = "2"

[workspace.package]
version = "0.14.2"
version = "0.15.0"
authors = ["wcampbell <[email protected]>"]
license = "MIT OR Apache-2.0"
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This allows changing the magic bytes, custom compression algorithms, and the End
Add the following to your `Cargo.toml` file:
```toml
[dependencies]
backhand = "0.14.2"
backhand = "0.15.0"
```
### Reading/Writing/Modifying Firmware
```rust,no_run
Expand Down
2 changes: 1 addition & 1 deletion backhand-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ clap_complete = "4.5.1"
indicatif = "0.17.8"
console = "0.15.8"
rayon = "1.9.0"
backhand = { path = "../backhand", default-features = false, version = "0.14.2" }
backhand = { path = "../backhand", default-features = false, version = "0.15.0" }
tracing = "0.1.40"
color-print = "0.3.5"

Expand Down
2 changes: 1 addition & 1 deletion backhand/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//! Add the following to your `Cargo.toml` file:
//! ```toml
//! [dependencies]
//! backhand = "0.14.2"
//! backhand = "0.15.0"
//! ```
//!
//! ### Reading
Expand Down

0 comments on commit d35a4bc

Please sign in to comment.