forked from verybadsoldier/esp_rgbww_firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
175 lines (161 loc) · 5.42 KB
/
deploy-pages.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
name: Publish Firmware
on:
workflow_run:
workflows:
- "Application CI" # Must match the name in build_firmware.yml
types:
- completed
workflow_dispatch:
inputs:
someParameter:
description: "Optional parameter"
required: false
jobs:
get-version:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get firmware version
id: get_fw_version
run: |
version=$(git describe --abbrev=4 --dirty --always --tags)-[$(git rev-parse --abbrev-ref HEAD)]
echo "fw_version=$version" >> $GITHUB_OUTPUT
publish:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v2
with:
ref: gh-pages
- name: Create directories
run: |
mkdir -p download/esp8266/testing/debug
mkdir -p download/esp8266/testing/release
mkdir -p download/esp32/testing/debug
mkdir -p download/esp32/testing/release
mkdir -p download/esp32c3/testing/debug
mkdir -p download/esp32c3/testing/release
# Download each artifact from the build_firmware workflow and move it to the correct path
- name: Download esp8266 debug
uses: actions/download-artifact@v3
with:
name: lightinator-esp8266-debug
path: download/esp8266/testing/debug
- name: Download esp8266 release
uses: actions/download-artifact@v3
with:
name: lightinator-esp8266-release
path: download/esp8266/testing/release
- name: Download esp32 debug
uses: actions/download-artifact@v3
with:
name: lightinator-esp32-debug
path: download/esp32/testing/debug
- name: Download esp32 release
uses: actions/download-artifact@v3
with:
name: lightinator-esp32-release
path: download/esp32/testing/release
- name: Download esp32c3 debug
uses: actions/download-artifact@v3
with:
name: lightinator-esp32c3-debug
path: download/esp32c3/testing/debug
- name: Download esp32c3 release
uses: actions/download-artifact@v3
with:
name: lightinator-esp32c3-release
path: download/esp32c3/testing/release
- name: Generate firmware.json
run: |
cat <<EOF > firmware.json
{
"firmware": [
{
"soc": "esp8266",
"type": "debug",
"branch": "testing",
"fw_version": "${{ steps.get_fw_version.outputs.fw_version }}",
"files": {
"rom": {
"url": "download/esp8266/testing/debug/rom0.bin"
}
}
},
{
"soc": "esp8266",
"type": "release",
"branch": "testing",
"fw_version": "${{ steps.get_fw_version.outputs.fw_version }}",
"files": {
"rom": {
"url": "download/esp8266/testing/release/rom0.bin"
}
}
},
{
"soc": "esp32",
"type": "debug",
"branch": "testing",
"fw_version": "${{ steps.get_fw_version.outputs.fw_version }}",
"files": {
"rom": {
"url": "download/esp32/testing/debug/app.bin"
}
}
},
{
"soc": "esp32",
"type": "release",
"branch": "testing",
"fw_version": "${{ steps.get_fw_version.outputs.fw_version }}",
"files": {
"rom": {
"url": "download/esp32/testing/release"
}
}
},
{
"soc": "esp32c3",
"type": "debug",
"branch": "testing",
"fw_version": "${{ steps.get_fw_version.outputs.fw_version }}",
"files": {
"rom": {
"url": "download/esp32c3/testing/debug"
}
}
},
{
"soc": "esp32c3",
"type": "release",
"branch": "testing",
"fw_version": "${{ steps.get_fw_version.outputs.fw_version }}",
"files": {
"rom": {
"url": "download/esp32c3/testing/release"
}
}
}
],
"rom": {
"fw_version": "${{ steps.get_fw_version.outputs.fw_version }}",
"url": "download/esp8266/testing/release/rom0.bin"
},
"spiffs": {
"webapp_version": "0.3.3",
"url": "http://rgbww.dronezone.de/testing/spiff_rom.bin"
}
}
EOF
# Commit and push to gh-pages
- name: Commit and push changes
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git add .
git commit -m "Publish firmware artifacts and JSON" || echo "No changes to commit"
git push origin gh-pages