forked from freifunkMUC/site-ffm
-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (127 loc) · 4.23 KB
/
firmware.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
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'
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@v4
- 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
get_gluon_tag:
runs-on: ubuntu-latest
outputs:
closest_gluon_tag: ${{ steps.set_gluon_tag.outputs.gluon_git_tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set Gluon ref
id: set_gluon_ref
shell: bash
run: |
cat gluon-git-ref
echo "gluon_git_ref=$(cat gluon-git-ref | tr -d '\n')" >> $GITHUB_OUTPUT
- name: Checkout Gluon
uses: actions/checkout@v4
with:
repository: 'freifunk-gluon/gluon'
ref: ${{ steps.set_gluon_ref.outputs.gluon_git_tag }}
fetch-tags: true
- name: Set Gluon tag
id: set_gluon_tag
shell: bash
run: |
echo "gluon_git_tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
build_firmware:
needs:
- generate_target_matrix
- get_gluon_tag
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.generate_target_matrix.outputs.build_target_json) }}
runs-on: ubuntu-latest
container:
image: ghcr.io/freifunk-gluon/gluon-build:${{ needs.get_gluon_tag.outputs.closest_gluon_tag }}
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@v4
with:
fetch-depth: 0
- 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 }} 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 }} V=s
echo "status=success" >> $GITHUB_OUTPUT
- name: Upload firmware ${{ matrix.target }}
uses: actions/upload-artifact@v4
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@v4
- 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@v2
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