-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
github: Add workflow to build release tags
- Loading branch information
1 parent
3d09ba9
commit 4168e36
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# This workflow handles tagged releases. | ||
# | ||
# Whenever a tag is pushed, this produces a clean build, creates | ||
# a github release for the thag and attaches the build results. | ||
name: Release Workflow | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
env: | ||
CHANGELOG: Changelog.md | ||
RELEASE_CHANGELOG: Release.md | ||
|
||
jobs: | ||
build_and_publish: | ||
name: Build and publish release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout tag | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install tools | ||
run: | | ||
sudo apt update | ||
sudo apt install build-essential gcc-avr avr-libc gcc-arm-none-eabi | ||
- name: Build libopencm3 for STM32G0 | ||
run: | | ||
make -C libopencm3 lib/stm32/g0 CFLAGS='-flto -fno-fat-lto-objects' | ||
- name: Build firmware | ||
run: | | ||
make | ||
- name: Generate changelog | ||
run: | | ||
# This prints the first two lines and then up to the next | ||
# heading (next version), and then uses head to remove that | ||
# heading again | ||
sed -n '1p; 2,/^===/p' "${CHANGELOG}" | head -n -2 > "${RELEASE_CHANGELOG}" | ||
- name: release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
body_path: ${{ env.RELEASE_CHANGELOG }} | ||
files: | | ||
*.bin | ||
*.hex | ||
*.elf |