forked from NeyagawaRobocons/rppico-encoder-firm
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (61 loc) · 2.07 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: build binary
on:
push:
branches:
- main
permissions:
contents: write
packages: write
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
target: thumbv6m-none-eabi
- run: cargo install flip-link
- name: building
run: cargo build --all --release
- name: install elf2uf2
run: |
sudo apt-get update
sudo apt-get install libudev-dev
cargo install elf2uf2-rs
- name: create uf2 image
run: elf2uf2-rs target/thumbv6m-none-eabi/release/rppico-encoder-firm target/thumbv6m-none-eabi/release/rppico-encoder-firm.uf2
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create release
id: create_release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
- name: Upload release asset
id: upload-release-elf
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/thumbv6m-none-eabi/release/rppico-encoder-firm
asset_name: rppico-encoder-firm.elf
asset_content_type: firmware/binary
- name: Upload release asset
id: upload-release-uf2
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/thumbv6m-none-eabi/release/rppico-encoder-firm.uf2
asset_name: rppico-encoder-firm.uf2
asset_content_type: firmware/binary