Repository navigation
220 lines (207 loc) · 7.84 KB
/
Copy pathmulti-arch-build.yml
File metadata and controls
220 lines (207 loc) · 7.84 KB
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
name: Build/Deploy
on:
push:
branches:
- main
- openwrt-25.12
- openwrt-24.10
- openwrt-23.05
- openwrt-22.03
paths:
- '**/Makefile'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
name: build ${{ matrix.arch }} ${{ github.ref_name }}
runs-on: ubuntu-26.04
strategy:
fail-fast: false
matrix:
arch:
- aarch64_cortex-a53
- aarch64_cortex-a72
- aarch64_cortex-a76
- aarch64_generic
- arm_arm1176jzf-s_vfp
- arm_arm926ej-s
- arm_cortex-a15_neon-vfpv4
- arm_cortex-a5_vfpv4
- arm_cortex-a7
- arm_cortex-a7_neon-vfpv4
- arm_cortex-a7_vfpv4
- arm_cortex-a8_vfpv3
- arm_cortex-a9
- arm_cortex-a9_neon
- arm_cortex-a9_vfpv3-d16
- arm_fa526
- arm_xscale
- armeb_xscale
- i386_pentium-mmx
- i386_pentium4
- loongarch64_generic
- mips64_mips64r2
- mips64_octeonplus
- mips64el_mips64r2
- mips_24kc
- mips_4kec
- mips_mips32
- mipsel_24kc
- mipsel_24kc_24kf
- mipsel_74kc
- mipsel_mips32
- powerpc64_e5500
- powerpc_464fp
# powerpc_8540 was replaced by powerpc_8548 in OpenWrt 23.05+
- ${{ github.ref_name == 'openwrt-22.03' && 'powerpc_8540' || 'powerpc_8548' }}
# riscv64_riscv64 has been renamed to riscv64_generic in OpenWrt master
- ${{ (github.ref_name == 'openwrt-24.10' || github.ref_name == 'openwrt-23.05') && 'riscv64_riscv64' || 'riscv64_generic' }}
- x86_64
rel_branch:
- ${{ github.ref_name }}
exclude:
# OpenWrt main (SNAPSHOT)
- arch: mips_4kec # https://lists.openwrt.org/pipermail/openwrt-devel/2025-August/044216.html
rel_branch: main
- arch: mipsel_24kc_24kf # Ignore temporarily, broken in OpenWrt SNAPSHOT
rel_branch: main
# OpenWrt 25.12
- arch: mips_4kec # https://lists.openwrt.org/pipermail/openwrt-devel/2025-August/044216.html
rel_branch: openwrt-25.12
- arch: mipsel_24kc_24kf # Ignore temporarily, broken in OpenWrt 25.12
rel_branch: openwrt-25.12
# OpenWrt 24.10
## None
# OpenWrt 23.05
- arch: aarch64_cortex-a76
rel_branch: openwrt-23.05
- arch: armeb_xscale
rel_branch: openwrt-23.05
- arch: loongarch64_generic
rel_branch: openwrt-23.05
- arch: mips64_mips64r2
rel_branch: openwrt-23.05
- arch: mips64el_mips64r2
rel_branch: openwrt-23.05
- arch: powerpc64_e5500
rel_branch: openwrt-23.05
# OpenWrt 22.03
- arch: aarch64_cortex-a76
rel_branch: openwrt-22.03
- arch: armeb_xscale
rel_branch: openwrt-22.03
- arch: loongarch64_generic
rel_branch: openwrt-22.03
- arch: mips64_mips64r2
rel_branch: openwrt-22.03
- arch: mips64el_mips64r2
rel_branch: openwrt-22.03
- arch: powerpc64_e5500
rel_branch: openwrt-22.03
- arch: riscv64_generic
rel_branch: openwrt-22.03
steps:
- uses: actions/checkout@v7
- name: Build APK packages ${{ matrix.arch }}
if: github.ref_name == 'main' || github.ref_name == 'openwrt-25.12'
uses: openwrt/gh-action-sdk@v11
env:
ARCH: "${{ matrix.arch }}-${{ github.ref_name }}"
FEEDNAME: meshtastic
PRIVATE_KEY: "${{ secrets.WRT_APK_KEY }}"
INDEX: 1
# Enable verbose output when debug mode is active
V: ${{ runner.debug == '1' && 's' || '' }}
- name: Build IPK packages ${{ matrix.arch }}
if: github.ref_name == 'openwrt-24.10' || github.ref_name == 'openwrt-23.05' || github.ref_name == 'openwrt-22.03'
uses: openwrt/gh-action-sdk@v11
env:
# For 23.05 branch: Override ARCH to use the last supported release, 23.05.6
ARCH: "${{ matrix.arch }}-${{ contains(github.ref_name, '23.05') && '23.05.6' || github.ref_name }}"
FEEDNAME: meshtastic
KEY_BUILD: "${{ secrets.WRT_IPK_KEY }}"
INDEX: 1
# Enable verbose output when debug mode is active
V: ${{ runner.debug == '1' && 's' || '' }}
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.arch }}
path: bin/packages/${{ matrix.arch }}/meshtastic/
deploy-pages:
name: Deploy packages to GitHub Pages
runs-on: ubuntu-26.04
needs: build
concurrency:
# Only run one deploy at a time
group: publish-pages
steps:
- name: Download artifacts
uses: actions/download-artifact@v8
with:
path: ${{ github.ref_name }}
- name: Upload packages to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
deploy_key: ${{ secrets.WRT_REPO_DEPLOY_KEY }}
external_repository: meshtastic/openwrt-repo
publish_dir: ${{ github.ref_name }}
destination_dir: ${{ github.ref_name }}
user_name: github-actions[bot]
user_email: github-actions[bot]@users.noreply.github.com
enable_jekyll: true
deploy-r2:
name: Deploy packages to Cloudflare R2
runs-on: ubuntu-26.04
needs: build
concurrency:
# Only run one deploy at a time
group: publish-r2
env:
r2_bucket: meshtastic-openwrt-repo
steps:
# Only the index action and the page templates are needed for the deployment.
- name: Fetch openwrt-repo metadata
uses: actions/checkout@v7
with:
sparse-checkout: |
.github/actions
.github/openwrt-repo
- name: Download artifacts
uses: actions/download-artifact@v8
with:
path: ${{ github.ref_name }}
- name: Generate html directory index
uses: ./.github/actions/generate-index
- name: Upload packages to Cloudflare R2
env:
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
# R2 is single-region; the S3 API still requires a region to be set.
AWS_DEFAULT_REGION: auto
# Cloudflare's documented aws-cli settings for R2. Left at the AWS
# default, CLI >= 2.23 attaches CRC32 request checksums that R2 can
# reject, so both of these must stay at when_required.
AWS_REQUEST_CHECKSUM_CALCULATION: when_required
AWS_RESPONSE_CHECKSUM_VALIDATION: when_required
R2_ENDPOINT: https://${{ secrets.R2_ACCOUNT_ID }}.r2.cloudflarestorage.com
run: |
set -euo pipefail
aws --version
r2_sync() {
aws s3 sync "./${{ github.ref_name }}" "s3://${r2_bucket}/${{ github.ref_name }}/" \
--endpoint-url "$R2_ENDPOINT" \
--no-progress \
--delete \
--metadata "commit=${{ github.sha }},run=${{ github.run_id }}" \
"$@"
}
# Packages carry their version in the filename, so cache them for
# 1 week in browser, and 1 month on the CDN.
# Uploaded first, so the indexes never point at a missing file.
r2_sync --cache-control 'public, max-age=604800, s-maxage=2592000' \
--exclude '*' --include '*.apk' --include '*.ipk'
# Indexes (Packages*, index.json, packages.adb) are rewritten by every
# build, so cache them for 1 day in browser and on the CDN.
r2_sync --cache-control 'public, max-age=86400, s-maxage=86400' \
--exclude '*.apk' --exclude '*.ipk'