-
-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (75 loc) · 2.1 KB
/
Copy pathrelease.yml
File metadata and controls
88 lines (75 loc) · 2.1 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
###########################
###########################
## Release Pipeline ##
###########################
###########################
name: Release
#
# Documentation:
# https://github.com/googleapis/release-please
#
on:
push:
branches:
- main
- master
permissions:
contents: write
pull-requests: write
###############
# Set the Job #
###############
jobs:
release-please:
name: Release Please
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- name: Run Release Please
uses: google-github-actions/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
build-firmware:
name: Build Firmware
needs: release-please
if: needs.release-please.outputs.release_created == 'true'
runs-on: ubuntu-latest
strategy:
matrix:
environment: [LILYGO_T5_V231]
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Cache PlatformIO
uses: actions/cache@v6
with:
path: |
~/.platformio
.pio
key: ${{ runner.os }}-pio-${{ hashFiles('**/platformio.ini') }}
restore-keys: |
${{ runner.os }}-pio-
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install platformio intelhex
- name: Build firmware
run: platformio run --environment ${{ matrix.environment }}
- name: Upload firmware to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
BIN=".pio/build/${{ matrix.environment }}/firmware.bin"
if [ ! -f "${BIN}" ]; then
echo "Error: firmware binary not found at ${BIN}"
exit 1
fi
gh release upload "${{ needs.release-please.outputs.tag_name }}" \
"${BIN}#firmware-${{ matrix.environment }}.bin"