-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (76 loc) · 2.3 KB
/
Copy pathrelease.yml
File metadata and controls
91 lines (76 loc) · 2.3 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
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build-firmware:
name: Build firmware for release
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
environment: [espA, espB, espA_pool]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Cache PlatformIO core
uses: actions/cache@v4
with:
path: |
~/.platformio/.cache
~/.platformio/packages
~/.platformio/platforms
key: pio-core-${{ runner.os }}-${{ hashFiles('platformio.ini') }}
restore-keys: |
pio-core-${{ runner.os }}-
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install platformio
- name: Build ${{ matrix.environment }}
run: pio run -e ${{ matrix.environment }}
- name: Stage firmware artifact
run: |
mkdir -p artifacts
cp .pio/build/${{ matrix.environment }}/firmware.bin \
"artifacts/${{ matrix.environment }}-${{ github.ref_name }}.bin"
cp .pio/build/${{ matrix.environment }}/firmware.elf \
"artifacts/${{ matrix.environment }}-${{ github.ref_name }}.elf"
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: firmware-${{ matrix.environment }}
path: artifacts/*
retention-days: 7
publish-release:
name: Publish GitHub Release
needs: build-firmware
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download all firmware artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: firmware-*
merge-multiple: true
- name: List artifacts
run: ls -la artifacts/
- name: Create / update GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
generate_release_notes: true
files: |
artifacts/*.bin
artifacts/*.elf
fail_on_unmatched_files: true