1+ name : Build
2+
3+ on : [push, pull_request]
4+
5+ env :
6+ CARGO_TERM_COLOR : always
7+
8+ jobs :
9+ build :
10+ runs-on : ubuntu-latest
11+ continue-on-error : ${{ matrix.experimental || false }}
12+ strategy :
13+ matrix :
14+ # All code should be running on stable now
15+ rust : [nightly, stable]
16+ include :
17+ # Nightly is only for reference and allowed to fail
18+ - rust : nightly
19+ experimental : true
20+ steps :
21+ - name : Checkout Code
22+ uses : actions/checkout@v3
23+ with :
24+ submodules : true
25+
26+ - name : Install Rust
27+ uses : actions-rs/toolchain@v1
28+ with :
29+ profile : minimal
30+ toolchain : ${{ matrix.rust }}
31+ override : true
32+ target : thumbv6m-none-eabi
33+
34+ - name : Build Code
35+ run : cargo build --release --verbose
36+
37+ - name : Get Branch Name
38+ if : github.event_name == 'push' && startswith(github.ref, 'refs/tags/')
39+ id : branch_name
40+ run : |
41+ echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
42+
43+ - name : Create Release
44+ if : github.event_name == 'push' && startswith(github.ref, 'refs/tags/')
45+ id : create_release
46+ uses : actions/create-release@v1
47+ env :
48+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
49+ with :
50+ tag_name : ${{ github.ref }}
51+ release_name : Release ${{ steps.branch_name.outputs.SOURCE_TAG }}
52+ draft : false
53+ prerelease : false
54+
55+ - name : Upload files to Release
56+ if : github.event_name == 'push' && startswith(github.ref, 'refs/tags/')
57+ uses : softprops/action-gh-release@v1
58+ with :
59+ files : |
60+ target/thumbv6m-none-eabi/release/neotron-pico
61+ env :
62+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments