-
Notifications
You must be signed in to change notification settings - Fork 21
93 lines (91 loc) · 3.08 KB
/
release.yaml
File metadata and controls
93 lines (91 loc) · 3.08 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
name: Build all supported platforms's firmware & filesystem and publish new release
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.platformio/.cache
~/.venv
key: ${{ runner.os }}-pio
- name: Install requirements
run: |
sudo apt-get update
sudo apt-get install --yes --no-install-recommends lsb-release git python3-pip python3-venv curl gzip
python3 -m venv ~/.venv
- name: Install PlatformIO Core
run: ~/.venv/bin/python -m pip install platformio
- name: Build firmware for all supported platforms
run: ~/.venv/bin/pio run
# - name: Generate filesystem content
# run: |
# source ~/.venv/bin/activate
# ./data-templates/generate-data.sh
- name: Build filesystem for all supported platforms
run: ~/.venv/bin/pio run -t buildfs
- name: Compute version name
id: version
uses: proudust/gh-describe@v2.1.0
- name: Prepare distribution files
run: |
mkdir dist
for file in .pio/build/*/*.bin; do
platform="$( basename "$( dirname "$file" )" )"
filename="${platform}_${{steps.version.outputs.describe}}_$( basename "$file" ).gz"
gzip --stdout "$file" > "dist/$filename"
done
- name: Upload built files
uses: actions/upload-artifact@v4.4.3
with:
name: dist
path: |
dist/*.bin.gz
publish:
runs-on: ubuntu-latest
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
needs: build
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: List Git tags
run: git tag -l
- name: "Download built files"
uses: actions/download-artifact@v4.1.8
with:
name: dist
- name: Extract version from config.h
id: extract_version
run: |
version=$(grep "#define RELEASE" ./src/config/config.h | awk '{print $4}' | tr -d '"' )
echo "VERSION=$version" >> $GITHUB_ENV
echo "version=$version" >> $GITHUB_OUTPUT
- name: Print extracted version
run: |
echo ${{ steps.extract_version.outputs.version }}
#- name: Generate changelog
# id: changelog
# uses: mikepenz/release-changelog-builder-action@v5.0.0
# with:
# mode: "COMMIT"
# log-level: "DEBUG"
- name: Create release
uses: softprops/action-gh-release@v2.0.9
id: create_release
with:
draft: false
prerelease: false
tag_name: v${{ steps.extract_version.outputs.version }}
name: Release v${{ steps.extract_version.outputs.version }}
body: |
Changelog for version ${{ steps.extract_version.outputs.version }}
${{ github.event.head_commit.message }}
make_latest: "true"
files: |
*.bin.gz
env:
GITHUB_TOKEN: ${{ github.token }}