-
Notifications
You must be signed in to change notification settings - Fork 101
125 lines (115 loc) · 4.04 KB
/
build-willow.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
---
name: build-willow
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
on:
workflow_call:
inputs:
container-image:
required: true
type: string
jobs:
build-willow-dist:
strategy:
matrix:
device:
- ESP32-S3-BOX
- ESP32-S3-BOX-3
- ESP32-S3-BOX-LITE
runs-on: ubuntu-22.04
container:
image: ${{ inputs.container-image }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
volumes:
- "${{github.workspace}}:/willow"
# https://github.com/actions/runner/issues/878#issuecomment-1248930921
defaults:
run:
working-directory: /willow
env:
dist_filename: "willow-dist-${{ matrix.device }}.bin"
ota_filename: "willow-ota-${{ matrix.device }}.bin"
partitions_filename: "willow-partitions-${{ matrix.device }}"
steps:
- name: checkout
uses: actions/checkout@v3
- name: debug
run: echo ${{ inputs.container-tag }}
- name: ls -al
run: ls -al
- name: ls -al /
run: ls -al /
# fatal: detected dubious ownership in repository at '/willow'
- name: id
run: id
# ./utils.sh: line 193: idf.py: command not found
# - name: . $IDF_PATH/export.sh
# run: . "$IDF_PATH/export.sh"
# need to run it in the same step as utils.sh bloody hell
- name: env
run: env
- name: pwd
run: pwd
- name: add /willow to git safe directories
run: git config --global --add safe.directory /willow
# need to run with bash to avoid this error:
# /opt/esp/idf/export.sh: [[: not found
- name: ./utils.sh setup
run: ( . "$IDF_PATH/export.sh"; ./utils.sh setup )
shell: bash
- name: append device type to sdkconfig
run: echo "CONFIG_${{ matrix.device }}_BOARD=y" | sed 's/-/_/g' >> sdkconfig
- name: ./utils.sh build
run: ( . "$IDF_PATH/export.sh"; ./utils.sh build )
shell: bash
- name: ./utils.sh dist
run: ( . "$IDF_PATH/export.sh"; ./utils.sh dist )
shell: bash
- name: copy willow.bin to ota_filename
run: cp /willow/build/willow.bin "/willow/build/${{ env.ota_filename }}"
- name: calculate sha256sum for willow.bin
run: cd /willow/build &&sha256sum "${{ env.ota_filename }}" > "${{ env.ota_filename }}.sha256sum.txt"
- name: calculate sha256sum for willow-dist.bin
run: cd /willow/build && sha256sum "${{ env.dist_filename }}" > "${{ env.dist_filename }}.sha256sum.txt"
- name: upload willow-dist.bin artifacts
uses: actions/upload-artifact@v4
with:
name: "${{ env.dist_filename }}"
path: "/willow/build/${{ env.dist_filename }}*"
- name: upload willow-ota.bin artifacts
uses: actions/upload-artifact@v4
with:
name: "${{ env.ota_filename }}"
path: "/willow/build/${{ env.ota_filename }}*"
- name: upload build artifacts
uses: actions/upload-artifact@v4
with:
name: "${{ env.partitions_filename }}"
path: |
/willow/build/*.bin
/willow/build/srmodels/srmodels.bin
/willow/partitions_willow.csv
/willow/sdkconfig
!/willow/build/${{ env.dist_filename }}
publish-release:
if: github.ref_type == 'tag'
runs-on: ubuntu-22.04
needs: build-willow-dist
steps:
- name: download artifacts
uses: actions/download-artifact@v4
- name: pwd
run: pwd
- name: find -ls
run: find -ls
- name: create sha256sums.txt
run: find -type f -name '*.sha256sum.txt' -exec cat {} + | sort -u > sha256sums.txt
- name: create release
uses: ncipollo/release-action@v1
with:
allowUpdates: false
artifacts: "sha256sums.txt,willow-dist-*/willow-dist-*.bin,willow-ota-*/willow-ota-*.bin"
prerelease: ${{ contains(github.ref, 'delete') || contains(github.ref, 'pre') || contains(github.ref, 'rc') }}