-
Notifications
You must be signed in to change notification settings - Fork 20
200 lines (197 loc) · 7.93 KB
/
release.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
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
name: Release
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
firmware:
name: Build Firmware
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup Python
uses: actions/setup-python@master
with:
python-version: '3.x'
- name: Install Platform IO
run: |
python -m pip install --upgrade pip
pip install -U platformio
- name: Get the version
id: get_version
run: echo ::set-output name=version::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Build firmware
run: |
sed -i -e 's/\/\*REL_VER\*\//#define FIRMWAREVERSION "${{ steps.get_version.outputs.version }}"/g' ./src/Version.h
platformio run -e miniV1 -e miniV2 -e miniV3 -e nanoV3 -e linkV1
- shell: bash
run: |
mkdir ./artifacts
cp ./.pio/build/miniV1/firmware.bin ./artifacts/miniV1.bin
cp ./.pio/build/miniV2/firmware.bin ./artifacts/miniV2.bin
cp ./.pio/build/miniV3/firmware.bin ./artifacts/miniV3.bin
cp ./.pio/build/nanoV3/firmware.bin ./artifacts/nanoV3.bin
cp ./.pio/build/linkV1/firmware.bin ./artifacts/linkV1.bin
- uses: actions/upload-artifact@v1
with:
name: firmware
path: ./artifacts
nextion:
name: Build Nextion
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Build nextion
shell: pwsh
run: |
.\nextion\build.ps1
- uses: actions/upload-artifact@v1
with:
name: nextion
path: ./nextion/artifacts
release:
name: Build Release
needs: [firmware, nextion]
runs-on: ubuntu-latest
steps:
- name: Download firmware
uses: actions/download-artifact@v1
with:
name: firmware
- name: Download nextion
uses: actions/download-artifact@v1
with:
name: nextion
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Changes in this Release
draft: true
prerelease: true
allowUpdates: true
- name: Get the version
id: get_version
run: echo ::set-output name=version::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Upload Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./firmware/miniV1.bin
asset_name: mini_v1_esp32_firmware_${{ steps.get_version.outputs.version }}.bin
asset_content_type: application/octet-stream
- name: Upload Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./firmware/miniV2.bin
asset_name: mini_v2_esp32_firmware_${{ steps.get_version.outputs.version }}.bin
asset_content_type: application/octet-stream
- name: Upload Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./firmware/miniV3.bin
asset_name: mini_v3_esp32_firmware_${{ steps.get_version.outputs.version }}.bin
asset_content_type: application/octet-stream
- name: Upload Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./firmware/nanoV3.bin
asset_name: nano_v3_esp32_firmware_${{ steps.get_version.outputs.version }}.bin
asset_content_type: application/octet-stream
- name: Upload Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./firmware/linkV1.bin
asset_name: link_v1_esp32_firmware_${{ steps.get_version.outputs.version }}.bin
asset_content_type: application/octet-stream
- name: Upload Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./nextion/NX3224T028-0.tft
asset_name: mini_v1_esp32_NX3224T028-0_${{ steps.get_version.outputs.version }}.tft
asset_content_type: application/octet-stream
- name: Upload Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./nextion/NX3224T028-180.tft
asset_name: mini_v1_esp32_NX3224T028-180_${{ steps.get_version.outputs.version }}.tft
asset_content_type: application/octet-stream
- name: Upload Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./nextion/NX3224K028-0.tft
asset_name: mini_v1_esp32_NX3224K028-0_${{ steps.get_version.outputs.version }}.tft
asset_content_type: application/octet-stream
- name: Upload Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./nextion/NX3224K028-180.tft
asset_name: mini_v1_esp32_NX3224K028-180_${{ steps.get_version.outputs.version }}.tft
asset_content_type: application/octet-stream
- name: Upload Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./nextion/NX3224T028-0.tft
asset_name: mini_v2_esp32_NX3224T028-0_${{ steps.get_version.outputs.version }}.tft
asset_content_type: application/octet-stream
- name: Upload Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./nextion/NX3224T028-180.tft
asset_name: mini_v2_esp32_NX3224T028-180_${{ steps.get_version.outputs.version }}.tft
asset_content_type: application/octet-stream
- name: Upload Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./nextion/NX3224K028-0.tft
asset_name: mini_v2_esp32_NX3224K028-0_${{ steps.get_version.outputs.version }}.tft
asset_content_type: application/octet-stream
- name: Upload Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./nextion/NX3224K028-180.tft
asset_name: mini_v2_esp32_NX3224K028-180_${{ steps.get_version.outputs.version }}.tft
asset_content_type: application/octet-stream