-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
60 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -7,6 +7,7 @@ on: | |
push: | ||
branches: | ||
- 'main' | ||
workflow_call: # to reuse this workflow by release.yml | ||
|
||
jobs: | ||
build: | ||
|
@@ -34,4 +35,18 @@ jobs: | |
- name: Build binary | ||
run: | | ||
cmake -B build/${{ matrix.type }} -G Ninja -DCMAKE_C_COMPILER:FILEPATH=arm-none-eabi-gcc -DCMAKE_CXX_COMPILER:FILEPATH=arm-none-eabi-g++ -DCMAKE_BUILD_TYPE="${{ matrix.type }}" | ||
cmake --build build/${{ matrix.type }} | ||
cmake --build build/${{ matrix.type }} | ||
- name: Rename and move build files | ||
run : | | ||
mkdir build/artifacts | ||
mv build/${{ matrix.type }}/*.bin build/artifacts/firmware_${{ matrix.type }}.bin | ||
mv build/${{ matrix.type }}/*.elf build/artifacts/firmware_${{ matrix.type }}.elf | ||
- name: Upload build files | ||
uses: actions/[email protected] | ||
with: | ||
name: build-artifact | ||
path: ./build/artifacts/ | ||
retention-days: 1 | ||
if-no-files-found: error |
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,44 @@ | ||
name: Create Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
jobs: | ||
build-project: | ||
uses: Netz39/Stepper-Locking-System_firmware/.github/workflows/build.yml@add-release-workflow | ||
|
||
create-release: | ||
runs-on: ubuntu-latest | ||
needs: build-project | ||
steps: | ||
- name: "Generate release changelog" | ||
id: generate-release-changelog | ||
uses: heinrichreimer/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
onlyLastTag: "false" # set to false if no tags exist (buggy with only one tag) | ||
stripHeaders: "true" | ||
stripGeneratorNotice: "true" | ||
|
||
- name: Extract the VERSION name | ||
id: get-version | ||
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} | ||
|
||
- name: Retrieve build files | ||
uses: actions/[email protected] | ||
with: | ||
name: build-artifact | ||
path: build/artifacts | ||
|
||
- name: "Create GitHub release" | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: ${{ github.ref }} | ||
name: "${{ steps.get-version.outputs.VERSION }}" | ||
body: "${{ steps.generate-release-changelog.outputs.changelog }}" | ||
prerelease: ${{ startsWith(steps.get-version.outputs.VERSION, 'v0.') }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
files: | | ||
./build/artifacts/* |