v0.11.0 #3
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/upload-release-assets@v3.0 | |
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: Rename Firmware | |
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 | |
- name: Attach Bundle | |
uses: AButler/upload-release-assets@v3.0 | |
with: | |
files: ".pio/build/ratgdo_esp8266_hV25/*.bin" | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
release-tag: ${{ steps.tag.outputs.latestTag }} | |
- name: Upload Release Asset | |
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: 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.bin | |
uses: actions/download-artifact@v4 | |
with: | |
name: homekit-ratgdo-${{ steps.tag.outputs.latestTag }}.bin | |
path: | | |
docs/firmware/ | |
- name: Latest Release | |
if: ${{ github.event.release.prerelease == false }} | |
uses: SethCohen/github-releases-to-discord@v1.13.1 | |
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/github-releases-to-discord@v1.13.1 | |
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 |