Build ffmuc firmware #756
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 ffmuc firmware | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- v* | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
- '**/CODEOWNERS' | |
- '.github/ISSUE_TEMPLATE' | |
- '.github/*.yml' | |
- '.github/workflows/backport.yml' | |
- '.github/workflows/bump-modules.yml' | |
- 'contrib/sign.sh' | |
- 'contrib/actions/update-modules.sh' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}-${{ github.event.pull_request.number || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
generate_target_matrix: | |
runs-on: ubuntu-latest | |
outputs: | |
target_json: ${{ steps.set_target.outputs.target }} | |
build_target_json: ${{ steps.set_target.outputs.build_target }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
- name: Set target matrix | |
id: set_target | |
shell: bash | |
run: | | |
target_list=$(cat targets | jq -Rsc '.[:-1] | split("\n")') | |
echo "target={\"target\": $(echo $target_list)}" >> $GITHUB_OUTPUT | |
echo "build_target={\"target\": $(echo $target_list)}" >> $GITHUB_OUTPUT | |
build_firmware: | |
needs: generate_target_matrix | |
strategy: | |
fail-fast: false | |
matrix: ${{ fromJson(needs.generate_target_matrix.outputs.build_target_json) }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Maximize build space | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /usr/local/lib/android | |
sudo rm -rf /opt/ghc | |
- name: Checkout | |
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
with: | |
fetch-depth: 0 | |
- name: Show system information | |
run: contrib/actions/show-system-info.sh | |
- name: Install build dependencies | |
run: | | |
sudo -E ./scripts/install_build_dependencies.sh | |
- name: pre-build without ffmuc-mesh-vpn-wireguard-vxlan (workaround for x86-64) | |
if: matrix.target == 'x86-64' | |
run: | | |
sed -i '/ffmuc-mesh-vpn-wireguard-vxlan/d' site.mk | |
make BROKEN=1 GLUON_TARGETS=${{ matrix.target }} BUILD_NUMBER=${{ github.event.pull_request.number && format('pr{0}', github.event.pull_request.number) || github.run_id && format('run{0}', github.run_id) }} V=s | |
git checkout site.mk | |
- name: build target ${{ matrix.target }} | |
id: compile | |
run: | | |
git checkout -b patched ${GITHUB_SHA} | |
make BROKEN=1 GLUON_TARGETS=${{ matrix.target }} BUILD_NUMBER=${{ github.event.pull_request.number && format('pr{0}', github.event.pull_request.number) || github.run_id && format('run{0}', github.run_id) }} V=s | |
echo "status=success" >> $GITHUB_OUTPUT | |
- name: Upload firmware ${{ matrix.target }} | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
if: steps.compile.outputs.status == 'success' | |
with: | |
name: ${{ matrix.target }}_output | |
path: ./output | |
create_release: | |
runs-on: ubuntu-latest | |
needs: | |
- build_firmware | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- name: Download all artifacts | |
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 | |
- name: Display structure of artifacts | |
run: ls -R | |
- name: Create tar.gz files | |
run: | | |
set -x | |
for output in *_output; do | |
tar zcvf "${output}.tar.gz" "${output}" | |
done | |
- name: Create Release & Upload Release Assets | |
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8 | |
with: | |
# Note: If there is no release name specified, releases created in | |
# the GitHub UI do not trigger a failure and are modified instead. | |
draft: false | |
prerelease: false | |
# Note: Release notes are only auto-generated if the release was | |
# created by the Github Action and was not created in the Github UI. | |
generate_release_notes: true | |
files: | | |
./*_output.tar.gz |