-
Notifications
You must be signed in to change notification settings - Fork 1
142 lines (122 loc) · 4.46 KB
/
release.yml
File metadata and controls
142 lines (122 loc) · 4.46 KB
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
name: Release
on:
push:
branches: [main]
permissions:
contents: read
jobs:
release:
name: Semantic Release
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
outputs:
new-release-published: ${{ steps.semantic.outputs.new-release-published }}
new-release-version: ${{ steps.semantic.outputs.new-release-version }}
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.RELEASE_APP_ID }}
private_key: ${{ secrets.RELEASE_APP_SECRET }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.generate_token.outputs.token }}
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- name: Run semantic-release
id: semantic
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
HUSKY: "0"
run: npx semantic-release
micropython-firmware:
name: Build and attach MicroPython firmware
needs: release
if: needs.release.outputs.new-release-published == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.RELEASE_APP_ID }}
private_key: ${{ secrets.RELEASE_APP_SECRET }}
- uses: actions/checkout@v4
with:
ref: v${{ needs.release.outputs.new-release-version }}
- name: Install ARM toolchain
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gcc-arm-none-eabi libnewlib-arm-none-eabi
- name: Build MicroPython firmware
run: make micropython-firmware
- name: Attach MicroPython firmware to release
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
VERSION="v${{ needs.release.outputs.new-release-version }}"
BUILD_DIR=".build/micropython-steami/ports/stm32/build-STEAM32_WB55RG"
cp "${BUILD_DIR}/firmware.hex" "steami-micropython-firmware-${VERSION}.hex"
cp "${BUILD_DIR}/firmware.bin" "steami-micropython-firmware-${VERSION}.bin"
gh release upload "$VERSION" \
"steami-micropython-firmware-${VERSION}.hex" \
"steami-micropython-firmware-${VERSION}.bin" \
--clobber
daplink-firmware:
name: Build and attach DAPLink firmware
needs: release
if: needs.release.outputs.new-release-published == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.RELEASE_APP_ID }}
private_key: ${{ secrets.RELEASE_APP_SECRET }}
- uses: actions/checkout@v4
with:
ref: v${{ needs.release.outputs.new-release-version }}
- name: Install build tools
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends ccache ninja-build python3-venv
- name: Clone DAPLink (needed for venv cache key)
run: make .build/DAPLink
- name: Cache gcc-arm-none-eabi 10.3-2021.10
uses: actions/cache@v4
with:
path: .build/gcc-arm-none-eabi-10.3-2021.10
key: gcc-arm-none-eabi-10.3-2021.10-linux-x86_64
- name: Cache DAPLink Python venv
uses: actions/cache@v4
with:
path: .build/DAPLink/venv
key: daplink-venv-${{ runner.os }}-${{ hashFiles('.build/DAPLink/requirements.txt') }}
- name: Build DAPLink firmware
run: make daplink-firmware
- name: Attach DAPLink firmware to release
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
VERSION="v${{ needs.release.outputs.new-release-version }}"
BUILD_DIR=".build/DAPLink/projectfiles/make_gcc_arm/stm32f103xb_steami32_if/build"
cp "${BUILD_DIR}/stm32f103xb_steami32_if_crc.bin" "steami-daplink-firmware-${VERSION}.bin"
cp "${BUILD_DIR}/stm32f103xb_steami32_if_crc.hex" "steami-daplink-firmware-${VERSION}.hex"
gh release upload "$VERSION" \
"steami-daplink-firmware-${VERSION}.bin" \
"steami-daplink-firmware-${VERSION}.hex" \
--clobber