Store_Tasmota_firmwares #1718
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Store_Tasmota_firmwares | |
on: | |
repository_dispatch: | |
workflow_dispatch: | |
push: | |
branches: gh_actions | |
jobs: | |
empty_branch: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: firmware | |
- name: Create new empty firmware branch | |
run: | | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config user.name "github-actions[bot]" | |
git switch --orphan new_branch # create empty branch | |
git commit --allow-empty -m "Initial commit" | |
git push -u origin new_branch # push empty branch in repo | |
git switch firmware | |
git reset --hard new_branch # reset firmware branch | |
git push origin firmware -f | |
git push origin --delete new_branch # delete empty_branch | |
download: | |
runs-on: ubuntu-latest | |
needs: empty_branch | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: firmware | |
- name: Merge branch main into branch firmware | |
run: | | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config user.name "github-actions[bot]" | |
git remote add -f mrg_main "https://github.com/arendst/Tasmota-firmware.git" --track main | |
git switch -c work | |
#rm -rf ./github | |
git merge mrg_main/main --allow-unrelated-histories &> status.txt | |
echo "$(<status.txt)" | |
- name: Push into branch firmware | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{secrets.GITHUB_TOKEN}} | |
branch: 'firmware' | |
- uses: actions/checkout@v4 | |
with: | |
ref: firmware | |
- name: Download artifact | |
uses: dawidd6/action-download-artifact@v3 | |
with: | |
github_token: ${{secrets.GITHUB_TOKEN}} | |
workflow: Tasmota_build_devel.yml | |
repo: arendst/tasmota | |
name: firmware* | |
name_is_regexp: true | |
- name: Move artifacts in one folder | |
run: | | |
mkdir -p ./mv_firmware | |
rsync -avR ./firmware/./ ./mv_firmware | |
rsync -avR ./firmware_safeboot/./ ./mv_firmware | |
rm -rf ./firmware/firmware | |
rm -rf ./firmware_safeboot | |
- name: Move firmware files in sub-folders | |
run: | | |
mkdir -p ./firmware/tasmota/languages | |
mkdir -p ./firmware/tasmota32/languages | |
mkdir -p ./firmware/map | |
[ ! -f ./mv_firmware/map/* ] || mv ./mv_firmware/map/* ./firmware/map/ | |
[ ! -f ./mv_firmware/firmware/tasmota.* ] || mv ./mv_firmware/firmware/tasmota.* ./firmware/tasmota/ | |
[ ! -f ./mv_firmware/firmware/tasmota-4M.* ] || mv ./mv_firmware/firmware/tasmota-4M.* ./firmware/tasmota/ | |
[ ! -f ./mv_firmware/firmware/tasmota-sensors.* ] || mv ./mv_firmware/firmware/tasmota-sensors.* ./firmware/tasmota/ | |
[ ! -f ./mv_firmware/firmware/tasmota-minimal.bin.gz ] || mv ./mv_firmware/firmware/tasmota-minimal.bin.gz ./firmware/tasmota/ | |
[ ! -f ./mv_firmware/firmware/tasmota-lite.* ] || mv ./mv_firmware/firmware/tasmota-lite.* ./firmware/tasmota/ | |
[ ! -f ./mv_firmware/firmware/tasmota-ir*.* ] || mv ./mv_firmware/firmware/tasmota-ir*.* ./firmware/tasmota/ | |
[ ! -f ./mv_firmware/firmware/tasmota-display.* ] || mv ./mv_firmware/firmware/tasmota-display.* ./firmware/tasmota/ | |
[ ! -f ./mv_firmware/firmware/tasmota-knx.* ] || mv ./mv_firmware/firmware/tasmota-knx.* ./firmware/tasmota/ | |
[ ! -f ./mv_firmware/firmware/tasmota-zbbridge.* ] || mv ./mv_firmware/firmware/tasmota-zbbridge.* ./firmware/tasmota/ | |
[ ! -f ./mv_firmware/firmware/tasmota-zigbee.* ] || mv ./mv_firmware/firmware/tasmota-zigbee.* ./firmware/tasmota/ | |
[ ! -f ./mv_firmware/firmware/tasmota32.* ] || mv ./mv_firmware/firmware/tasmota32.* ./firmware/tasmota32/ | |
[ ! -f ./mv_firmware/firmware/tasmota32solo1*.* ] || mv ./mv_firmware/firmware/tasmota32solo1*.* ./firmware/tasmota32/ | |
[ ! -f ./mv_firmware/firmware/tasmota32-ir*.* ] || mv ./mv_firmware/firmware/tasmota32-ir*.* ./firmware/tasmota32/ | |
[ ! -f ./mv_firmware/firmware/tasmota32-display.* ] || mv ./mv_firmware/firmware/tasmota32-display.* ./firmware/tasmota32/ | |
[ ! -f ./mv_firmware/firmware/tasmota32-lvgl.* ] || mv ./mv_firmware/firmware/tasmota32-lvgl.* ./firmware/tasmota32/ | |
[ ! -f ./mv_firmware/firmware/tasmota32-web*.* ] || mv ./mv_firmware/firmware/tasmota32-web*.* ./firmware/tasmota32/ | |
[ ! -f ./mv_firmware/firmware/tasmota32-odroidgo.* ] || mv ./mv_firmware/firmware/tasmota32-odroidgo.* ./firmware/tasmota32/ | |
[ ! -f ./mv_firmware/firmware/tasmota32-zbbrdgpro.* ] || mv ./mv_firmware/firmware/tasmota32-zbbrdgpro.* ./firmware/tasmota32/ | |
[ ! -f ./mv_firmware/firmware/tasmota32-matter.* ] || mv ./mv_firmware/firmware/tasmota32-matter.* ./firmware/tasmota32/ | |
[ ! -f ./mv_firmware/firmware/tasmota32-nspanel.* ] || mv ./mv_firmware/firmware/tasmota32-nspanel.* ./firmware/tasmota32/ | |
[ ! -f ./mv_firmware/firmware/tasmota32-core2.* ] || mv ./mv_firmware/firmware/tasmota32-core2.* ./firmware/tasmota32/ | |
[ ! -f ./mv_firmware/firmware/tasmota32-bluetooth.* ] || mv ./mv_firmware/firmware/tasmota32-bluetooth.* ./firmware/tasmota32/ | |
[ ! -f ./mv_firmware/firmware/tasmota32c3*.* ] || mv ./mv_firmware/firmware/tasmota32c3*.* ./firmware/tasmota32/ | |
[ ! -f ./mv_firmware/firmware/tasmota32s2*.* ] || mv ./mv_firmware/firmware/tasmota32s2*.* ./firmware/tasmota32/ | |
[ ! -f ./mv_firmware/firmware/tasmota32s3*.* ] || mv ./mv_firmware/firmware/tasmota32s3*.* ./firmware/tasmota32/ | |
[ ! -f ./mv_firmware/firmware/tasmota32-safeboot* ] || mv ./mv_firmware/firmware/tasmota32-safeboot* ./firmware/tasmota32/ | |
[ ! -f ./mv_firmware/firmware/tasmota32-* ] || mv ./mv_firmware/firmware/tasmota32-* ./firmware/tasmota32/languages/ | |
[ ! -f ./mv_firmware/firmware/tasmota32* ] || mv ./mv_firmware/firmware/tasmota32* ./firmware/tasmota32/ | |
[ ! -f ./mv_firmware/firmware/tasmota-minimal.bin ] || rm -rf ./mv_firmware/firmware/tasmota-minimal.bin | |
[ ! -f ./mv_firmware/firmware/* ] || mv ./mv_firmware/firmware/* ./firmware/tasmota/languages/ | |
rm -rf ./mv_firmware | |
- name: Update Manifest files | |
run: | | |
python genManifest.py | |
- name: Push updated devel content in branch firmware | |
run: | | |
COMMIT_SHA=$(curl -s "https://api.github.com/repos/arendst/tasmota/commits/development" | jq -r '.sha') | |
COMMIT="Firmware built from commit https://github.com/arendst/Tasmota/commit/${COMMIT_SHA}" | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config user.name "github-actions[bot]" | |
git add -A | |
git commit --allow-empty -m "$COMMIT" | |
git push origin firmware -f | |
- name: Download release firmwares from latest release in github | |
run: | | |
gh release download -p "tasmota*" -D gh_latest -R github.com/arendst/tasmota | |
- name: Move firmware files in sub-folders | |
run: | | |
mkdir -p ./release-firmware/tasmota/languages | |
mkdir -p ./release-firmware/tasmota32/languages | |
[ ! -f ./gh_latest/tasmota.* ] || mv ./gh_latest/tasmota.* ./release-firmware/tasmota/ | |
[ ! -f ./gh_latest/tasmota-4M.* ] || mv ./gh_latest/tasmota-4M.* ./release-firmware/tasmota/ | |
[ ! -f ./gh_latest/tasmota-sensors.* ] || mv ./gh_latest/tasmota-sensors.* ./release-firmware/tasmota/ | |
[ ! -f ./gh_latest/tasmota-minimal.bin.gz ] || mv ./gh_latest/tasmota-minimal.bin.gz ./release-firmware/tasmota/ | |
[ ! -f ./gh_latest/tasmota-lite.* ] || mv ./gh_latest/tasmota-lite.* ./release-firmware/tasmota/ | |
[ ! -f ./gh_latest/tasmota-ir*.* ] || mv ./gh_latest/tasmota-ir*.* ./release-firmware/tasmota/ | |
[ ! -f ./gh_latest/tasmota-display.* ] || mv ./gh_latest/tasmota-display.* ./release-firmware/tasmota/ | |
[ ! -f ./gh_latest/tasmota-knx.* ] || mv ./gh_latest/tasmota-knx.* ./release-firmware/tasmota/ | |
[ ! -f ./gh_latest/tasmota-zbbridge.* ] || mv ./gh_latest/tasmota-zbbridge.* ./release-firmware/tasmota/ | |
[ ! -f ./gh_latest/tasmota-zigbee.* ] || mv ./gh_latest/tasmota-zigbee.* ./release-firmware/tasmota/ | |
[ ! -f ./gh_latest/tasmota32.* ] || mv ./gh_latest/tasmota32.* ./release-firmware/tasmota32/ | |
[ ! -f ./gh_latest/tasmota32solo1*.* ] || mv ./gh_latest/tasmota32solo1*.* ./release-firmware/tasmota32/ | |
[ ! -f ./gh_latest/tasmota32-ir*.* ] || mv ./gh_latest/tasmota32-ir*.* ./release-firmware/tasmota32/ | |
[ ! -f ./gh_latest/tasmota32-display.* ] || mv ./gh_latest/tasmota32-display.* ./release-firmware/tasmota32/ | |
[ ! -f ./gh_latest/tasmota32-lvgl.* ] || mv ./gh_latest/tasmota32-lvgl.* ./release-firmware/tasmota32/ | |
[ ! -f ./gh_latest/tasmota32-web*.* ] || mv ./gh_latest/tasmota32-web*.* ./release-firmware/tasmota32/ | |
[ ! -f ./gh_latest/tasmota32-zbbrdgpro.* ] || mv ./gh_latest/tasmota32-zbbrdgpro.* ./release-firmware/tasmota32/ | |
[ ! -f ./gh_latest/tasmota32-matter.* ] || mv ./gh_latest/tasmota32-matter.* ./release-firmware/tasmota32/ | |
[ ! -f ./gh_latest/tasmota32-nspanel.* ] || mv ./gh_latest/tasmota32-nspanel.* ./release-firmware/tasmota32/ | |
[ ! -f ./gh_latest/tasmota32-odroidgo.* ] || mv ./gh_latest/tasmota32-odroidgo.* ./release-firmware/tasmota32/ | |
[ ! -f ./gh_latest/tasmota32-core2.* ] || mv ./gh_latest/tasmota32-core2.* ./release-firmware/tasmota32/ | |
[ ! -f ./gh_latest/tasmota32-bluetooth.* ] || mv ./gh_latest/tasmota32-bluetooth.* ./release-firmware/tasmota32/ | |
[ ! -f ./gh_latest/tasmota32c3*.* ] || mv ./gh_latest/tasmota32c3*.* ./release-firmware/tasmota32/ | |
[ ! -f ./gh_latest/tasmota32s2*.* ] || mv ./gh_latest/tasmota32s2*.* ./release-firmware/tasmota32/ | |
[ ! -f ./gh_latest/tasmota32s3*.* ] || mv ./gh_latest/tasmota32s3*.* ./release-firmware/tasmota32/ | |
[ ! -f ./gh_latest/tasmota32-safeboot* ] || mv ./gh_latest/tasmota32-safeboot* ./release-firmware/tasmota32/ | |
[ ! -f ./gh_latest/tasmota32-* ] || mv ./gh_latest/tasmota32-* ./release-firmware/tasmota32/languages/ | |
[ ! -f ./gh_latest/tasmota32* ] || mv ./gh_latest/tasmota32* ./release-firmware/tasmota32/ | |
[ ! -f ./gh_latest/tasmota-minimal.bin ] || rm -rf ./gh_latest/tasmota-minimal.bin | |
[ ! -f ./gh_latest/* ] || mv ./gh_latest/* ./release-firmware/tasmota/languages/ | |
rm -rf ./gh_latest | |
- name: Push updated master firmwares in branch firmware | |
run: | | |
COMMIT_SHA=$(curl -s "https://api.github.com/repos/arendst/tasmota/commits/master" | jq -r '.sha') | |
COMMIT="Firmware built from commit https://github.com/arendst/Tasmota/commit/${COMMIT_SHA}" | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config user.name "github-actions[bot]" | |
git add -A | |
git commit --allow-empty -m "$COMMIT" | |
git push origin firmware -f | |
start_workflow: | |
needs: download | |
runs-on: ubuntu-latest | |
steps: | |
- name: Dispatch workflow in repo Jason2866/Tasmota-build | |
run: | | |
curl -X POST https://api.github.com/repos/Jason2866/Tasmota-build/actions/workflows/Build_special_firmware.yml/dispatches \ | |
-H 'Accept: application/vnd.github.everest-preview+json' \ | |
-u ${{ secrets.API_TOKEN_GITHUB }} \ | |
--data '{"ref": "start_build"}' | |
deploy: | |
needs: download | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: firmware | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: '.' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |