Skip to content

Commit

Permalink
github: Add workflow to build release tags
Browse files Browse the repository at this point in the history
  • Loading branch information
matthijskooijman committed Apr 13, 2023
1 parent 3d09ba9 commit 4168e36
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/publish-releases.yml
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

0 comments on commit 4168e36

Please sign in to comment.