forked from ratgdo/homekit-ratgdo
-
Notifications
You must be signed in to change notification settings - Fork 0
172 lines (147 loc) · 5.99 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
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: 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/[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
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 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 }}.elf
dir: docs/firmware/
commit_message: "Upload Latest Firmware: homekit-ratgdo-${{ steps.tag.outputs.latestTag }}.elf"
- 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: Download Firmware.elf
uses: actions/download-artifact@v4
with:
name: homekit-ratgdo-${{ steps.tag.outputs.latestTag }}.elf
path: |
docs/firmware/
- 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