Compare commits

...

4 Commits

Author SHA1 Message Date
Andrew Gunnerson 3940b31acb Version 3.1.3
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2024-05-02 19:19:43 -04:00
Andrew Gunnerson e87ee7c4ad CHANGELOG.md: Add entry for PR #279
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2024-05-02 19:19:21 -04:00
Andrew Gunnerson 0f8e30da37 Merge pull request #279 from chenxiaolong/mac-universal
ci.yml: Build universal binary for macOS
2024-05-02 19:17:31 -04:00
Andrew Gunnerson ae0863e319 ci.yml: Build universal binary for macOS
Fixes: #278

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2024-05-02 19:10:16 -04:00
4 changed files with 66 additions and 30 deletions
+55 -25
View File
@@ -13,17 +13,26 @@ concurrency:
jobs:
build:
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.artifact.os }}
env:
CARGO_TERM_COLOR: always
# https://github.com/rust-lang/rust/issues/78210
RUSTFLAGS: -C strip=symbols -C target-feature=+crt-static
TARGETS: ${{ join(matrix.artifact.targets, ' ') || matrix.artifact.name }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
artifact:
- os: ubuntu-latest
name: x86_64-unknown-linux-gnu
- os: windows-latest
name: x86_64-pc-windows-msvc
- os: macos-latest
name: universal-apple-darwin
targets:
- aarch64-apple-darwin
- x86_64-apple-darwin
combine: lipo
steps:
- name: Check out repository
uses: actions/checkout@v4
@@ -40,12 +49,12 @@ jobs:
| sed -E "s/^v//g;s/([^-]*-g)/r\1/;s/-/./g" \
>> "${GITHUB_OUTPUT}"
- name: Get Rust target triple
id: get_target
- name: Install toolchains
shell: bash
run: |
echo -n 'name=' >> "${GITHUB_OUTPUT}"
rustc -vV | sed -n 's|host: ||p' >> "${GITHUB_OUTPUT}"
for target in ${TARGETS}; do
rustup target add "${target}"
done
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
@@ -53,37 +62,58 @@ jobs:
- name: Clippy
shell: bash
run: |
cargo clippy --release --workspace --features static \
--target ${{ steps.get_target.outputs.name }}
for target in ${TARGETS}; do
cargo clippy --release --workspace --features static \
--target "${target}"
done
- name: Build
shell: bash
run: |
cargo build --release --workspace --features static \
--target ${{ steps.get_target.outputs.name }}
for target in ${TARGETS}; do
cargo build --release --workspace --features static \
--target "${target}"
done
- name: Tests
shell: bash
run: |
cargo test --release --workspace --features static \
--target ${{ steps.get_target.outputs.name }}
for target in ${TARGETS}; do
cargo test --release --workspace --features static \
--target "${target}"
done
- name: End to end tests
shell: bash
run: |
cargo run --release -p e2e --features static \
--target ${{ steps.get_target.outputs.name }} \
-- test -a -c e2e/e2e.toml
for target in ${TARGETS}; do
cargo run --release -p e2e --features static \
--target "${target}" \
-- test -a -c e2e/e2e.toml
done
# Due to https://github.com/rust-lang/rust/issues/78210, we have to use
# the --target option, which puts all output files in a different path.
# Symlink that path to the normal output directory so that we don't need
# to specify the Rust triple everywhere.
- name: Symlink target directory
- name: Create output directory
shell: bash
run: |
rm -rf target/output
ln -s ${{ steps.get_target.outputs.name }}/release target/output
case "${{ matrix.artifact.combine }}" in
lipo)
mkdir target/output
cmd=(lipo -output target/output/avbroot -create)
for target in ${TARGETS}; do
cmd+=("target/${target}/release/avbroot")
done
"${cmd[@]}"
;;
'')
ln -s "${TARGETS}/release" target/output
;;
*)
echo >&2 "Unsupported combine argument"
exit 1
;;
esac
# This is done to ensure a flat directory structure. The upload-artifact
# action no longer allows multiple uploads to the same destination.
@@ -94,7 +124,7 @@ jobs:
- name: Archive executable
uses: actions/upload-artifact@v4
with:
name: avbroot-${{ steps.get_version.outputs.version }}-${{ steps.get_target.outputs.name }}
name: avbroot-${{ steps.get_version.outputs.version }}-${{ matrix.artifact.name }}
path: |
target/output/LICENSE
target/output/README.md
+6
View File
@@ -7,6 +7,10 @@
to update the actual links at the bottom of the file.
-->
### Version 3.1.3
* Build universal binary for macOS ([Issue #278], [PR #279])
### Version 3.1.2
* Use `fastboot flashall` for initial setup to avoid needing to manually flash every partition ([PR #253])
@@ -181,6 +185,7 @@ Behind-the-scenes changes:
[Issue #223]: https://github.com/chenxiaolong/avbroot/issues/223
[Issue #225]: https://github.com/chenxiaolong/avbroot/issues/225
[Issue #265]: https://github.com/chenxiaolong/avbroot/issues/265
[Issue #278]: https://github.com/chenxiaolong/avbroot/issues/278
[PR #130]: https://github.com/chenxiaolong/avbroot/pull/130
[PR #132]: https://github.com/chenxiaolong/avbroot/pull/132
[PR #133]: https://github.com/chenxiaolong/avbroot/pull/133
@@ -261,3 +266,4 @@ Behind-the-scenes changes:
[PR #261]: https://github.com/chenxiaolong/avbroot/pull/261
[PR #276]: https://github.com/chenxiaolong/avbroot/pull/276
[PR #277]: https://github.com/chenxiaolong/avbroot/pull/277
[PR #279]: https://github.com/chenxiaolong/avbroot/pull/279
Generated
+4 -4
View File
@@ -108,7 +108,7 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "avbroot"
version = "3.1.2"
version = "3.1.3"
dependencies = [
"anyhow",
"assert_matches",
@@ -532,7 +532,7 @@ dependencies = [
[[package]]
name = "e2e"
version = "3.1.2"
version = "3.1.3"
dependencies = [
"anyhow",
"avbroot",
@@ -626,7 +626,7 @@ dependencies = [
[[package]]
name = "fuzz"
version = "3.1.2"
version = "3.1.3"
dependencies = [
"avbroot",
"honggfuzz",
@@ -2045,7 +2045,7 @@ dependencies = [
[[package]]
name = "xtask"
version = "3.1.2"
version = "3.1.3"
dependencies = [
"anyhow",
"clap",
+1 -1
View File
@@ -4,7 +4,7 @@ members = ["avbroot", "e2e", "fuzz", "xtask"]
resolver = "2"
[workspace.package]
version = "3.1.2"
version = "3.1.3"
license = "GPL-3.0-only"
edition = "2021"
repository = "https://github.com/chenxiaolong/avbroot"