Skip to content

Commit f99ca2d

Browse files
init commit
1 parent b59b6b5 commit f99ca2d

File tree

2 files changed

+59
-38
lines changed

2 files changed

+59
-38
lines changed

.github/workflows/build.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: BUILD
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
variables:
9+
runs-on: ubuntu-latest
10+
outputs:
11+
ARCH_LIST: ${{ env.ARCH_LIST }}
12+
ADDON_LIST: ${{ env.ADDON_LIST }}
13+
DOCKER_ARGS: ${{ env.DOCKER_ARGS }}
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: "ARGS: default"
18+
run: |
19+
echo "ADDON_LIST=['silabs-multiprotocol-ember']" >> $GITHUB_ENV
20+
echo "DOCKER_ARGS=--no-latest --test" >> $GITHUB_ENV
21+
- name: "ARGS: zigbee2mqtt" # Build of addon release version
22+
if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'push'
23+
run: |
24+
echo "ADDON_LIST=['silabs-multiprotocol-ember']" >> $GITHUB_ENV
25+
echo "DOCKER_ARGS=--no-cache --docker-hub-check" >> $GITHUB_ENV
26+
27+
- name: Determine arch
28+
id: determine_arch
29+
run: |
30+
ARCH_LIST=$(jq -r -c '.arch' ./${{ fromJSON(env.ADDON_LIST)[0] }}/config.json)
31+
echo "Found the following arches: $ARCH_LIST"
32+
echo "ARCH_LIST=$ARCH_LIST" >> $GITHUB_ENV
33+
34+
build:
35+
runs-on: ubuntu-latest
36+
needs: variables
37+
env:
38+
DOCKER_ARGS: ${{needs.variables.outputs.DOCKER_ARGS}}
39+
strategy:
40+
matrix:
41+
arch: ${{fromJSON(needs.variables.outputs.ARCH_LIST)}}
42+
addon: ${{fromJSON(needs.variables.outputs.ADDON_LIST)}}
43+
steps:
44+
- uses: actions/checkout@v3
45+
- name: Docker login
46+
if: (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
47+
run: echo ${{ secrets.DOCKER_KEY }} | docker login -u koenkk --password-stdin
48+
- name: Build
49+
run: |
50+
if [ "${{ matrix.addon }}" != "zigbee2mqtt-proxy" ]; then
51+
cp -R common/rootfs ${{ matrix.addon }}
52+
cp common/Dockerfile ${{ matrix.addon }}
53+
fi
54+
cp common/build.yaml ${{ matrix.addon }}
55+
docker run --rm --privileged \
56+
-v /home/runner/.docker:/root/.docker \
57+
-v /run/docker.sock:/run/docker.sock:rw \
58+
-v $(pwd)/${{ matrix.addon }}:/data homeassistant/amd64-builder --${{ matrix.arch }} -t /data \
59+
${{ env.DOCKER_ARGS }}

.github/workflows/release.yaml

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)