-
Notifications
You must be signed in to change notification settings - Fork 5
106 lines (95 loc) · 3.28 KB
/
package_main.yml
File metadata and controls
106 lines (95 loc) · 3.28 KB
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
name: Build and Package Main
on:
push:
branches: [main]
release:
types: [published]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
continue-on-error: false
outputs:
zipfile-id: ${{ steps.zip_step.outputs.artifact-id }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build Main Code
uses: espressif/esp-idf-ci-action@v1
with:
esp_idf_version: release-v5.5
path: '.'
command: 'idf.py build'
# TODO: set the target here to be the chip you are building for
# target: esp32s3
- name: Upload Build Outputs
uses: actions/upload-artifact@v4
id: zip_step
# TODO: add / remove files below. You may want to include for example
# littlefs-flash_args if you have a littlefs filesystem image you want to
# include
with:
name: build-artifacts
path: |
build/*.bin
build/*.elf
build/bootloader/bootloader.bin
build/partition_table/partition-table.bin
build/flasher_args.json
build/flash_args
- name: Attach files to release
uses: softprops/action-gh-release@v2
if: ${{ github.event.release && github.event.action == 'published' }}
# TODO: add / remove files below. You may want to include for example
# littlefs-flash_args if you have a littlefs filesystem image you want to
# include
with:
files: |
build/*.bin
build/*.elf
build/bootloader/bootloader.bin
build/partition_table/partition-table.bin
build/flasher_args.json
build/flash_args
- name: Determine base ref
if: ${{ github.event.release && github.event.action == 'published' }}
id: base
shell: bash
run: |
set -euo pipefail
COMPARE_TAG_INPUT="${{ github.event.inputs.compare_tag || '' }}"
if [ -n "$COMPARE_TAG_INPUT" ]; then
echo "ref=$COMPARE_TAG_INPUT" >> "$GITHUB_OUTPUT"
else
# use the previous tag chronologically
prev=$(git tag --sort=-creatordate | sed -n '2p')
if [ -z "$prev" ]; then prev=$(git tag --sort=-v:refname | sed -n '2p'); fi
echo "ref=$prev" >> "$GITHUB_OUTPUT"
fi
- name: Determine Size Delta
if: ${{ github.event.release && github.event.action == 'published' }}
uses: esp-cpp/esp-idf-size-delta@main
with:
app_name: ${{ env.APP_NAME }}
app_path: "."
idf_target: ${{ env.IDF_TARGET }}
idf_version: ${{ env.IDF_VERSION }}
idf_component_manager: ${{ env.IDF_COMPONENT_MANAGER }}
base_ref: ${{ steps.base.outputs.ref }}
flash_total_override: ${{ env.FLASH_TOTAL_OVERRIDE }}
post_comment: 'false'
package:
name: Package the binaries into an executables for Windows, MacOS, and Linux (Ubuntu)
needs: build
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: esp-cpp/[email protected]
with:
zipfile-id: ${{ needs.build.outputs.zipfile-id }}
# TODO: update programmer name to be what you want to call it
programmer-name: 'your_programmer'