Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build] Fix buildscripts for v4 Actions upload-artifact, download-artifact and delete-artifact #4919

Merged
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0271703
[Build] Fix buildscripts for v4 Actions `upload-artifact`, `download-…
tonhuisman Dec 25, 2023
c20079f
[Build] GH Actions v4 use unique upload-id
tonhuisman Dec 25, 2023
4748caa
[Build] GH Actions use setup-python v5, improved glob for delete-arti…
tonhuisman Dec 25, 2023
dfa4904
[Build] GH Actions v4 try fix artifact download permissions issue
tonhuisman Dec 25, 2023
fd3cc53
Merge branch 'mega' of https://github.com/letscontrolit/ESPEasy into …
tonhuisman Dec 25, 2023
d8e2391
[Build] GH Actions v4 Sort builds by ESP, remove repackage step
tonhuisman Dec 26, 2023
dfd5f0f
[Build] GH Actions v4 Fix build names vs dependencies, add all-binari…
tonhuisman Dec 26, 2023
839dcca
[Build] GH Actions v4 Rename `repackage` job to `combine_package`
tonhuisman Dec 26, 2023
0aa66da
[Build] GH Actions v4 Apply also to `release.yml`, add ESP32-C2 and E…
tonhuisman Dec 26, 2023
ac6bd25
Merge branch 'mega' of https://github.com/letscontrolit/ESPEasy into …
tonhuisman Dec 28, 2023
14294a7
[Build] Combine_package use separate downloads to reduce chance of fa…
tonhuisman Dec 28, 2023
8a25de7
[Build] Combine_package use wretry.action to try and succeed the down…
tonhuisman Dec 28, 2023
85f0128
Merge branch 'mega' of https://github.com/letscontrolit/ESPEasy into …
tonhuisman Dec 28, 2023
6c482af
Merge branch 'mega' of https://github.com/letscontrolit/ESPEasy into …
tonhuisman Dec 29, 2023
079d0cc
[Build/Release] Fix some issues, apply workarounds where needed
tonhuisman Dec 29, 2023
61814e3
[Docs] Update copyright year to 2024
tonhuisman Jan 2, 2024
353e8fc
Merge branch 'mega' of https://github.com/letscontrolit/ESPEasy into …
tonhuisman Jan 3, 2024
053fc9e
Merge branch 'mega' of https://github.com/letscontrolit/ESPEasy into …
tonhuisman Jan 3, 2024
4f45c0c
Merge branch 'mega' into feature/GH-up-download-delete-actions-fix
tonhuisman Jan 17, 2024
cdf20e4
Merge branch 'feature/GH-up-download-delete-actions-fix' of https://g…
tonhuisman Jan 25, 2024
fc61a48
Merge branch 'mega' of https://github.com/letscontrolit/ESPEasy into …
tonhuisman Jan 25, 2024
b77b9c4
[Build/Release] Update actions/cache to v4
tonhuisman Jan 25, 2024
c7608cf
[Build/Release] Remove Wdalen/retry.action plugin for Node 20 compati…
tonhuisman Jan 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 37 additions & 95 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- uses: actions/cache@v3
Expand All @@ -39,7 +39,7 @@ jobs:
make html
cd ..
zip -r -qq ESPEasy_docs.zip docs/build/*
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: Documentation
path: ESPEasy_docs.zip
Expand All @@ -49,7 +49,7 @@ jobs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- id: set-matrix
Expand All @@ -64,9 +64,9 @@ jobs:
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.x'
- uses: actions/cache@v3
with:
path: ~/.cache/pip
Expand All @@ -89,27 +89,36 @@ jobs:
pip install wheel
pip install -r requirements.txt
platformio update
- name: Get current date
id: date
run: |
echo "builddate=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
- name: Build and archive
id: build-and-archive
env:
CHIP: ${{ matrix.chip }}
ENV: ${{ matrix.env }}
run: |
python tools/ci/build-and-archive.py
- uses: actions/upload-artifact@v3
- id: string
uses: Entepotenz/change-string-case-action-min-dependencies@v1
with:
string: ${{ matrix.chip }}
- uses: actions/upload-artifact@v4
with:
name: Binaries
# FIXME Workaround to (temporarily) not use # in the artifact name, see https://github.com/actions/upload-artifact/issues/473
name: Bin-${{ steps.string.outputs.uppercase }}-${{ matrix.env }}-${{ steps.date.outputs.builddate }}_PR_${{ github.event.number }}_${{ github.run_id }} # Sort by ESP type
path: |
bin
if-no-files-found: ignore

# Repackage separately for ESP82xx and ESP32
repackage:
# Package all ESP82xx and ESP32 into a single ESPEasy-all-Binaries-<date>_PR#<pr_nr>_<runnr>.zip
combine_package:
needs: build
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- uses: actions/cache@v3
Expand All @@ -120,92 +129,25 @@ jobs:
id: date
run: |
echo "builddate=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
- uses: actions/download-artifact@v3
with:
path: artifacts/
- name: Prepare artifacts
# FIXME: Workaround for https://github.com/actions/download-artifact/issues/249
- name: Download all artifacts with retry
uses: Wandalen/wretry.action@master
with:
action: actions/download-artifact@v4
with: |
path: artifacts/Binaries/bin/
pattern: Bin-*
merge-multiple: true
attempt_limit: 5
attempt_delay: 2000
- name: List all files in the package for single-archive upload
run: |
# ESP82xx
mkdir ESPEasy_dist_ESP82xx
cd dist
find . -exec cp -r --parents {} ../ESPEasy_dist_ESP82xx/ \;
rm ../ESPEasy_dist_ESP82xx/bin/blank_8MB.bin
cd ../artifacts/Binaries
find . -not -name '*ESP32*' -exec mv {} ../../ESPEasy_dist_ESP82xx/bin/ \;
cd ../..
# ESP32 and derived cpus, ESP32 (classic) _MUST_ be last in this list!
for cpu in ESP32s2 ESP32c3 ESP32s3 ESP32c2 ESP32c6 ESP32h2 ESP32solo1 ESP32
do
mkdir ESPEasy_dist_${cpu}
spec="*${cpu}*"
_files=$(find ./artifacts/Binaries -name "$spec"|wc -l)
if [[ $_files > 0 ]]; then
cd dist
find . -exec cp -r --parents {} ../ESPEasy_dist_${cpu}/ \;
cd ../ESPEasy_dist_${cpu}
rm bin/blank_1MB.bin bin/blank_2MB.bin bin/ESPEasy_2step_UploaderMega_1024.bin
cd ../artifacts/Binaries
find . -name "$spec" -exec mv {} ../../ESPEasy_dist_${cpu}/bin/ \;
cd ../..
fi
done
# Each supported cpu has to be listed separately, but empty folders are ignored
- uses: actions/upload-artifact@v3
with:
name: ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32_PR#${{ github.event.number }}_${{ github.run_id }}
path: |
ESPEasy_dist_ESP32/*
if-no-files-found: ignore
- uses: actions/upload-artifact@v3
with:
name: ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32solo1_PR#${{ github.event.number }}_${{ github.run_id }}
path: |
ESPEasy_dist_ESP32solo1/*
if-no-files-found: ignore
- uses: actions/upload-artifact@v3
with:
name: ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32s2_PR#${{ github.event.number }}_${{ github.run_id }}
path: |
ESPEasy_dist_ESP32s2/*
if-no-files-found: ignore
- uses: actions/upload-artifact@v3
cd artifacts/Binaries/
ls -R
- uses: actions/upload-artifact@v4
with:
name: ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32c3_PR#${{ github.event.number }}_${{ github.run_id }}
# FIXME Workaround to (temporarily) not use # in the artifact name, see https://github.com/actions/upload-artifact/issues/473
name: ESPEasy-all-Binaries-${{ steps.date.outputs.builddate }}_PR_${{ github.event.number }}_${{ github.run_id }}
path: |
ESPEasy_dist_ESP32c3/*
artifacts/Binaries/
if-no-files-found: ignore
- uses: actions/upload-artifact@v3
with:
name: ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32s3_PR#${{ github.event.number }}_${{ github.run_id }}
path: |
ESPEasy_dist_ESP32s3/*
if-no-files-found: ignore
- uses: actions/upload-artifact@v3
with:
name: ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32c2_PR#${{ github.event.number }}_${{ github.run_id }}
path: |
ESPEasy_dist_ESP32c2/*
if-no-files-found: ignore
- uses: actions/upload-artifact@v3
with:
name: ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32c6_PR#${{ github.event.number }}_${{ github.run_id }}
path: |
ESPEasy_dist_ESP32c6/*
if-no-files-found: ignore
- uses: actions/upload-artifact@v3
with:
name: ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32h2_PR#${{ github.event.number }}_${{ github.run_id }}
path: |
ESPEasy_dist_ESP32h2/*
if-no-files-found: ignore
- uses: actions/upload-artifact@v3
with:
name: ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP82xx_PR#${{ github.event.number }}_${{ github.run_id }}
path: |
ESPEasy_dist_ESP82xx/*
if-no-files-found: ignore
# When successfully re-packaged, the original Binaries can be removed
# comment below 3 lines to not remove the Binaries artifact after repackaging
- uses: geekyeggo/delete-artifact@v2
with:
name: Binaries
46 changes: 30 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- id: set-matrix
Expand All @@ -37,7 +37,7 @@ jobs:
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- uses: actions/cache@v3
Expand Down Expand Up @@ -66,9 +66,13 @@ jobs:
ENV: ${{ matrix.env }}
run: |
python tools/ci/build-and-archive.py
- uses: actions/upload-artifact@v3
- id: string
uses: Entepotenz/change-string-case-action-min-dependencies@v1
with:
name: Binaries
string: ${{ matrix.chip }}
- uses: actions/upload-artifact@v4
with:
name: Bin-${{ steps.string.outputs.uppercase }}-${{ matrix.env }}
path: |
bin
if-no-files-found: ignore
Expand All @@ -78,7 +82,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- uses: actions/cache@v3
Expand All @@ -98,7 +102,7 @@ jobs:
cd dist
zip -r -qq ../ESPEasy_dist.zip *
cd ..
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: Distribution
path: |
Expand All @@ -112,7 +116,7 @@ jobs:
notes: ${{ steps.release-notes.outputs.result }}
steps:
- id: release-notes
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
result-encoding: string
script: |
Expand All @@ -134,29 +138,37 @@ jobs:
needs: [build, prepare-dist, prepare-notes]
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Get current date
id: date
run: |
echo "builddate=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
- uses: actions/download-artifact@v3
# FIXME: Workaround for https://github.com/actions/download-artifact/issues/249
- name: Download all artifacts with retry
uses: Wandalen/wretry.action@master
with:
path: artifacts/
action: actions/download-artifact@v4
with: |
path: artifacts/Binaries/bin/
pattern: Bin-*
merge-multiple: true
attempt_limit: 5
attempt_delay: 2000
- name: Repackage for release upload
run: |
ls -R
sudo apt install zipmerge zip
cd artifacts/Binaries
mkdir bin
mv *.* bin
find . -not -name '*ESP32*' -print | zip -@ ../../ESPEasy_ESP82xx.zip
# ESP32 and derived chips
# TODO if/when available: ESP32c2 ESP32c6 ESP32h2
# TODO if/when available: ESP32h2
find . -name '*ESP32s2*' -print | zip -@ ../../ESPEasy_ESP32s2.zip
find . -name '*ESP32c3*' -print | zip -@ ../../ESPEasy_ESP32c3.zip
find . -name '*ESP32s3*' -print | zip -@ ../../ESPEasy_ESP32s3.zip
find . -name '*ESP32c2*' -print | zip -@ ../../ESPEasy_ESP32c2.zip
find . -name '*ESP32c6*' -print | zip -@ ../../ESPEasy_ESP32c6.zip
find . -name '*ESP32solo1*' -print | zip -@ ../../ESPEasy_ESP32solo1.zip
find . -name '*ESP32_*' -print | zip -@ ../../ESPEasy_ESP32.zip
cd ../..
Expand All @@ -166,16 +178,18 @@ jobs:
mv ESPEasy_dist.zip ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32_binaries.zip
zip -d ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32_binaries.zip "bin/blank_1MB.bin" "bin/blank_2MB.bin" "bin/ESPEasy_2step_UploaderMega_1024.bin"
zipmerge ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP82xx_binaries.zip ESPEasy_ESP82xx.zip
# TODO if/when available: ESP32c2 ESP32c6 ESP32h2
# TODO if/when available: ESP32h2
zipmerge ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32s2_binaries.zip ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32_binaries.zip ESPEasy_ESP32s2.zip
zipmerge ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32c3_binaries.zip ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32_binaries.zip ESPEasy_ESP32c3.zip
zipmerge ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32s3_binaries.zip ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32_binaries.zip ESPEasy_ESP32s3.zip
zipmerge ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32c2_binaries.zip ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32_binaries.zip ESPEasy_ESP32c2.zip
zipmerge ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32c6_binaries.zip ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32_binaries.zip ESPEasy_ESP32c6.zip
zipmerge ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32solo1_binaries.zip ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32_binaries.zip ESPEasy_ESP32solo1.zip
zipmerge ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32_binaries.zip ESPEasy_ESP32.zip
- uses: ncipollo/release-action@v1
with:
# Include all separately supported CPU models
# TODO if/when available: ESP32c2 ESP32c6 ESP32h2
artifacts: "ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP82xx_binaries.zip,ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32_binaries.zip,ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32solo1_binaries.zip,ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32s2_binaries.zip,ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32c3_binaries.zip,ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32s3_binaries.zip,artifacts/Distribution/*.zip"
# TODO if/when available: ESP32h2
artifacts: "ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP82xx_binaries.zip,ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32_binaries.zip,ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32solo1_binaries.zip,ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32s2_binaries.zip,ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32c3_binaries.zip,ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32s3_binaries.zip,ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32c2_binaries.zip,ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32c6_binaries.zip,artifacts/Distribution/*.zip"
body: ${{ needs.prepare-notes.outputs.notes }}
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# -- Project information -----------------------------------------------------

project = u'ESP Easy'
copyright = u'2018-2023, ESP Easy'
copyright = u'2018-2024, ESP Easy'
author = u'Grovkillen, TD-er & Friends'

# The short X.Y version
Expand Down
13 changes: 11 additions & 2 deletions tools/ci/generate-matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,25 @@

import json
import os
import re
from platformio.project.config import ProjectConfig


def get_jobs(cfg):
regex = re.compile(r".*(ESP[^_]*).*")
for env in cfg.envs():
platform = cfg.get("env:{}".format(env), "platform")
match = regex.match(env)
if type(match) == re.Match:
typ = match.group(1)
if "ESP8285" == typ:
typ = "ESP8266" # Generalize ESP8285 into ESP8266
else:
typ = "ESP8266" # Catch WROOM02 and some other 'hard_' builds
if "espressif8266" in platform:
yield {"chip": "esp8266", "env": env}
yield {"chip": typ.lower(), "env": env}
elif "espressif32" in platform:
yield {"chip": "esp32", "env": env}
yield {"chip": typ.lower(), "env": env}
else:
raise ValueError(
"Unknown `platform = {}` for `[env:{}]`".format(platform, env)
Expand Down