-
-
Notifications
You must be signed in to change notification settings - Fork 53
134 lines (111 loc) · 3.59 KB
/
build-and-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
name: Build, Release & Deploy
on:
[push]
env:
prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'testing') }}
jobs:
build-webui:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
with:
repository: 'pixelit-project/WebUI'
- name: Use Node.js 💾
uses: actions/setup-node@v1
with:
node-version: 19.x
- name: Install dependencies 🔧
run: npm install
- name: Build WebUI 🏗️
run: npm run build
- name: Upload build artifacts 💾
uses: actions/upload-artifact@v3
with:
name: pixelit-webui
path: dist
build-fw:
needs: build-webui
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Cache pip 💾
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO 💾
uses: actions/cache@v2
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python 🐍
uses: actions/setup-python@v2
- name: Download WebUI artifacts 💾
uses: actions/download-artifact@v3
with:
name: pixelit-webui
path: pixelit-webui-artifact
- name: Update webinterface.h 🔧
run: |
python .github/webui.py
- name: Update version in PixelIt.ino 🔧
run: |
python .github/updateversion.py ${{ github.ref_name }}
- name: Install pio and its dependencies 🔧
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Run PlatformIO build on selected platforms 🏗️
run: platformio run -e d1_mini -e ESP8266 -e wemos_d1_mini32 -e nodemcuv2
- name: Upload build artifacts 💾
uses: actions/upload-artifact@v3
with:
name: pixelit-firmware
path: .pio/build/*/firmware_*.bin
release-fw:
needs: build-fw
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download artifacts 💾
uses: actions/download-artifact@v3
with:
name: pixelit-firmware
- name: Display structure of downloaded files 🔍
run: ls -R
- name: Upload binaries as release 🚀
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./*/firmware_*.bin
tag: ${{ github.ref }}
release_name: ${{ github.ref_name }}
overwrite: true
file_glob: true
prerelease: ${{ env.prerelease }}
deploy-webui-gh-pages:
runs-on: ubuntu-latest
needs: build-webui
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
with:
repository: 'pixelit-project/WebUI'
- name: Download artifacts 💾
uses: actions/download-artifact@v3
with:
name: pixelit-webui
path: webui
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: . # The folder the action should deploy.
CLEAN: false # Automatically remove deleted files from the deploy branch