Skip to content

Commit 358ea96

Browse files
authored
build and release file
1 parent 12808c8 commit 358ea96

File tree

2 files changed

+54
-24
lines changed

2 files changed

+54
-24
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
on: [push, pull_request]
2+
name: Upload Release
3+
4+
jobs:
5+
build:
6+
name: Build and release
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v1
11+
with:
12+
submodules: true
13+
14+
- name: Add targets
15+
run: |
16+
rustup target add thumbv6m-none-eabi
17+
rustup target add thumbv7m-none-eabihf
18+
19+
- name: Install flip-link
20+
run: cd / && cargo install flip-link
21+
22+
- name: Build neotron-bmc-pico
23+
run: cd neotron-bmc-pico && cargo build --release --verbose --target=thumbv6m-none-eabi
24+
25+
- name: Build neotron-bmc-nucleo
26+
run: cd neotron-bmc-nucleo && cargo build --release --verbose --target=thumbv7m-none-eabihf
27+
28+
- name: Get Branch Name
29+
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/')
30+
id: branch_name
31+
run: |
32+
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
33+
34+
- name: Create Release
35+
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/')
36+
id: create_release
37+
uses: actions/create-release@v1
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
with:
41+
tag_name: ${{ github.ref }}
42+
release_name: Release ${{ steps.branch_name.outputs.SOURCE_TAG }}
43+
draft: false
44+
prerelease: false
45+
46+
- name: Upload files to Release
47+
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/')
48+
uses: softprops/action-gh-release@v1
49+
with:
50+
files: |
51+
neotron-bmc-pico/target/thumbv6m-none-eabi/release/neotron-bmc
52+
neotron-bmc-nucleo/target/thumbv7m-none-eabihf/release/neotron-bmc
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)