-
Notifications
You must be signed in to change notification settings - Fork 0
164 lines (146 loc) · 4.76 KB
/
build.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
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
name: Build
on:
# # Triggers the workflow on push but only for the master branch
# push:
# branches: [main, testing]
# paths-ignore:
# - "**.md"
# - version.properties
# # Note: This is different from "pull_request". Need to specify ref when doing checkouts.
# pull_request_target:
# branches: [master, testing]
# paths-ignore:
# - "**.md"
# #- "**.yml"
schedule:
- cron: '0 23 * * *' # Nightly master build
workflow_dispatch:
inputs:
meshtastic_firmware_ref:
description: Meshtastic firmware ref
required: true
type: string
default: master
create_release:
description: Create Release
required: false
type: boolean
default: false
# TODO: Add manual overrides for release (prerelease, name, body, etc)
workflow_call:
inputs:
meshtastic_firmware_ref:
description: Meshtastic firmware ref
required: true
type: string
default: master
create_release:
description: Create Release
required: false
type: boolean
default: false
env:
meshtastic_firmware_ref: ${{ inputs.meshtastic_firmware_ref || 'master' }}
jobs:
build:
name: Build ${{ matrix.arch }} ${{ matrix.board }}
strategy:
fail-fast: false
matrix:
include:
- arch: esp32s3
board: t-deck
artifact-paths: |
release/*.bin
release/*.elf
- arch: nrf52840
board: xiao_ble
artifact-paths: |
release/*.hex
release/*.uf2
release/*.elf
release/*.zip
- arch: nrf52840
board: heltec-mesh-node-t114
artifact-paths: |
release/*.hex
release/*.uf2
release/*.elf
release/*.zip
- arch: esp32s3
board: t-energy-s3_e22
artifact-paths: |
release/*.bin
release/*.elf
- arch: rp2040
board: rp2040-lora-slowclock
artifact-paths: |
release/*.uf2
release/*.elf
runs-on: ubuntu-24.04
outputs:
version: ${{ steps.build.outputs.version }}
steps:
- id: checkout_custom
uses: actions/checkout@v4
name: Checkout this repo (custom changes)
with:
path: .custom
- name: Cache PlatformIO and pip
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/.cache
key: pio-${{ matrix.arch }}
- id: build
uses: vidplace7/build-meshtastic@main
env:
XDG_CACHE_HOME: ${{ github.workspace }}/.cache
PLATFORMIO_CACHE_DIR: ${{ github.workspace }}/.cache/.platformio
with:
git-ref: ${{ env.meshtastic_firmware_ref }}
arch: ${{ matrix.arch }}
board: ${{ matrix.board }}
- name: Store binaries as an artifact
uses: actions/upload-artifact@v4
with:
name: firmware-${{ matrix.arch }}-${{ matrix.board }}-${{ steps.build.outputs.version }}.zip
overwrite: true
path: |
${{ matrix.artifact-paths }}
release:
name: Release
if: (inputs.create_release || false) == true
runs-on: ubuntu-24.04
needs: build
permissions:
contents: write
steps:
# Get upstream meshtastic firmware release info
- id: gh_upstream_release
name: Get Meshtastic firmware release info for ${{ env.meshtastic_firmware_ref }}
run: |
jdata=$(curl -s ${{ github.api_url }}/repos/meshtastic/firmware/releases | jq '.[] | select(.tag_name == "${{ env.meshtastic_firmware_ref }}")')
echo "prerelease=$(jq -r '.prerelease' <<< $jdata)" >> $GITHUB_OUTPUT
echo "name=$(jq -r '.name' <<< $jdata)" >> $GITHUB_OUTPUT
echo "body<<EOF" >> $GITHUB_OUTPUT
echo "$(jq -r '.body' <<< $jdata)" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- id: gather_artifacts
name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: "firmware-*-${{ needs.build.outputs.version }}.zip"
merge-multiple: true
path: ${{ github.workspace }}/release
- name: Create Release
uses: softprops/action-gh-release@v2
with:
draft: false
prerelease: ${{ steps.gh_upstream_release.outputs.prerelease }}
name: ${{ steps.gh_upstream_release.outputs.name }}
tag_name: v${{ needs.build.outputs.version }}
body: ${{ steps.gh_upstream_release.outputs.body }}
fail_on_unmatched_files: true
files: |
${{ steps.gather_artifacts.outputs.download-path }}/firmware-*