Skip to content

Commit 08a9e41

Browse files
committed
refactor: Remove obsolete CI workflows and update build configurations for Dev and Release processes
1 parent f766ead commit 08a9e41

6 files changed

Lines changed: 103 additions & 118 deletions

File tree

.github/workflows/build-addon.yaml

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

.github/workflows/build-dev.yml

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

.github/workflows/dev-build.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Development Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
name: Build add-on
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Build frontend
18+
run: |
19+
cd frontend
20+
npm ci
21+
npm run build
22+
23+
- name: Prepare build context
24+
run: |
25+
mkdir -p aquable/frontend
26+
cp -r frontend/dist aquable/frontend/
27+
cp -r src aquable/
28+
cp pyproject.toml aquable/
29+
30+
- name: Login to GitHub Container Registry
31+
uses: docker/login-action@v3
32+
with:
33+
registry: ghcr.io
34+
username: ${{ github.repository_owner }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Build and push dev image (amd64 only)
38+
uses: home-assistant/builder@master
39+
with:
40+
args: |
41+
--target aquable \
42+
--docker-hub ghcr.io/${{ github.repository_owner }} \
43+
--amd64 \
44+
--cache-from ghcr.io/${{ github.repository_owner }}/amd64-aquable:latest

.github/workflows/release.yml

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,53 @@ on:
66
- 'v*'
77

88
jobs:
9-
release:
9+
build-and-push:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
15+
- name: Extract version from tag
16+
id: version
17+
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
18+
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '18'
23+
24+
- name: Build frontend
25+
run: |
26+
cd frontend
27+
npm ci
28+
npm run build
29+
30+
- name: Prepare build context
31+
run: |
32+
mkdir -p aquable/frontend
33+
cp -r frontend/dist aquable/frontend/
34+
cp -r src aquable/
35+
cp pyproject.toml aquable/
36+
37+
- name: Login to GitHub Container Registry
38+
uses: docker/login-action@v3
39+
with:
40+
registry: ghcr.io
41+
username: ${{ github.repository_owner }}
42+
password: ${{ secrets.GITHUB_TOKEN }}
43+
44+
- name: Build and push multi-arch images
45+
uses: home-assistant/builder@master
46+
with:
47+
args: |
48+
--target aquable \
49+
--docker-hub ghcr.io/${{ github.repository_owner }} \
50+
--all \
51+
--cache-from ghcr.io/${{ github.repository_owner }}/amd64-aquable:latest \
52+
--version ${{ steps.version.outputs.version }}
53+
54+
sync-to-stable:
55+
needs: build-and-push
1056
runs-on: ubuntu-latest
1157
steps:
1258
- name: Checkout dev repository
@@ -57,10 +103,13 @@ jobs:
57103
mkdir -p stable/aquable
58104
cp -r dev/aquable/* stable/aquable/
59105
60-
# Copy built frontend to correct location
106+
# Copy built frontend to add-on directory
61107
mkdir -p stable/aquable/frontend
62108
cp -r dev/frontend/dist stable/aquable/frontend/
63109
110+
# Copy source code to add-on directory (needed for Dockerfile build context)
111+
cp -r dev/src stable/aquable/
112+
64113
# Copy root files that should be synced from dev
65114
cp dev/pyproject.toml stable/
66115
cp dev/LICENSE stable/

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
# Node / frontend builds
1414
node_modules/
1515
frontend/node_modules/
16-
/frontend/dist/
16+
frontend/dist/
1717
frontend/.vite/
1818
*.tsbuildinfo
1919
.eslintcache
2020

21-
# Exception: track built frontend in aquable add-on directory
22-
!aquable/frontend/
23-
!aquable/frontend/dist/
21+
# Add-on build artifacts (built during CI/CD)
22+
aquable/frontend/dist/
23+
aquable/src/
2424

2525
# Byte-compiled / optimized / DLL files
2626
__pycache__/

aquable/config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ url: https://github.com/caleb-venner/aquable
66
image: ghcr.io/caleb-venner/{arch}-aquable
77
arch:
88
- amd64
9+
- armv7
10+
- aarch64
11+
- armhf
12+
- i386
913
startup: application
1014
boot: auto
1115
init: false

0 commit comments

Comments
 (0)