-
Notifications
You must be signed in to change notification settings - Fork 41
94 lines (91 loc) · 3.04 KB
/
build_binaries.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
on:
push:
# branches:
# - "master"
workflow_dispatch:
jobs:
get-envs:
name: Get environments
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install PlatformIO
run: pip install platformio
- name: Get default environments
id: envs
run: |
echo "environments=$(pio project config --json-output | jq -cr '.[0] | select(.[0] == "platformio")[1][] | select(.[0] == "default_envs")[1]')" >> $GITHUB_OUTPUT
outputs:
environments: ${{ steps.envs.outputs.environments }}
build:
name: build ${{ matrix.environment }}
needs: get-envs
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
environment: ${{ fromJSON(needs.get-envs.outputs.environments) }}
steps:
- uses: actions/checkout@v4
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip
- name: Cache PlatformIO
uses: actions/cache@v3
with:
path: |
~/.platformio
./pio
key: ${{ runner.os }}-pio-${{ matrix.environment }}-${{ hashFiles('**/platformio.ini') }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install PlatformIO
run: pip install -r requirements.txt
- name: Build firmware
env:
PUBLISH: true
run: pio run -e ${{ matrix.environment }}
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.environment }}
path: publish/${{ matrix.environment }}
publish:
name: Publish binaries
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: gh-pages
- uses: actions/configure-pages@v3
- uses: actions/jekyll-build-pages@v1
with:
destination: ./output
- run: mkdir .output/publish
- uses: actions/download-artifact@v3
with:
path: ./output/publish
- name: merge manifests
run: |
jq -s '[.[] | select(.name == "ATEM_tally_light")] | (.[0] | with_entries(select(.key != "builds"))) + {builds: map(.builds) | add}' ./output/publish/*/manifest.json > ./output/ATEM_tally_light_manifest.json &&
jq -s '[.[] | select(.name == "ATEM_tally_test_server")] | (.[0] | with_entries(select(.key != "builds"))) + {builds: map(.builds) | add}' ./output/publish/*/manifest.json > ./output/ATEM_tally_test_server_manifest.json
- uses: actions/upload-pages-artifact@v2
with:
name: gh-page-mine
path: ./output