forked from BitMaker-hub/ESP-Miner-NerdAxe
-
Notifications
You must be signed in to change notification settings - Fork 5
87 lines (74 loc) · 2.86 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
name: Build and Release ESP32 Firmware
on:
workflow_dispatch: # Manual trigger only
jobs:
build-and-release:
runs-on: ubuntu-latest
strategy:
matrix:
board: [NERDQAXEPLUS, NERDOCTAXEPLUS, NERDQAXEPLUS2]
include:
- board: NERDQAXEPLUS
upload_www: true
label: NerdQAxe+
- board: NERDOCTAXEPLUS
upload_www: false
label: NerdOctaxe+
- board: NERDQAXEPLUS2
upload_www: false
label: NerdQAxe++
- board: NERDAXE
upload_www: false
label: NerdAxe
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Get Version Tag
id: version_tag
run: |
git fetch --tags # Ensure all tags are fetched
version=$(git describe --tags --abbrev=0) || { echo "no tag found!"; exit 1; }
echo "VERSION_TAG=${version}" >> $GITHUB_ENV
echo "VERSION_TAG=${version}"
- name: Set Target
run: |
# Run the Docker container to build the project
docker run --rm --user root -e BOARD=${{ matrix.board }} -v $PWD:/home/builder/project \
shufps/esp-idf-builder:0.0.1 idf.py set-target esp32s3
- name: Compile Binaries
run: |
# Run the Docker container to build the project with BOARD environment variable
docker run --rm --user root -e BOARD=${{ matrix.board }} -v $PWD:/home/builder/project \
shufps/esp-idf-builder:0.0.1 idf.py build
- name: Merge Binaries
run: |
docker run --rm --user root -v $PWD:/home/builder/project \
shufps/esp-idf-builder:0.0.1 esptool.py --chip esp32s3 merge_bin --flash_mode dio --flash_size 16MB --flash_freq 80m \
0x0 build/bootloader/bootloader.bin \
0x8000 build/partition_table/partition-table.bin \
0x10000 build/esp-miner.bin \
0x410000 build/www.bin \
0xf10000 build/ota_data_initial.bin \
-o esp-miner-factory-${{ matrix.label }}-${{ env.VERSION_TAG }}.bin
- name: Rename Build Artifacts
run: |
sudo mv build/esp-miner.bin build/esp-miner-${{ matrix.label }}.bin
- name: Create files list
run: |
echo "esp-miner-factory-${{ matrix.label }}-${{ env.VERSION_TAG }}.bin" > file_list.txt
echo "build/esp-miner-${{ matrix.label }}.bin" >> file_list.txt
if [ "${{ matrix.upload_www }}" == "true" ]; then
echo "build/www.bin" >> file_list.txt
fi
- name: Set files variable
id: set_files_var
run: echo "files=$(cat file_list.txt | tr '\n' ',')" >> $GITHUB_ENV
- name: Upload to Existing Release
if: always()
uses: softprops/action-gh-release@v1
with:
files: ${{ env.files }}
tag_name: ${{ env.VERSION_TAG }}
token: ${{ secrets.GITHUB_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}