-
Notifications
You must be signed in to change notification settings - Fork 32
59 lines (50 loc) · 1.57 KB
/
firmware_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
name: Build BlueSCSI firmware
on:
push:
workflow_dispatch:
jobs:
build_firmware:
name: Build firmware on Ubuntu 20.04
runs-on: ubuntu-20.04
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3
with:
path: BlueSCSI
fetch-depth: "0"
- name: Install platformio
run: |
sudo pip install platformio
- name: Build firmware
run: |
cd BlueSCSI
pio run -v
- name: Rename firmware files
run: |
cd BlueSCSI
utils/rename_binaries.sh
- name: Upload binaries into build artifacts
uses: actions/upload-artifact@v3
with:
path: BlueSCSI/distrib/*
name: BlueSCSI binaries
- name: Upload to latest release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: github.ref == 'refs/heads/main'
run: |
cd BlueSCSI
git tag -d latest
git tag latest
git push origin --force latest
cd distrib
gh api repos/${GITHUB_REPOSITORY}/releases/tags/latest | jq -r '.assets[] | [.url] | @tsv' | xargs -n 1 gh api -X DELETE || true
gh release upload --repo ${GITHUB_REPOSITORY} --clobber latest *
- name: Upload to newly created release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
cd BlueSCSI/distrib
RELEASE=$(basename ${{github.ref}})
gh release upload --repo ${GITHUB_REPOSITORY} $RELEASE *