-
Notifications
You must be signed in to change notification settings - Fork 29
136 lines (133 loc) · 5.38 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
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
126
127
128
129
130
131
132
133
134
135
136
name: Build Micropython
on:
pull_request:
workflow_dispatch:
push:
tags:
- "v*"
env:
TARGET: esp32s3
IDF_TARGET: esp32s3
jobs:
Build-Firmware:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential python3-pip python3-pillow libusb-1.0-0-dev cmake
- name: Check out driver code
uses: actions/checkout@v4
with:
submodules: true
- name: Check out ESP IDF
uses: actions/checkout@v4
with:
repository: espressif/esp-idf
ref: v5.2.1
path: esp-idf
submodules: true
- name: Submodules
run: |
cd micropython/lib
git submodule init
git submodule update micropython-lib
- name: Install SDK
run: |
cd esp-idf
./install.sh
source export.sh
python3 -m pip install pillow
- name: Patch submodule dependencies
run: |
./scripts/firstTime.sh
- name: Build cross compiler
run: |
source esp-idf/export.sh
cd micropython
make -C mpy-cross
- name: Link board definition
run: |
source esp-idf/export.sh
cd micropython/ports/esp32/boards
ln -sfn ../../../../tildagon ./tildagon
- name: Build firmware
run: |
source esp-idf/export.sh
ln -sfn $GITHUB_WORKSPACE/tildagon micropython/ports/esp32/boards/tildagon
cd micropython/ports/esp32
make submodules BOARD=tildagon USER_C_MODULES=$GITHUB_WORKSPACE/drivers/micropython.cmake TARGET=esp32s3
make BOARD=tildagon USER_C_MODULES=$GITHUB_WORKSPACE/drivers/micropython.cmake $@ TARGET=esp32s3
cd ../../..
echo "{\"build\":\"$(git describe --tags --always)\", \"name\":\"$(git describe --tags --always)\"}" > micropython/ports/esp32/build-tildagon/tildagon.txt
- name: Archive firmware
uses: actions/upload-artifact@v4
with:
name: firmware
path: |
micropython/ports/esp32/build-tildagon/micropython.bin
micropython/ports/esp32/build-tildagon/bootloader/bootloader.bin
micropython/ports/esp32/build-tildagon/partition_table/partition-table.bin
micropython/ports/esp32/build-tildagon/ota_data_initial.bin
micropython/ports/esp32/build-tildagon/tildagon.txt
- name: Create latest release for tags
uses: "marvinpinto/action-automatic-releases@latest"
if: ${{startsWith(github.event.ref, 'refs/tags/v') && !contains(github.event.ref, '-') }}
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
title: "Latest release build"
prerelease: false
files: |
micropython/ports/esp32/build-tildagon/micropython.bin
micropython/ports/esp32/build-tildagon/tildagon.txt
- name: Create specific release for tags
uses: "marvinpinto/action-automatic-releases@latest"
if: ${{startsWith(github.event.ref, 'refs/tags/v')}}
with:
prerelease: ${{ contains(github.event.ref, '-') }}
repo_token: "${{ secrets.GITHUB_TOKEN }}"
files: |
micropython/ports/esp32/build-tildagon/micropython.bin
micropython/ports/esp32/build-tildagon/tildagon.txt
- name: Create preview release for rc tags
uses: "marvinpinto/action-automatic-releases@latest"
if: ${{startsWith(github.event.ref, 'refs/tags/v') && contains(github.event.ref, '-') }}
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "preview"
prerelease: true
title: "Latest preview build"
files: |
micropython/ports/esp32/build-tildagon/micropython.bin
micropython/ports/esp32/build-tildagon/tildagon.txt
- name: Build merged image
run: |
source esp-idf/export.sh
cd micropython/ports/esp32
python -m esptool --chip esp32s3 -b 460800 merge_bin -o merged-firmware.bin --flash_mode dio --flash_size 8MB --flash_freq 80m 0x0 build-tildagon/bootloader/bootloader.bin 0x8000 build-tildagon/partition_table/partition-table.bin 0xd000 build-tildagon/ota_data_initial.bin 0x10000 build-tildagon/micropython.bin
cp merged-firmware.bin $GITHUB_WORKSPACE/flasher/
if: startsWith(github.event.ref, 'refs/tags/v')
- name: Deploy to GitHub Pages
id: deployment
uses: actions/upload-pages-artifact@v3 # or specific "vX.X.X" version tag for this action
with:
path: ./flasher
if: ${{startsWith(github.event.ref, 'refs/tags/v') && !contains(github.event.ref, '-') }}
deploy:
if: startsWith(github.event.ref, 'refs/tags/v')
needs: Build-Firmware
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action