forked from homeassistant-ai/ha-mcp
-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (92 loc) · 3.05 KB
/
Copy pathaddon-publish-dev.yml
File metadata and controls
102 lines (92 loc) · 3.05 KB
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
name: Home Assistant Add-on Publish (Dev)
on:
push:
branches: [master]
paths:
- 'src/**'
- 'homeassistant-addon/**'
- 'homeassistant-addon-dev/**'
- 'pyproject.toml'
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_PREFIX: ghcr.io/${{ github.repository }}-addon-dev
# Restrict permissions by default
permissions:
contents: read
jobs:
# Skip if commit is from semantic-release
check-skip:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.check.outputs.should_skip }}
steps:
- name: Check if should skip
id: check
env:
# Use env var to avoid shell interpretation of backticks in commit messages
COMMIT_MSG: ${{ github.event.head_commit.message }}
run: |
if [[ "$COMMIT_MSG" =~ ^[0-9]+\.[0-9]+\.[0-9]+ ]] || [[ "$COMMIT_MSG" =~ "chore(release)" ]]; then
echo "should_skip=true" >> $GITHUB_OUTPUT
else
echo "should_skip=false" >> $GITHUB_OUTPUT
fi
build-addon-dev:
name: Build Dev Add-on (${{ matrix.arch }})
needs: check-skip
if: needs.check-skip.outputs.should_skip != 'true'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
arch:
- amd64
- aarch64
include:
- arch: amd64
platform: linux/amd64
- arch: aarch64
platform: linux/arm64
steps:
- uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate dev version
id: version
run: |
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
DEV_VERSION="dev-${SHORT_SHA}"
echo "version=$DEV_VERSION" >> $GITHUB_OUTPUT
echo "short_sha=$SHORT_SHA" >> $GITHUB_OUTPUT
echo "Dev add-on version: $DEV_VERSION"
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./homeassistant-addon-dev/Dockerfile
push: true
platforms: ${{ matrix.platform }}
tags: |
${{ env.IMAGE_PREFIX }}-${{ matrix.arch }}:latest
${{ env.IMAGE_PREFIX }}-${{ matrix.arch }}:dev
${{ env.IMAGE_PREFIX }}-${{ matrix.arch }}:${{ steps.version.outputs.version }}
labels: |
io.hass.name=Home Assistant MCP Server (Dev)
io.hass.description=Development channel - AI assistant integration via MCP
io.hass.version=${{ steps.version.outputs.version }}
io.hass.type=addon
io.hass.arch=${{ matrix.arch }}
cache-from: type=gha,scope=addon-dev-${{ matrix.arch }}
cache-to: type=gha,mode=max,scope=addon-dev-${{ matrix.arch }}
build-args: |
BUILD_VERSION=${{ steps.version.outputs.version }}
BUILD_ARCH=${{ matrix.arch }}