File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed
Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -3,11 +3,19 @@ name: LCM Build and Publish
33on :
44 workflow_dispatch :
55 pull_request :
6+ paths :
7+ - " LCM/**"
8+ - .github/workflows/build_lcm.yaml
9+ - vcpkg-configuration.json
610 push :
711 branches :
812 - main
913 tags :
1014 - lcm@*
15+ paths :
16+ - " LCM/**"
17+ - .github/workflows/build_lcm.yaml
18+ - vcpkg-configuration.json
1119
1220concurrency :
1321 group : ${{ github.workflow }}-${{ github.ref }}
3240 run : |
3341 cpackget add LCM/HKMicroChip.HK32F030xMxx_DFP.1.0.17.pack
3442
43+ - name : Extract version from tag
44+ id : version-info
45+ if : startsWith(github.ref, 'refs/tags/lcm@')
46+ run : |
47+ echo "version=${GITHUB_REF#refs/tags/lcm@}" >> "$GITHUB_OUTPUT"
48+ echo "version-suffix=$(echo ${GITHUB_REF#refs/tags/lcm@} | tr -d '.')" >> "$GITHUB_OUTPUT"
49+ [[ "${GITHUB_REF#refs/tags/lcm@}" =~ ^[0-9\.]+$ ]] && echo "is-prerelease=false" >> "$GITHUB_OUTPUT" || echo "is-prerelease=true" >> "$GITHUB_OUTPUT"
50+ echo "CFLAGS=-DVERSION=\\\"$(echo ${GITHUB_REF#refs/tags/lcm@} | tr '.' '_')\\\"" >> "$GITHUB_ENV"
51+
3552 - name : Build
3653 working-directory : ./LCM
3754 run : |
5067 with :
5168 name : firmware
5269 path : ./LCM/*.hex
70+
71+ - name : Rename release files
72+ if : startsWith(github.ref, 'refs/tags/lcm@')
73+ working-directory : ./LCM
74+ run : |
75+ for file in *.hex; do
76+ mv "$file" "${file%.hex}_${{ steps.version-info.outputs.version-suffix }}.hex"
77+ done
78+
79+ - name : Create release
80+ if : startsWith(github.ref, 'refs/tags/lcm@')
81+ uses : softprops/action-gh-release@v2
82+ with :
83+ name : " LCM v${{ steps.version-info.outputs.version }}"
84+ files : ./LCM/*.hex
85+ generate_release_notes : true
86+ prerelease : ${{ steps.version-info.outputs.is-prerelease }}
Original file line number Diff line number Diff line change 66uint8_t VESC_RX_Buff [80 ];
77uint8_t VESC_RX_Flag = 0 ;
88
9- #define VERSION "2_2_0"
9+ #ifndef VERSION
10+ #define VERSION "0_0_0"
11+ #endif
1012#define FIRMWARE_ID FIRMWARE_ID_PREFIX "_" VERSION
1113
1214// Access ADC values here to determine riding state
You can’t perform that action at this time.
0 commit comments