Skip to content

Commit

Permalink
Add version to release build process
Browse files Browse the repository at this point in the history
  • Loading branch information
pbek committed Nov 18, 2022
1 parent 400db9e commit e1a2250
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,24 @@ jobs:
uses: actions/checkout@v3
with:
path: firmware/applications_user/usb_hid_autofire
- name: Set Env
run: |
cd firmware/applications_user/usb_hid_autofire
export VERSION=$(cat version.h | sed 's/[^0-9,.]//g')
export TAG=v${VERSION}
export RELEASE_TEXT=$(grep -Pzo "## ${VERSION}\n(\n|.)+?\n##" CHANGELOG.md | sed '$ d')
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "TAG=${TAG}" >> $GITHUB_ENV
# add multiline release text
echo "RELEASE_TEXT<<EOF" >> $GITHUB_ENV
echo "${RELEASE_TEXT}" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Printenv
run: |
echo "VERSION=${VERSION}"
echo "TAG=${TAG}"
echo "RELEASE_TEXT=${RELEASE_TEXT}"
printenv
- name: Build application
run: cd firmware && ./fbt fap_usb_hid_autofire
- name: Create Draft Release
Expand All @@ -35,8 +53,9 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.sha }}
release_name: ${{ github.sha }}
tag_name: ${{ env.TAG }}
release_name: Release v${{ env.VERSION }}
body: ${{ env.RELEASE_TEXT }}
draft: true
prerelease: false
- uses: actions/[email protected]
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Changelog

## 0.1
- initial release of the USB HID Autofire application

0 comments on commit e1a2250

Please sign in to comment.