Files
nuki_hub/.github/workflows/release.yml
iranl 9a896a7ab1 Remove old and modified libs, switch to ESPAsyncWebserver, add support for ESP32-H2 and multiple Ethernet modules (#455)
* Asyncwebserver

* Squashed commit of the following:

commit 575ef02f593918ec6654c87407a4d11fc17071b8
Author: technyon <j.o.schuemann@gmx.de>
Date:   Mon Aug 12 17:56:11 2024 +0200

    merge master

commit 35e5adf4ecd80f9829e8801181f35dd2c1d94759
Merge: a2cc7be2 21adca01
Author: technyon <j.o.schuemann@gmx.de>
Date:   Mon Aug 12 17:41:04 2024 +0200

    Merge branch 'master' of github.com:technyon/nuki_hub into DM9051

commit a2cc7be2954cbd8767ab8186296c0b14134d1d0b
Author: technyon <j.o.schuemann@gmx.de>
Date:   Mon Aug 12 10:51:50 2024 +0200

    update nuki ble

commit 20c809f3dca28b29b219d1ff3a183f1981316de5
Author: technyon <j.o.schuemann@gmx.de>
Date:   Mon Aug 12 10:44:46 2024 +0200

    backup

commit dd41c218efb5270f5efeb734e64dff695920db16
Merge: 153000b5 e84b944a
Author: technyon <j.o.schuemann@gmx.de>
Date:   Mon Aug 12 10:40:03 2024 +0200

    Merge branch 'master' of github.com:technyon/nuki_hub into DM9051

commit 153000b5b1af7df1fbeb5263df94eb26f689cc0a
Author: technyon <j.o.schuemann@gmx.de>
Date:   Mon Aug 12 10:23:07 2024 +0200

    fix linker error

commit a93bbfbfc4301e46ff3696a763dd13c6c89efefb
Author: technyon <j.o.schuemann@gmx.de>
Date:   Sun Aug 11 11:27:07 2024 +0200

    backup

commit f611c75ce8c35f829bcad6cf7e86188f4b3ec331
Merge: f1964917 063fbab6
Author: technyon <j.o.schuemann@gmx.de>
Date:   Sun Aug 11 11:24:47 2024 +0200

    merge master

commit f1964917b4dade3920f1ecdb699c58630199e6da
Author: technyon <j.o.schuemann@gmx.de>
Date:   Sat Aug 10 15:17:45 2024 +0200

    update platformio.ini

commit f448e5e8a7e93be38e09e2ab0b622199a3721af6
Author: technyon <j.o.schuemann@gmx.de>
Date:   Sat Aug 10 11:28:09 2024 +0200

    add SPIClass instance for DM9051

commit 1f190e9aa08033535a2eb442a92e6e20409bbda1
Author: technyon <j.o.schuemann@gmx.de>
Date:   Sat Aug 10 11:22:26 2024 +0200

    add definitions and constructor for DM9051

commit 726b3602ae91594ee1210ad5b6714f75cc5e42a7
Merge: 50a2eb13 4af90cbc
Author: technyon <j.o.schuemann@gmx.de>
Date:   Sat Aug 10 10:19:34 2024 +0200

    merge master

commit 50a2eb136d75d90921f1c6974f18bc107bddc123
Author: technyon <j.o.schuemann@gmx.de>
Date:   Fri Aug 9 11:52:09 2024 +0200

    add comment

commit 9437e485cae169efdf8e5a7bf188a1c7e792d1e5
Author: technyon <j.o.schuemann@gmx.de>
Date:   Sun Aug 4 08:29:21 2024 +0200

    move LAN8720 definitions to seperate file

* Remove Core 2 Ethernet library

* Custom Ethernet

* GPIO and Preferences

* H2
2024-08-16 18:02:37 +07:00

213 lines
6.9 KiB
YAML

name: NukiHub Release
on:
workflow_dispatch:
permissions:
contents: write
jobs:
build:
name: Build ${{ matrix.board }} (${{ matrix.build }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
board: [esp32, esp32-s3, esp32-c3, esp32-c6, esp32-h2, esp32-solo1]
build: [release, debug]
env:
BOARD: ${{ matrix.board }}
VARIANT: ${{ matrix.name || matrix.board }}
BUILD: ${{ matrix.build }}
steps:
- name: Fix variant name
run: |
# remove dash character
export VARIANT=${VARIANT//-/}
echo "VARIANT=${VARIANT}" | tee -a ${GITHUB_ENV}
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.platformio/.cache
~/.platformio/packages
key: ${{ runner.os }}-pio-${{ matrix.board }}
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install dependencies
run: make deps
- name: Add version info
env:
Version: ${{ github.run_id }}.${{ github.run_number }}.${{ github.run_attempt }}
run: |
sed -i "s/unknownbuildnr/$Version/g" src/Config.h
- name: Build ${{ matrix.build }} PlatformIO Project ${{ matrix.board }}
run: |
ORIGBOARD="${BOARD}"
if [ "$BUILD" = "debug" ]; then
BOARD="${BOARD}_dbg"
fi
echo "::group::Building with PlatformIO"
make updater_${ORIGBOARD}
make $BOARD
echo "::endgroup::"
- name: Add flash script
env:
DOC: resources/how-to-flash.txt
FILES: ${{ format('{0}/{1}', env.BUILD, env.VARIANT) }}
run: |
BOARD=`echo $BOARD | tr '[:lower:]' '[:upper:]'`
# fix for docs
if [ "$BOARD" = "ESP32DEV" ]; then
BOARD="ESP32"
fi
# look for documentation on flash and copy the command
command=`sed -n '/^Howto flash (esptool)$/,$p' ${DOC} | sed -n '/^## '"${BOARD}"'$/,\${ n; n; p; }' | head -n1`
if [ -z "$command" ]; then
echo "::error::Command not found in document ${DOC} for board ${BOARD}"
exit 1
fi
echo -n "Command: "
echo "$command" | tee ${FILES}/flash.sh
chmod a+x ${FILES}/flash.sh
- name: Upload Artifact ${{ matrix.board }}-${{ matrix.build }}
uses: actions/upload-artifact@v4
with:
name: ${{ format('{0}-{1}-assets', env.VARIANT, matrix.build) }}
path: ${{ matrix.build }}/${{ env.VARIANT }}
release:
name: Release new version
needs: build
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v4
with:
ref: binary
- name: Git Checkout master
uses: actions/checkout@v4
with:
ref: master
path: master
sparse-checkout: |
resources/ota_manifest.py
src/Config.h
- name: Git Commands
run: |
git checkout --orphan newBinary
git branch -D binary
git branch -M binary
git rm --cached --ignore-unmatch -r *
- name: Get the version
id: get_version
run: echo "VERSION=$(cat master/src/Config.h | grep -oP '(?<=#define NUKI_HUB_VERSION \")(.*)(?=\")')" >> $GITHUB_OUTPUT
- name: Download release assets
uses: actions/download-artifact@v4
with:
path: release
pattern: '*-release-assets'
- name: Download debug assets
uses: actions/download-artifact@v4
with:
path: debug
pattern: '*-debug-assets'
- name: Build zip archives
id: zip
env:
VERSION: ${{ steps.get_version.outputs.VERSION }}
run: |
NUKI="NukiHub-${VERSION}"
ARTIFACTS=""
for FOLDER in release/*; do
MODEL=`echo "${FOLDER}" | cut -d '/' -f2 | cut -d '-' -f1 | tr '[:lower:]' '[:upper:]'`
ZIPFILE="${NUKI}-${MODEL}.zip"
echo "${FOLDER} -- ${ZIPFILE}"
cd $FOLDER
zip -9r ../../${ZIPFILE} * -x "webflash_nuki_hub_*.bin"
ARTIFACTS="${ARTIFACTS}${ZIPFILE},"
cd ../..
done
for FOLDER in debug/*; do
MODEL=`echo "${FOLDER}" | cut -d '/' -f2 | cut -d '-' -f1 | tr '[:lower:]' '[:upper:]'`
ZIPFILE="${NUKI}-${MODEL}-DEBUG.zip"
echo "${FOLDER} -- ${ZIPFILE}"
cd $FOLDER
zip -9r ../../${ZIPFILE} *
ARTIFACTS="${ARTIFACTS}${ZIPFILE},"
cd ../..
done
# remove last character
ARTIFACTS="${ARTIFACTS%?}"
echo "artifacts=${ARTIFACTS}" | tee -a ${GITHUB_OUTPUT}
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
with:
prerelease: false
allowUpdates: true
updateOnlyUnreleased: false
draft: false
generateReleaseNotes: true
makeLatest: true
name: "Nuki Hub ${{ steps.get_version.outputs.VERSION }}"
artifactErrorsFailBuild: true
artifacts: ${{ steps.zip.outputs.artifacts }}
artifactContentType: application/zip
tag: ${{ steps.get_version.outputs.VERSION }}
- name: Copy binaries to ota and webflash and remove beta
env:
Version: ${{ github.run_id }}.${{ github.run_number }}.${{ github.run_attempt }}
run: |
mkdir -p ota/beta/
mkdir -p ota/debug/beta/
mkdir -p ota/master/
mkdir -p ota/debug/master/
mkdir -p webflash/
mkdir -p resources/
mkdir -p src/
cp -vf release/*/nuki_hub_*.bin ota/
cp -vf debug/*/nuki_hub_*.bin ota/debug/
cp -vf release/*/webflash_nuki_hub_*.bin webflash/
cp -vf master/resources/ota_manifest.py resources/ota_manifest.py
cp -vf master/src/Config.h src/Config.h
python3 resources/ota_manifest.py release $Version
python3 resources/ota_manifest.py beta none
find * -not -path "ota*" -not -path "webflash*" -delete
rm -rf ota/beta/*.bin
rm -rf ota/debug/beta/*.bin
rm -rf .github .gitignore .gitmodules
touch ota/beta/empty
touch ota/master/empty
touch ota/debug/beta/empty
touch ota/debug/master/empty
touch webflash/empty
- name: Commit binaries to binary
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Update binaries"
file_pattern: 'ota/* ota/debug/* ota/master/* ota/debug/master/* ota/beta/* ota/debug/beta/* webflash/*'
branch: binary
skip_dirty_check: true
skip_fetch: true
skip_checkout: true
disable_globbing: true
add_options: '-f'
push_options: '-f'