Skip to content

Commit 4168e36

Browse files
github: Add workflow to build release tags
1 parent 3d09ba9 commit 4168e36

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# This workflow handles tagged releases.
2+
#
3+
# Whenever a tag is pushed, this produces a clean build, creates
4+
# a github release for the thag and attaches the build results.
5+
name: Release Workflow
6+
on:
7+
push:
8+
tags:
9+
- '*'
10+
env:
11+
CHANGELOG: Changelog.md
12+
RELEASE_CHANGELOG: Release.md
13+
14+
jobs:
15+
build_and_publish:
16+
name: Build and publish release
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout tag
20+
uses: actions/checkout@v3
21+
with:
22+
submodules: recursive
23+
24+
- name: Install tools
25+
run: |
26+
sudo apt update
27+
sudo apt install build-essential gcc-avr avr-libc gcc-arm-none-eabi
28+
29+
- name: Build libopencm3 for STM32G0
30+
run: |
31+
make -C libopencm3 lib/stm32/g0 CFLAGS='-flto -fno-fat-lto-objects'
32+
33+
- name: Build firmware
34+
run: |
35+
make
36+
37+
- name: Generate changelog
38+
run: |
39+
# This prints the first two lines and then up to the next
40+
# heading (next version), and then uses head to remove that
41+
# heading again
42+
sed -n '1p; 2,/^===/p' "${CHANGELOG}" | head -n -2 > "${RELEASE_CHANGELOG}"
43+
44+
- name: release
45+
uses: softprops/action-gh-release@v1
46+
with:
47+
body_path: ${{ env.RELEASE_CHANGELOG }}
48+
files: |
49+
*.bin
50+
*.hex
51+
*.elf

0 commit comments

Comments
 (0)