forked from ratgdo/homekit-ratgdo
-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (77 loc) · 2.76 KB
/
manifest.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
name: Update Manifest
on:
release:
types: [published]
workflow_dispatch:
permissions:
actions: write
jobs:
manifest:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Tag
id: tag
uses: JinoArch/get-latest-tag@latest
- name: Check Tag
id: check-tag
run: |
echo "Latest Tag: ${{ steps.tag.outputs.latestTag }}"
if [[ ${{ steps.tag.outputs.latestTag }} =~ ^v[0-9].[0-9].[0-9]$ ]]; then
echo "match=true" >> $GITHUB_OUTPUT
fi
- name: Match
if: steps.check-tag.outputs.match != 'true'
run: |
echo "Tag: ${{ steps.tag.outputs.latestTag }}, does not match the required format: v0.0.0"
exit 1
- name: Write version to 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: Write version to 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: "Add Update manifest.json for ${{ steps.tag.outputs.latestTag }}"
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
event-type: build-firmware