-
Notifications
You must be signed in to change notification settings - Fork 6
111 lines (94 loc) · 3.29 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: "Combined Firmware Workflow"
on:
workflow_dispatch:
push:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: esp-idf build
uses: espressif/esp-idf-ci-action@v1
with:
esp_idf_version: latest
target: esp32s3
path: 'Firmware'
- name: Run Unit Tests
run: |
cd Firmware/components/knot_midi_translator/host_test/
./test.sh
./test.sh >> test.txt
- name: Convert to uf2
run: |
cd Firmware
sudo python3 ./tools/uf2conv.py -f ESP32S3 ./build/midi_host_fw.bin -b 0x0 -c -o ./output/midi_host_fw.uf2
- name: Set env
shell: bash
run: |
echo "ACTION_DATE=$(date +'%Y-%m-%d-%H%M')" >> $GITHUB_ENV
echo "RELEASE_VERSION=$(git tag --contains ${{ github.sha }})" >> $GITHUB_ENV
- name: Copy and rename the artifacts
run: |
ls
cp Firmware/output/midi_host_fw.uf2 knot_esp32_release_${{ env.ACTION_DATE }}.uf2
cp Firmware/output/midi_host_fw.uf2 knot_esp32_nightly_${{ env.ACTION_DATE }}.uf2
cp Firmware/output/midi_host_fw.uf2 knot_esp32_nightly.uf2
- uses: actions/upload-artifact@v4
with:
name: grid-fw nightly
path: |
knot_esp32_nightly_${{ env.ACTION_DATE }}.uf2
knot_esp32_nightly.uf2
- name: Zipping artifacts for Github Release
uses: vimtor/action-zip@v1
if: ${{ env.RELEASE_VERSION != '' }}
with:
files: knot_esp32_release_${{ env.ACTION_DATE }}.uf2
dest: knot_release.zip
- name: Release
uses: softprops/action-gh-release@v1
if: ${{ env.RELEASE_VERSION != '' }}
with:
tag_name: ${{ env.RELEASE_VERSION }}
name: Knot ${{ env.RELEASE_VERSION }} (${{ env.ACTION_DATE }})
files: knot_release.zip
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
deploy-results:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs: build
steps:
- uses: actions/checkout@v2
with:
ref: preview
- name: Download reports' artifacts
uses: actions/download-artifact@v4
with:
path: download
- name: Collecting files
run: |
# Create the temp folder if it doesn't exist
mkdir -p Preview/Firmware
# Loop through each subdirectory in the download folder
for subdirectory in download/*; do
# Check if it is a directory
if [ -d "$subdirectory" ]; then
# Copy the contents of the subdirectory to the temp folder
cp -r "$subdirectory"/* "Preview/Firmware/"
fi
done
- name: Commit the files
run: |
git config --global user.name ${{ github.actor }}
git config --global user.email ${{ github.actor }}@users.noreply.github.com
git add Preview/*
git commit -m "BOT ${{ github.workflow }} ${{ github.sha }}"
git push