mirror of
https://github.com/wled/WLED.git
synced 2025-07-12 21:36:32 +00:00
Merge pull request #3718 from WoodyLetsCode/GitHub-Actions
Update GitHub Actions workflow
This commit is contained in:
commit
590d454119
60
.github/workflows/wled-ci.yml
vendored
60
.github/workflows/wled-ci.yml
vendored
@ -8,17 +8,11 @@ jobs:
|
|||||||
name: Gather Environments
|
name: Gather Environments
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Cache pip
|
- uses: actions/setup-python@v5
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
with:
|
||||||
path: ~/.cache/pip
|
python-version: '3.12'
|
||||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
cache: 'pip'
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pip-
|
|
||||||
- uses: actions/setup-python@v4
|
|
||||||
with:
|
|
||||||
python-version: '3.9'
|
|
||||||
- name: Install PlatformIO
|
- name: Install PlatformIO
|
||||||
run: pip install -r requirements.txt
|
run: pip install -r requirements.txt
|
||||||
- name: Get default environments
|
- name: Get default environments
|
||||||
@ -38,62 +32,52 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
environment: ${{ fromJSON(needs.get_default_envs.outputs.environments) }}
|
environment: ${{ fromJSON(needs.get_default_envs.outputs.environments) }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
- run: npm install
|
- run: npm install
|
||||||
- name: Cache pip
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: ~/.cache/pip
|
|
||||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pip-
|
|
||||||
- name: Cache PlatformIO
|
- name: Cache PlatformIO
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ~/.platformio
|
path: |
|
||||||
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
~/.platformio/.cache
|
||||||
|
~/.buildcache
|
||||||
|
build_output
|
||||||
|
key: pio-${{ runner.os }}-${{ matrix.environment }}-${{ hashFiles('platformio.ini', 'pio-scripts/output_bins.py') }}-${{ hashFiles('wled00/**') }}
|
||||||
|
restore-keys: pio-${{ runner.os }}-${{ matrix.environment }}-${{ hashFiles('platformio.ini', 'pio-scripts/output_bins.py') }}-
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.9'
|
python-version: '3.12'
|
||||||
|
cache: 'pip'
|
||||||
- name: Install PlatformIO
|
- name: Install PlatformIO
|
||||||
run: pip install -r requirements.txt
|
run: pip install -r requirements.txt
|
||||||
- name: Build firmware
|
- name: Build firmware
|
||||||
env:
|
|
||||||
WLED_RELEASE: True
|
|
||||||
run: pio run -e ${{ matrix.environment }}
|
run: pio run -e ${{ matrix.environment }}
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: firmware-${{ matrix.environment }}
|
name: firmware-${{ matrix.environment }}
|
||||||
path: |
|
path: |
|
||||||
build_output/firmware/*.bin
|
build_output/release/*.bin
|
||||||
build_output/firmware/*.gz
|
build_output/release/*_ESP02.bin.gz
|
||||||
- uses: actions/upload-artifact@v2
|
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
|
||||||
with:
|
|
||||||
name: firmware-release
|
|
||||||
path: build_output/release/*.bin
|
|
||||||
release:
|
release:
|
||||||
name: Create Release
|
name: Create Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [get_default_envs, build]
|
needs: build
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v2
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: firmware-release
|
merge-multiple: true
|
||||||
- name: Create draft release
|
- name: Create draft release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
draft: True
|
draft: True
|
||||||
files: |
|
files: |
|
||||||
*.bin
|
*.bin
|
||||||
env:
|
*.bin.gz
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
|
|
||||||
testCdata:
|
testCdata:
|
||||||
|
@ -22,6 +22,16 @@ def _create_dirs(dirs=["firmware", "map"]):
|
|||||||
if not os.path.isdir("{}{}".format(OUTPUT_DIR, d)):
|
if not os.path.isdir("{}{}".format(OUTPUT_DIR, d)):
|
||||||
os.mkdir("{}{}".format(OUTPUT_DIR, d))
|
os.mkdir("{}{}".format(OUTPUT_DIR, d))
|
||||||
|
|
||||||
|
def create_release(source):
|
||||||
|
release_name = _get_cpp_define_value(env, "WLED_RELEASE_NAME")
|
||||||
|
if release_name:
|
||||||
|
_create_dirs(["release"])
|
||||||
|
version = _get_cpp_define_value(env, "WLED_VERSION")
|
||||||
|
# get file extension of source file (.bin or .bin.gz)
|
||||||
|
ext = source.split(".", 1)[1]
|
||||||
|
release_file = "{}release{}WLED_{}_{}.{}".format(OUTPUT_DIR, os.path.sep, version, release_name, ext)
|
||||||
|
shutil.copy(source, release_file)
|
||||||
|
|
||||||
def bin_rename_copy(source, target, env):
|
def bin_rename_copy(source, target, env):
|
||||||
_create_dirs()
|
_create_dirs()
|
||||||
variant = env["PIOENV"]
|
variant = env["PIOENV"]
|
||||||
@ -30,14 +40,6 @@ def bin_rename_copy(source, target, env):
|
|||||||
map_file = "{}map{}{}.map".format(OUTPUT_DIR, os.path.sep, variant)
|
map_file = "{}map{}{}.map".format(OUTPUT_DIR, os.path.sep, variant)
|
||||||
bin_file = "{}firmware{}{}.bin".format(OUTPUT_DIR, os.path.sep, variant)
|
bin_file = "{}firmware{}{}.bin".format(OUTPUT_DIR, os.path.sep, variant)
|
||||||
|
|
||||||
release_name = _get_cpp_define_value(env, "WLED_RELEASE_NAME")
|
|
||||||
|
|
||||||
if release_name:
|
|
||||||
_create_dirs(["release"])
|
|
||||||
version = _get_cpp_define_value(env, "WLED_VERSION")
|
|
||||||
release_file = "{}release{}WLED_{}_{}.bin".format(OUTPUT_DIR, os.path.sep, version, release_name)
|
|
||||||
shutil.copy(str(target[0]), release_file)
|
|
||||||
|
|
||||||
# check if new target files exist and remove if necessary
|
# check if new target files exist and remove if necessary
|
||||||
for f in [map_file, bin_file]:
|
for f in [map_file, bin_file]:
|
||||||
if os.path.isfile(f):
|
if os.path.isfile(f):
|
||||||
@ -46,6 +48,8 @@ def bin_rename_copy(source, target, env):
|
|||||||
# copy firmware.bin to firmware/<variant>.bin
|
# copy firmware.bin to firmware/<variant>.bin
|
||||||
shutil.copy(str(target[0]), bin_file)
|
shutil.copy(str(target[0]), bin_file)
|
||||||
|
|
||||||
|
create_release(bin_file)
|
||||||
|
|
||||||
# copy firmware.map to map/<variant>.map
|
# copy firmware.map to map/<variant>.map
|
||||||
if os.path.isfile("firmware.map"):
|
if os.path.isfile("firmware.map"):
|
||||||
shutil.move("firmware.map", map_file)
|
shutil.move("firmware.map", map_file)
|
||||||
@ -66,4 +70,6 @@ def bin_gzip(source, target, env):
|
|||||||
with gzip.open(gzip_file, "wb", compresslevel = 9) as f:
|
with gzip.open(gzip_file, "wb", compresslevel = 9) as f:
|
||||||
shutil.copyfileobj(fp, f)
|
shutil.copyfileobj(fp, f)
|
||||||
|
|
||||||
|
create_release(gzip_file)
|
||||||
|
|
||||||
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", [bin_rename_copy, bin_gzip])
|
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", [bin_rename_copy, bin_gzip])
|
||||||
|
@ -424,7 +424,7 @@ platform = ${esp32s3.platform}
|
|||||||
platform_packages = ${esp32s3.platform_packages}
|
platform_packages = ${esp32s3.platform_packages}
|
||||||
upload_speed = 921600
|
upload_speed = 921600
|
||||||
build_unflags = ${common.build_unflags}
|
build_unflags = ${common.build_unflags}
|
||||||
build_flags = ${common.build_flags} ${esp32s3.build_flags}
|
build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=ESP32-S3_8MB_PSRAM_opi
|
||||||
-D CONFIG_LITTLEFS_FOR_IDF_3_2 -D WLED_WATCHDOG_TIMEOUT=0
|
-D CONFIG_LITTLEFS_FOR_IDF_3_2 -D WLED_WATCHDOG_TIMEOUT=0
|
||||||
;-D ARDUINO_USB_CDC_ON_BOOT=0 ;; -D ARDUINO_USB_MODE=1 ;; for boards with serial-to-USB chip
|
;-D ARDUINO_USB_CDC_ON_BOOT=0 ;; -D ARDUINO_USB_MODE=1 ;; for boards with serial-to-USB chip
|
||||||
-D ARDUINO_USB_CDC_ON_BOOT=1 -D ARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB")
|
-D ARDUINO_USB_CDC_ON_BOOT=1 -D ARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB")
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#
|
#
|
||||||
# This file is autogenerated by pip-compile with python 3.8
|
# This file is autogenerated by pip-compile with Python 3.12
|
||||||
# To update, run:
|
# by the following command:
|
||||||
#
|
#
|
||||||
# pip-compile
|
# pip-compile
|
||||||
#
|
#
|
||||||
@ -21,7 +21,9 @@ click==8.1.3
|
|||||||
# platformio
|
# platformio
|
||||||
# uvicorn
|
# uvicorn
|
||||||
colorama==0.4.6
|
colorama==0.4.6
|
||||||
# via platformio
|
# via
|
||||||
|
# click
|
||||||
|
# platformio
|
||||||
h11==0.14.0
|
h11==0.14.0
|
||||||
# via
|
# via
|
||||||
# uvicorn
|
# uvicorn
|
||||||
|
Loading…
x
Reference in New Issue
Block a user