mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-07-27 19:57:38 +00:00
186 lines
8.1 KiB
YAML
186 lines
8.1 KiB
YAML
# NOTICE the generate-matrix and build are c/p from the build workflow
|
|
# NOTICE manual deletion following a re-created tag and push will also trigger this
|
|
#
|
|
# Checks whether the pushed commit is buildable and creates a release with the provided tag. Only triggered on mega-* tag push
|
|
# Documentation and distribution files (tools, readme, etc.) are uploaded as .zip files prepared similarly to the build_ESPEasy.sh
|
|
# Every .bin build artifact is merged in a single .zip file, which is then uploaded as a single release asset
|
|
|
|
name: Release
|
|
|
|
on:
|
|
push:
|
|
branches-ignore: ['**']
|
|
tags: ['mega-*']
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
generate-matrix:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/setup-python@v6
|
|
with:
|
|
python-version: '3.13'
|
|
- id: set-matrix
|
|
run: |
|
|
pip install uv
|
|
uv pip install --system platformio
|
|
python tools/ci/generate-matrix.py
|
|
|
|
build:
|
|
needs: generate-matrix
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/setup-python@v6
|
|
with:
|
|
python-version: '3.13'
|
|
- name: Dependencies
|
|
run: |
|
|
sudo apt install binutils build-essential libffi-dev libgit2-dev
|
|
pip install uv
|
|
uv pip install --system -r requirements.txt
|
|
pio pkg update -e ${{ matrix.env }}
|
|
- name: Build and archive
|
|
id: build-and-archive
|
|
env:
|
|
CHIP: ${{ matrix.chip }}
|
|
ENV: ${{ matrix.env }}
|
|
run: |
|
|
python tools/ci/build-and-archive.py
|
|
- id: string
|
|
uses: Entepotenz/change-string-case-action-min-dependencies@v1
|
|
with:
|
|
string: ${{ matrix.chip }}
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: Bin-${{ steps.string.outputs.uppercase }}-${{ matrix.env }}
|
|
path: |
|
|
bin
|
|
if-no-files-found: ignore
|
|
|
|
prepare-dist:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/setup-python@v6
|
|
with:
|
|
python-version: '3.13'
|
|
- name: Build documentation
|
|
run: |
|
|
cd docs
|
|
sudo apt install imagemagick zip
|
|
pip install uv
|
|
uv pip install --system -r requirements.txt
|
|
make html
|
|
cd ..
|
|
zip -r -qq ESPEasy_docs.zip docs/build/*
|
|
- name: Package utilities
|
|
run: |
|
|
cd dist
|
|
zip -r -qq ../ESPEasy_dist.zip *
|
|
cd ..
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: Distribution
|
|
path: |
|
|
ESPEasy_docs.zip
|
|
ESPEasy_dist.zip
|
|
|
|
prepare-notes:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
notes: ${{ steps.release-notes.outputs.result }}
|
|
steps:
|
|
- id: release-notes
|
|
uses: actions/github-script@v8
|
|
with:
|
|
result-encoding: string
|
|
script: |
|
|
const tagRefObj = await github.rest.git.getRef({
|
|
...context.repo,
|
|
ref: context.ref.replace('refs/', '')
|
|
});
|
|
|
|
const tagObj = await github.rest.git.getTag({
|
|
...context.repo,
|
|
tag_sha: tagRefObj.data.object.sha
|
|
});
|
|
|
|
return tagObj.data.message;
|
|
|
|
release:
|
|
permissions:
|
|
contents: write # for ncipollo/release-action
|
|
needs: [build, prepare-dist, prepare-notes]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/setup-python@v6
|
|
with:
|
|
python-version: '3.13'
|
|
- name: Get current date
|
|
id: date
|
|
run: |
|
|
echo "builddate=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
|
|
- name: Download all successfully compiled artifacts
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
path: artifacts/bin/
|
|
pattern: Bin-*
|
|
merge-multiple: true
|
|
- name: Download dist and docs zip files
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
path: distribution/
|
|
name: Distribution
|
|
- name: Repackage for release upload
|
|
run: |
|
|
ls -R
|
|
sudo apt install zipmerge zip
|
|
cd artifacts
|
|
# ESP8266 and ESP8285
|
|
find . -not -name '*ESP32*' -print | zip -@ ../ESPEasy_ESP82xx.zip
|
|
# ESP32 and derived chips
|
|
# 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 '*ESP32c5*' -print | zip -@ ../ESPEasy_ESP32c5.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 ..
|
|
# Add dist tools to each package, after removing some unneeded files
|
|
# Copy dist zip for ESP82xx use
|
|
cp distribution/ESPEasy_dist.zip ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP82xx_binaries.zip
|
|
zip -d ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP82xx_binaries.zip "bin/blank_8MB.bin"
|
|
# Move dist zip for ESP32 use
|
|
mv distribution/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: 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 }}_ESP32c5_binaries.zip ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32_binaries.zip ESPEasy_ESP32c5.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:
|
|
# Upload all separately supported CPU models and the docs 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 }}_ESP32c5_binaries.zip,ESPEasy_mega_${{ steps.date.outputs.builddate }}_ESP32c6_binaries.zip,distribution/*.zip"
|
|
body: ${{ needs.prepare-notes.outputs.notes }}
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|