-
Notifications
You must be signed in to change notification settings - Fork 33
75 lines (64 loc) · 2.36 KB
/
build_ha_addon_edge.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
name: Build HA addon edge
on:
repository_dispatch:
types: [build_ha_edge]
concurrency:
group: ha-addon-build-edge
cancel-in-progress: true
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
token: '${{ secrets.HA_PAT }}'
- name: Update README and set version in config.json
run: |
sed -i "s|\s\{4,\}\"version\".*| \"version\": \"${{ github.event.client_payload.ver }}\"\,|g" wmbusmeters-ha-addon-edge/config.json
sed -i "1s|^|## ${{ github.event.client_payload.ver }} \n- Updated to version [${{ github.event.client_payload.ver }}](https://github.com/wmbusmeters/wmbusmeters/commits/master)\n|" wmbusmeters-ha-addon-edge/CHANGELOG.md
- uses: actions/upload-artifact@v4
with:
name: ha-addon_artifact-${{ github.event.client_payload.ver }}
path: ${{ github.workspace }}
retention-days: 1
build:
needs: prepare
runs-on: ubuntu-latest
name: Build ${{ matrix.arch }} ${{ matrix.addon }} add-on
strategy:
matrix:
addon: ["wmbusmeters"]
arch: ["amd64", "armv7", "aarch64"]
steps:
- uses: actions/download-artifact@v4
with:
name: ha-addon_artifact-${{ github.event.client_payload.ver }}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PAT }}
- name: Build ${{ matrix.addon }} ${{ matrix.arch }} HA add-on
uses: home-assistant/builder@master
with:
args: |
--${{ matrix.arch }} \
--target wmbusmeters-ha-addon-edge \
--version ${{ github.event.client_payload.ver }}
update-repo:
needs: [prepare, build]
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
token: '${{ secrets.HA_PAT }}'
- uses: actions/download-artifact@v4
with:
name: ha-addon_artifact-${{ github.event.client_payload.ver }}
- name: Push changed files back to repo
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: "Auto Push - update ha-addon config and changelog for ${{ github.event.client_payload.ver }} - [no ci]"