File tree Expand file tree Collapse file tree 2 files changed +13
-20
lines changed
Expand file tree Collapse file tree 2 files changed +13
-20
lines changed Original file line number Diff line number Diff line change 11on : [push, pull_request]
22name : Build (and Release)
33
4+ env :
5+ CARGO_TERM_COLOR : always
6+
47jobs :
58 build :
69 name : Build (and Release)
710 runs-on : ubuntu-latest
811 steps :
912 - name : Checkout
10- uses : actions/checkout@v1
13+ uses : actions/checkout@v3
1114 with :
1215 submodules : true
16+ fetch-depth : 0
1317
1418 - name : Add targets
1519 run : |
2832 - name : Build neotron-bmc-nucleo
2933 run : cd neotron-bmc-nucleo && DEFMT_LOG=info cargo build --release --verbose --target=thumbv7em-none-eabihf
3034
31- - name : Get Branch Name
32- if : github.event_name == 'push' && startswith(github.ref, 'refs/tags/')
33- id : branch_name
34- run : |
35- echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
36-
37- - name : Create Release
38- if : github.event_name == 'push' && startswith(github.ref, 'refs/tags/')
39- id : create_release
40- uses : actions/create-release@v1
41- env :
42- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
43- with :
44- tag_name : ${{ github.ref }}
45- release_name : Release ${{ steps.branch_name.outputs.SOURCE_TAG }}
46- draft : false
47- prerelease : false
48-
4935 - name : Upload files to Release
5036 if : github.event_name == 'push' && startswith(github.ref, 'refs/tags/')
5137 uses : softprops/action-gh-release@v1
Original file line number Diff line number Diff line change @@ -19,9 +19,15 @@ fn main() {
1919 // Generate a file containing the firmware version
2020 let version_output = std:: process:: Command :: new ( "git" )
2121 . current_dir ( env:: var_os ( "CARGO_MANIFEST_DIR" ) . unwrap ( ) )
22- . args ( [ "describe" , "--long " , "--dirty" ] )
22+ . args ( [ "describe" , "--tags " , "--dirty" ] )
2323 . output ( )
2424 . expect ( "running git-describe" ) ;
25+
26+ println ! (
27+ "Version is {:?}" ,
28+ std:: str :: from_utf8( & version_output. stdout)
29+ ) ;
30+ println ! ( "Error is {:?}" , std:: str :: from_utf8( & version_output. stderr) ) ;
2531 assert ! ( version_output. status. success( ) ) ;
2632
2733 // Remove the trailing newline
@@ -32,6 +38,7 @@ fn main() {
3238 panic ! ( "Version too long!" ) ;
3339 }
3440
41+ // Pad it
3542 while output. len ( ) < 32 {
3643 output. push ( 0 ) ;
3744 }
You can’t perform that action at this time.
0 commit comments