-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: run armhf and arm64 build in parallel
- Loading branch information
Showing
4 changed files
with
127 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,12 +43,40 @@ jobs: | |
- uses: Swatinem/rust-cache@v2 | ||
- run: cargo clippy -- -D warnings | ||
|
||
release: | ||
test-for-release: | ||
needs: [check, fmt, clippy] | ||
name: Semantic Release | ||
name: Test for Release | ||
runs-on: ubuntu-latest | ||
if: github.actor != 'sbosnick-bot' | ||
|
||
outputs: | ||
new_release_published: ${{ steps.semantic.outputs.new_release_published }} | ||
new_release_version: ${{ steps.semantic.outputs.new_release_version }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
|
||
- name: Semantic Release | ||
uses: cycjimmy/semantic-release-action@v4 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
id: semantic | ||
with: | ||
dry_run: true | ||
|
||
- name: Update version | ||
if: steps.semantic.outputs.new_release_published == 'true' | ||
run: | | ||
sed -i '/\[package\]/,/^version = "[^"]*"$/ s/^version = "[^"]*"$/version = "'"${{ steps.semantic.outputs.new_release_version }}"'"/' Cargo.toml | ||
build-armhf: | ||
needs: [test-for-release] | ||
if: needs.test-for-release.outputs.new_release_published == 'true' | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
@@ -59,14 +87,70 @@ jobs: | |
- name: Install Rust Stable | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Build | ||
run: | | ||
./build-deb.sh ${{ needs.test-for-release.outputs.new_release_version }} arm-unknown-linux-gnueabihf | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: deb-armhf | ||
path: target/arm-unknown-linux-gnueabihf/debian/bloop-box_3.2.0_armhf.deb | ||
|
||
build-arm64: | ||
needs: [test-for-release] | ||
if: needs.test-for-release.outputs.new_release_published == 'true' | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
|
||
- name: Install Rust Stable | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Build | ||
run: | | ||
./build-deb.sh ${{ needs.test-for-release.outputs.new_release_version }} aarch64-unknown-linux-gnu | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: deb-arm64 | ||
path: target/aarch64-unknown-linux-gnu/debian/bloop-box_3.2.0_arm64.deb | ||
|
||
release: | ||
needs: [build-armhf, build-arm64] | ||
name: Semantic Release | ||
runs-on: ubuntu-latest | ||
if: needs.test-for-release.outputs.new_release_published == 'true' | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
|
||
- name: Download Build Artifacts | ||
uses: actions/download-artifact@v3 | ||
|
||
- name: Install Rust Stable | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Update version | ||
run: | | ||
sed -i '/\[package\]/,/^version = "[^"]*"$/ s/^version = "[^"]*"$/version = "'"${{ steps.semantic.outputs.new_release_version }}"'"/' Cargo.toml | ||
cargo update --package bloop-box --offline | ||
- name: Semantic Release | ||
uses: cycjimmy/semantic-release-action@v3 | ||
uses: cycjimmy/semantic-release-action@v4 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
id: semantic | ||
with: | ||
semantic_version: 19.0.5 | ||
extra_plugins: | | ||
@semantic-release/[email protected] | ||
@semantic-release/[email protected] | ||
@semantic-release/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
VERSION="$1" | ||
TARGET="$2" | ||
|
||
cargo install cross --git https://github.com/cross-rs/cross | ||
cargo install cargo-deb | ||
|
||
sed -i '/\[package\]/,/^version = "[^"]*"$/ s/^version = "[^"]*"$/version = "'"$VERSION"'"/' Cargo.toml | ||
|
||
cross build --target "$TARGET" --release || exit 1 | ||
cp -a "target/$TARGET/release/bloop-box" target/bloop-box || exit 1 | ||
cargo-deb -v --no-build --target "$TARGET" --no-strip || exit 1 | ||
|
||
# This is workaround for https://github.com/kornelski/cargo-deb/issues/47 | ||
# Patch the generated DEB to have ./ paths compatible with `unattended-upgrade`: | ||
pushd "target/$TARGET/debian" || exit 1 | ||
DEB_FILE_NAME=$(ls -1 *.deb | head -n 1) | ||
DATA_ARCHIVE=$(ar t "${DEB_FILE_NAME}"| grep -E '^data\.tar') | ||
ar x "${DEB_FILE_NAME}" "${DATA_ARCHIVE}" | ||
tar tf "${DATA_ARCHIVE}" | ||
|
||
if [[ "${DATA_ARCHIVE}" == *.xz ]]; then | ||
# Install XZ support that will be needed by TAR | ||
apt-get -y install -y xz-utils | ||
EXTRA_TAR_ARGS=J | ||
fi | ||
|
||
rm -rf tar-hack | ||
mkdir tar-hack | ||
tar -C tar-hack -xf "${DATA_ARCHIVE}" | ||
pushd tar-hack || exit 1 | ||
tar c${EXTRA_TAR_ARGS}f "../${DATA_ARCHIVE}" --owner=0 --group=0 ./* | ||
popd || exit 1 | ||
tar tf "${DATA_ARCHIVE}" | ||
ar r "${DEB_FILE_NAME}" "${DATA_ARCHIVE}" | ||
popd || exit 1 |
This file was deleted.
Oops, something went wrong.