Repository navigation
61 lines (52 loc) · 1.57 KB
/
Copy pathrelease.yml
File metadata and controls
61 lines (52 loc) · 1.57 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
# Tag a release (v1.0.0) to attach firmware to GitHub Releases.
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache PlatformIO
uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.platformio/.cache
.pio/libdeps
key: ${{ runner.os }}-pio-${{ hashFiles('platformio.ini') }}
restore-keys: |
${{ runner.os }}-pio-
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install PlatformIO
run: pip install --upgrade platformio
- name: Build and merge
run: |
pio run -e supermini
pio run -t merge -e supermini
- name: Package release files
run: |
VERSION="${GITHUB_REF_NAME}"
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
VERSION="manual-${GITHUB_SHA::7}"
fi
mkdir -p dist
cp .pio/build/supermini/firmware-merged.bin "dist/plane-radar-${VERSION}.bin"
sha256sum "dist/plane-radar-${VERSION}.bin" > "dist/plane-radar-${VERSION}.bin.sha256"
echo "version=${VERSION}" >> "$GITHUB_ENV"
- name: Publish GitHub Release
uses: softprops/action-gh-release@v2
with:
files: dist/*
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}