v1.8.2 #29
Workflow file for this run
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: 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: Output created (or overwritten) manifest.json | |
run: cat docs/manifest.json | |
shell: bash | |
- name: Output read value of 'version' property | |
run: echo ${{ steps.write_version.outputs.value }} | |
shell: bash | |
- name: Update firmware/*.bin version on manifest.json | |
uses: amochkin/action-json@v1 | |
id: builds_parts_path | |
with: | |
mode: write | |
file: docs/manifest.json | |
property: builds.0.parts.0.path | |
value: firmware/homekit-ratgdo-${{ steps.tag.outputs.latestTag }}.bin | |
value_type: string | |
- name: Output created (or overwritten) manifest.json | |
run: cat docs/manifest.json | |
shell: bash | |
- name: Output read value of 'version' property | |
run: echo ${{ steps.builds_parts_path.outputs.value }} | |
shell: bash | |
- name: Attach manifest.json | |
uses: AButler/[email protected] | |
with: | |
files: "/home/runner/work/homekit-ratgdo/homekit-ratgdo/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-ratgdo/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_esp8266_hV25 | |
- name : md5sum Firmware.bin | |
run: | | |
cd .pio/build/ratgdo_esp8266_hV25 | |
md5sum firmware.bin | awk '{print $1}' > firmware.md5 | |
- name: Rename Firmware Files | |
run: | | |
mv .pio/build/ratgdo_esp8266_hV25/firmware.bin .pio/build/ratgdo_esp8266_hV25/homekit-ratgdo-${{ steps.tag.outputs.latestTag }}.bin | |
mv .pio/build/ratgdo_esp8266_hV25/firmware.elf .pio/build/ratgdo_esp8266_hV25/homekit-ratgdo-${{ steps.tag.outputs.latestTag }}.elf | |
mv .pio/build/ratgdo_esp8266_hV25/firmware.md5 .pio/build/ratgdo_esp8266_hV25/homekit-ratgdo-${{ steps.tag.outputs.latestTag }}.md5 | |
- name: Attach Bundle - Firmware.bin | |
uses: AButler/[email protected] | |
with: | |
files: ".pio/build/ratgdo_esp8266_hV25/*.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-ratgdo/releases/download/${{ steps.tag.outputs.latestTag }}/homekit-ratgdo-${{ steps.tag.outputs.latestTag }}.bin | |
dir: docs/firmware/ | |
commit_message: "Upload Latest Firmware: homekit-ratgdo-${{ steps.tag.outputs.latestTag }}.bin" | |
- name: Upload Firmware.bin | |
uses: actions/upload-artifact@v4 | |
with: | |
name: homekit-ratgdo-${{ steps.tag.outputs.latestTag }}.bin | |
path: | | |
.pio/build/ratgdo_esp8266_hV25/*.bin | |
- name: Download Firmware.bin | |
uses: actions/download-artifact@v4 | |
with: | |
name: homekit-ratgdo-${{ steps.tag.outputs.latestTag }}.bin | |
path: | | |
docs/firmware/ | |
- name: Attach Bundle - Firmware.md5 | |
uses: AButler/[email protected] | |
with: | |
files: ".pio/build/ratgdo_esp8266_hV25/*.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-ratgdo/releases/download/${{ steps.tag.outputs.latestTag }}/homekit-ratgdo-${{ steps.tag.outputs.latestTag }}.md5 | |
dir: docs/firmware/ | |
commit_message: "Upload Latest md5: homekit-ratgdo-${{ steps.tag.outputs.latestTag }}.md5" | |
- name: Upload Firmware.bin | |
uses: actions/upload-artifact@v4 | |
with: | |
name: homekit-ratgdo-${{ steps.tag.outputs.latestTag }}.md5 | |
path: | | |
.pio/build/ratgdo_esp8266_hV25/*.md5 | |
- name: Download Firmware.md5 | |
uses: actions/download-artifact@v4 | |
with: | |
name: homekit-ratgdo-${{ steps.tag.outputs.latestTag }}.md5 | |
path: | | |
docs/firmware/ | |
- name: Attach Bundle - Firmware.elf | |
uses: AButler/[email protected] | |
with: | |
files: ".pio/build/ratgdo_esp8266_hV25/*.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-ratgdo/releases/download/${{ steps.tag.outputs.latestTag }}/homekit-ratgdo-${{ steps.tag.outputs.latestTag }}.elf | |
dir: docs/firmware/ | |
commit_message: "Upload Latest Firmware: homekit-ratgdo-${{ steps.tag.outputs.latestTag }}.elf" | |
- name: Upload Firmware.elf | |
uses: actions/upload-artifact@v4 | |
with: | |
name: homekit-ratgdo-${{ steps.tag.outputs.latestTag }}.elf | |
path: | | |
.pio/build/ratgdo_esp8266_hV25/*.elf | |
- name: Download Firmware.elf | |
uses: actions/download-artifact@v4 | |
with: | |
name: homekit-ratgdo-${{ 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-ratgdo" | |
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-ratgdo" | |
footer_icon_url: "https://avatars.githubusercontent.com/u/144837877?s=200&v=4" | |
footer_timestamp: true |