-
-
Notifications
You must be signed in to change notification settings - Fork 2
88 lines (79 loc) · 2.51 KB
/
release-please.yaml
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
# yamllint disable rule:line-length
---
on:
push:
branches:
- main
permissions:
contents: write
packages: write
pull-requests: write
name: release-please
env:
BUILD_ARGS: ""
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }}
outputs:
releases_created: ${{ steps.release.outputs.releases_created }}
paths_released: ${{ steps.release.outputs.paths_released }}
build:
if: ${{ needs.release-please.outputs.releases_created }}
needs:
- release-please
runs-on: ubuntu-latest
name: Build ${{ matrix.arch }} ${{ matrix.addon }} add-on
strategy:
matrix:
addon: ${{ fromJSON(needs.release-please.outputs.paths_released) }}
arch:
- "aarch64"
- "amd64"
- "armv7"
- "i386"
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Get information
id: info
uses: home-assistant/actions/helpers/info@master
with:
path: "./${{ matrix.addon }}"
- name: Check if add-on should be built
id: check
env:
HEAD: "${{ github.head_ref }}"
run: |
# shellcheck disable=SC2157,SC2086
if [[ "${{ steps.info.outputs.architectures }}" =~ ${{ matrix.arch }} ]]; then
# shellcheck disable=SC2129
echo "build_arch=true" >> $GITHUB_OUTPUT;
# shellcheck disable=SC2129
echo "image=$(echo ${{ steps.info.outputs.image }} | cut -d'/' -f3)" >> $GITHUB_OUTPUT;
else
echo "${{ matrix.arch }} is not a valid arch for ${{ matrix.addon }}, skipping build";
# shellcheck disable=SC2129
echo "build_arch=false" >> $GITHUB_OUTPUT;
fi
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build ${{ matrix.addon }} add-on
id: builderstep
if: steps.check.outputs.build_arch == 'true'
uses: home-assistant/builder@master
with:
args: |
--${{ matrix.arch }} \
--target /data/${{ matrix.addon }} \
--image "${{ steps.check.outputs.image }}" \
--docker-hub "ghcr.io/${{ github.repository_owner }}" \
--addon