forked from PlummersSoftwareLLC/NightDriverStrip
-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (78 loc) · 2.81 KB
/
CI.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
name: PlatformIO CI
on: [push, pull_request, workflow_dispatch]
jobs:
collect-environments:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Find environments
id: envs
run: echo "envs=$(tools/show_envs.py)" >> $GITHUB_OUTPUT
outputs:
envs: ${{ steps.envs.outputs.envs }}
build-environment:
runs-on: ubuntu-latest
needs: [collect-environments]
strategy:
fail-fast: false
matrix:
envname: ${{ fromJson(needs.collect-environments.outputs.envs) }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install PlatformIO
run: |
curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py -o get-platformio.py
python get-platformio.py
echo "/home/runner/.platformio/penv/bin" >> $GITHUB_PATH
- name: Copy secrets and clear SSID
run: |
grep -v "^#define cszSSID" include/secrets.example.h > include/secrets.h
echo '#define cszSSID ""' >> include/secrets.h
- name: "Build environment: ${{ matrix.envname }}"
run: pio run -e ${{ matrix.envname }}
build-and-publish-installer:
if: ( github.repository_owner == 'PlummersSoftwareLLC' && github.ref == 'refs/heads/main' ) || ( github.repository_owner == 'rbergen' && github.ref == 'refs/heads/staging' )
runs-on: ubuntu-latest
needs: [build-environment]
env:
PLATFORMIO_CORE_DIR: ${{ github.workspace }}/.platformio
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
remove-android: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
remove-dotnet: 'true'
remove-haskell: 'true'
- uses: actions/checkout@v3
- name: Install PlatformIO
run: |
curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py -o get-platformio.py
python get-platformio.py
echo "${PLATFORMIO_CORE_DIR}/penv/bin" >> $GITHUB_PATH
- name: Copy secrets and clear SSID
run: |
grep -v "^#define cszSSID" include/secrets.example.h > include/secrets.h
echo '#define cszSSID ""' >> include/secrets.h
- name: Build web installer environments and installer
run: |
python tools/bake_installer.py
touch WebInstaller/.nojekyll
- name: Push to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: pages
folder: WebInstaller