Skip to content

v3.0.4

v3.0.4 #20

Workflow file for this run

name: Release
on:
release:
types: [published]
permissions:
actions: write
jobs:
release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Tag
id: tag
uses: JinoArch/get-latest-tag@latest
- name: Update version on manifest.json
uses: amochkin/action-json@v1
id: write_version
with:
mode: write
file: docs/manifest.json
property: version
value: ${{ steps.tag.outputs.latestTag }}
value_type: string
- name: Update firmware/*.bootloader.bin version on manifest.json
uses: amochkin/action-json@v1
id: builds_parts_path_0
with:
mode: write
file: docs/manifest.json
property: builds.0.parts.0.path
value: firmware/homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.bootloader.bin
value_type: string
- name: Update firmware/*.partitions.bin version on manifest.json
uses: amochkin/action-json@v1
id: builds_parts_path_1
with:
mode: write
file: docs/manifest.json
property: builds.0.parts.1.path
value: firmware/homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.partitions.bin
value_type: string
- name: Update firmware/*.bin version on manifest.json
uses: amochkin/action-json@v1
id: builds_parts_path_3
with:
mode: write
file: docs/manifest.json
property: builds.0.parts.3.path
value: firmware/homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.firmware.bin
value_type: string
- name: Output created (or overwritten) manifest.json
run: cat docs/manifest.json
shell: bash
- name: Output read value of 'version' & `parts` property
run: echo ${{ steps.write_version.outputs.value }} ${{ steps.builds_parts_path_0.outputs.value }} ${{ steps.builds_parts_path_1.outputs.value }} ${{ steps.builds_parts_path_3.outputs.value }}
shell: bash
- name: Attach manifest.json
uses: AButler/[email protected]
with:
files: "/home/runner/work/homekit-ratgdo32/homekit-ratgdo32/docs/manifest.json"
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ steps.tag.outputs.latestTag }}
- name: Upload Release manifest.json
uses: wow-actions/download-upload@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
url: https://github.com/ratgdo/homekit-ratgdo32/releases/download/${{ steps.tag.outputs.latestTag }}/manifest.json
dir: docs/
commit_message: "Upload Latest manifest.json for ${{ steps.tag.outputs.latestTag }}"
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install PlatformIO Core
run: |
pip install --upgrade pip
pip install --upgrade platformio
- name: Build PlatformIO Project
run: pio run -e ratgdo_esp32dev
- name : md5sum Firmware.bin
run: |
cd .pio/build/ratgdo_esp32dev
md5sum firmware.bin | awk '{print $1}' > firmware.md5
- name: Rename Firmware Files
run: |
mv .pio/build/ratgdo_esp32dev/firmware.bin .pio/build/ratgdo_esp32dev/homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.firmware.bin
mv .pio/build/ratgdo_esp32dev/bootloader.bin .pio/build/ratgdo_esp32dev/homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.bootloader.bin
mv .pio/build/ratgdo_esp32dev/partitions.bin .pio/build/ratgdo_esp32dev/homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.partitions.bin
mv .pio/build/ratgdo_esp32dev/firmware.elf .pio/build/ratgdo_esp32dev/homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.elf
mv .pio/build/ratgdo_esp32dev/firmware.md5 .pio/build/ratgdo_esp32dev/homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.firmware.md5
- name: Attach Bundle - firmware.bin
uses: AButler/[email protected]
with:
files: ".pio/build/ratgdo_esp32dev/homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.firmware.bin"
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ steps.tag.outputs.latestTag }}
- name: Upload Release Asset - firmware.bin
uses: wow-actions/download-upload@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
url: https://github.com/ratgdo/homekit-ratgdo32/releases/download/${{ steps.tag.outputs.latestTag }}/homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.firmware.bin
dir: docs/firmware/
commit_message: "Upload Latest Firmware: homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.firmware.bin"
- name: Upload firmware.bin
uses: actions/upload-artifact@v4
with:
name: homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.firmware.bin
path: |
.pio/build/ratgdo_esp32dev/*.firmware.bin
- name: Download firmware.bin
uses: actions/download-artifact@v4
with:
name: homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.firmware.bin
path: |
docs/firmware/
- name: Attach Bundle - bootloader.bin
uses: AButler/[email protected]
with:
files: ".pio/build/ratgdo_esp32dev/*.bootloader.bin"
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ steps.tag.outputs.latestTag }}
- name: Upload Release Asset - bootloader.bin
uses: wow-actions/download-upload@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
url: https://github.com/ratgdo/homekit-ratgdo32/releases/download/${{ steps.tag.outputs.latestTag }}/homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.bootloader.bin
dir: docs/firmware/
commit_message: "Upload Latest bootloader: homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.bootloader.bin"
- name: Upload bootloader.bin
uses: actions/upload-artifact@v4
with:
name: homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.bootloader.bin
path: |
.pio/build/ratgdo_esp32dev/*.bootloader.bin
- name: Download bootloader.bin
uses: actions/download-artifact@v4
with:
name: homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.bootloader.bin
path: |
docs/firmware/
- name: Attach Bundle - partitions.bin
uses: AButler/[email protected]
with:
files: ".pio/build/ratgdo_esp32dev/*.partitions.bin"
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ steps.tag.outputs.latestTag }}
- name: Upload Release Asset - partitions.bin
uses: wow-actions/download-upload@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
url: https://github.com/ratgdo/homekit-ratgdo32/releases/download/${{ steps.tag.outputs.latestTag }}/homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.partitions.bin
dir: docs/firmware/
commit_message: "Upload Latest partitions: homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.partitions.bin"
- name: Upload partitions.bin
uses: actions/upload-artifact@v4
with:
name: homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.partitions.bin
path: |
.pio/build/ratgdo_esp32dev/*.partitions.bin
- name: Download partitions.bin
uses: actions/download-artifact@v4
with:
name: homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.partitions.bin
path: |
docs/firmware/
- name: Attach Bundle - Firmware.md5
uses: AButler/[email protected]
with:
files: ".pio/build/ratgdo_esp32dev/*.firmware.md5"
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ steps.tag.outputs.latestTag }}
- name: Upload Release Asset - firmware.md5
uses: wow-actions/download-upload@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
url: https://github.com/ratgdo/homekit-ratgdo32/releases/download/${{ steps.tag.outputs.latestTag }}/homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.firmware.md5
dir: docs/firmware/
commit_message: "Upload Latest md5: homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.firmware.md5"
- name: Upload firmware.md5
uses: actions/upload-artifact@v4
with:
name: homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.firmware.md5
path: |
.pio/build/ratgdo_esp32dev/*.firmware.md5
- name: Download firmware.md5
uses: actions/download-artifact@v4
with:
name: homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.firmware.md5
path: |
docs/firmware/
- name: Attach Bundle - Firmware.elf
uses: AButler/[email protected]
with:
files: ".pio/build/ratgdo_esp32dev/*.elf"
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ steps.tag.outputs.latestTag }}
- name: Upload Release Asset - Firmware.elf
uses: wow-actions/download-upload@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
url: https://github.com/ratgdo/homekit-ratgdo32/releases/download/${{ steps.tag.outputs.latestTag }}/homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.elf
dir: docs/firmware/
commit_message: "Upload Latest Firmware: homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.elf"
- name: Upload Firmware.elf
uses: actions/upload-artifact@v4
with:
name: homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.elf
path: |
.pio/build/ratgdo_esp32dev/*.elf
- name: Download Firmware.elf
uses: actions/download-artifact@v4
with:
name: homekit-ratgdo32-${{ steps.tag.outputs.latestTag }}.elf
path: |
docs/firmware/
- name: Sleep for 2 minutes before pubhsing to Discord
run: sleep 120s
shell: bash
- name: Latest Release
if: ${{ github.event.release.prerelease == false }}
uses: SethCohen/[email protected]
with:
webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}
color: "5723991"
username: "ratgdo"
avatar_url: "https://avatars.githubusercontent.com/u/144837877?s=200&v=4"
footer_title: "homekit-ratgdo32"
footer_icon_url: "https://avatars.githubusercontent.com/u/144837877?s=200&v=4"
footer_timestamp: true
- name: Pre-Release
if: ${{ github.event.release.prerelease == true }}
uses: SethCohen/[email protected]
with:
webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}
color: "5723991"
username: "ratgdo"
avatar_url: "https://avatars.githubusercontent.com/u/144837877?s=200&v=4"
footer_title: "Pre-Release: homekit-ratgdo32"
footer_icon_url: "https://avatars.githubusercontent.com/u/144837877?s=200&v=4"
footer_timestamp: true