rMpp support #3
Workflow file for this run
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
name: Build Release | |
on: | |
push: | |
tags: | |
- 'v*.*.*' # Trigger this workflow only for version tags (e.g., v1.0.0) | |
jobs: | |
build-release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Install cross | |
run: | | |
cargo install cross | |
- name: Build for aarch64 | |
run: | | |
cross build --target aarch64-unknown-linux-gnu --release | |
mv target/aarch64-unknown-linux-gnu/release/webinterface-wifi webinterface-wifi-arm64 | |
- name: Build for armv7 | |
run: | | |
cross build --target armv7-unknown-linux-gnueabihf --release | |
mv target/armv7-unknown-linux-gnueabihf/release/webinterface-wifi webinterface-wifi-arm32 | |
- name: Populate install file | |
run: | | |
repo_name="${{ github.event.repository.name }}" | |
tag=$(echo $GITHUB_REF | sed 's/refs\/tags\///') | |
webinterface_wifi64_sha256sum=$(sha256sum webinterface-wifi-arm64 | cut -d ' ' -f 1) | |
webinterface_wifi32_sha256sum=$(sha256sum webinterface-wifi-arm32 | cut -d ' ' -f 1) | |
service_file_sha256sum=$(sha256sum webinterface-wifi.service | cut -d ' ' -f 1) | |
config_sha256sum=$(sha256sum config/config.default.toml | cut -d ' ' -f 1) | |
sed -i "s/VERSION/$tag/g" install-webint-wf.sh | |
sed -i "s/WEBINTERFACE_WIFI64_SHA256SUM/$webinterface_wifi64_sha256sum/g" install-webint-wf.sh | |
sed -i "s/WEBINTERFACE_WIFI32_SHA256SUM/$webinterface_wifi32_sha256sum/g" install-webint-wf.sh | |
sed -i "s/SERVICE_FILE_SHA256SUM/$service_file_sha256sum/g" install-webint-wf.sh | |
sed -i "s/CONFIG_SHA256SUM/$config_sha256sum/g" install-webint-wf.sh | |
sed -i "s/REPO_NAME/$repo_name/g" install-webint-wf.sh | |
- name: Get tag message | |
run: | | |
tag=$(echo $GITHUB_REF | sed 's/refs\/tags\///') | |
# manually fetch the tag, otherwise commit message is found | |
git fetch --depth=1 origin +refs/tags/"$tag":refs/tags/"$tag" | |
message=$(git tag -l "$tag" --format '%(contents)') | |
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV | |
echo "$message" >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
- name: Upload release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
webinterface-wifi-arm32 | |
webinterface-wifi-arm64 | |
webinterface-wifi.service | |
assets/favicon.ico | |
config/config.default.toml | |
install-webint-wf.sh | |
body: ${{ env.RELEASE_NOTES }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |