From 8ac23a11a7393621552436da62abacfedaf9acbc Mon Sep 17 00:00:00 2001 From: WillCodeForCats <48533968+WillCodeForCats@users.noreply.github.com> Date: Sat, 18 Apr 2026 07:55:01 -0700 Subject: [PATCH 1/9] Update lint.yaml --- .github/workflows/lint.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 82644c9..b82ac6e 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -12,7 +12,7 @@ on: jobs: find: - name: Find add-ons + name: Find apps runs-on: ubuntu-latest outputs: addons: ${{ steps.addons.outputs.addons_list }} @@ -20,12 +20,12 @@ jobs: - name: โคต๏ธ Check out code from GitHub uses: actions/checkout@v6.0.2 - - name: ๐Ÿ” Find add-on directories + - name: ๐Ÿ” Find app directories id: addons uses: home-assistant/actions/helpers/find-addons@master lint: - name: Lint add-on ${{ matrix.path }} + name: Lint app ${{ matrix.path }} runs-on: ubuntu-latest needs: find strategy: @@ -35,7 +35,7 @@ jobs: - name: โคต๏ธ Check out code from GitHub uses: actions/checkout@v6.0.2 - - name: ๐Ÿš€ Run Home Assistant Add-on Lint + - name: ๐Ÿš€ Run Home Assistant App Lint uses: frenck/action-addon-linter@v2.21 with: path: "./${{ matrix.path }}" From 179cdf1ab8f74b133b2ab2f4d3bc9695c30d8009 Mon Sep 17 00:00:00 2001 From: WillCodeForCats <48533968+WillCodeForCats@users.noreply.github.com> Date: Sat, 18 Apr 2026 08:03:50 -0700 Subject: [PATCH 2/9] Update builder from home-assistant/apps-example --- .github/workflows/build-app.yaml | 115 ++++++++++++++++++++++++++++ .github/workflows/builder.yaml | 126 ++++++++++++------------------- 2 files changed, 163 insertions(+), 78 deletions(-) create mode 100644 .github/workflows/build-app.yaml diff --git a/.github/workflows/build-app.yaml b/.github/workflows/build-app.yaml new file mode 100644 index 0000000..dfdee9b --- /dev/null +++ b/.github/workflows/build-app.yaml @@ -0,0 +1,115 @@ +name: Build app + +on: + workflow_call: + inputs: + app: + required: true + type: string + publish: + required: true + type: boolean + +jobs: + prepare: + name: Prepare + if: github.repository == 'WillCodeForCats/tekmar-packetserv' + runs-on: ubuntu-latest + outputs: + architectures: ${{ steps.info.outputs.architectures }} + build_matrix: ${{ steps.matrix.outputs.matrix }} + image_name: ${{ steps.normalize.outputs.image_name }} + name: ${{ steps.normalize.outputs.name }} + description: ${{ steps.normalize.outputs.description }} + url: ${{ steps.normalize.outputs.url }} + registry_prefix: ${{ steps.normalize.outputs.registry_prefix }} + version: ${{ steps.normalize.outputs.version }} + steps: + - name: Check out the repository + uses: actions/checkout@v6.0.2 + + - name: Get app information + id: info + uses: home-assistant/actions/helpers/info@master + with: + path: "./${{ inputs.app }}" + + - name: Normalize app information + id: normalize + run: | + image=${{ steps.info.outputs.image }} + echo "image_name=${image##*/}" >> "$GITHUB_OUTPUT" + echo "registry_prefix=${image%/*}" >> "$GITHUB_OUTPUT" + version=${{ steps.info.outputs.version }} + echo "version=${version}" >> "$GITHUB_OUTPUT" + name=${{ steps.info.outputs.name }} + echo "name=${name}" >> "$GITHUB_OUTPUT" + description=${{ steps.info.outputs.description }} + echo "description=${description}" >> "$GITHUB_OUTPUT" + url=${{ steps.info.outputs.url }} + if [[ -n "$url" && "$url" != "null" ]]; then + echo "url=${url}" >> "$GITHUB_OUTPUT" + fi + + - name: Prepare build matrix + id: matrix + uses: home-assistant/builder/actions/prepare-multi-arch-matrix@2026.03.2 + with: + architectures: ${{ steps.info.outputs.architectures }} + image-name: ${{ steps.normalize.outputs.image_name }} + registry-prefix: ${{ steps.normalize.outputs.registry_prefix }} + + build: + name: Build ${{ matrix.arch }} image + needs: prepare + runs-on: ${{ matrix.os }} + permissions: + contents: read + id-token: write + packages: write + strategy: + fail-fast: false + matrix: ${{ fromJSON(needs.prepare.outputs.build_matrix) }} + steps: + - name: Check out the repository + uses: actions/checkout@v6.0.2 + with: + persist-credentials: false + + - name: Build image + uses: home-assistant/builder/actions/build-image@2026.03.2 + with: + arch: ${{ matrix.arch }} + container-registry-password: ${{ secrets.GITHUB_TOKEN }} + context: "./${{ inputs.app }}" + image: ${{ matrix.image }} + image-tags: | + ${{ needs.prepare.outputs.version }} + latest + labels: | + io.hass.type=app + io.hass.name=${{ needs.prepare.outputs.name }} + io.hass.description=${{ needs.prepare.outputs.description }} + ${{ needs.prepare.outputs.url && format('io.hass.url={0}', needs.prepare.outputs.url) || '' }} + push: ${{ inputs.publish }} + version: ${{ needs.prepare.outputs.version }} + + manifest: + name: Publish multi-arch manifest + needs: [prepare, build] + if: inputs.publish + runs-on: ubuntu-latest + permissions: + id-token: write + packages: write + steps: + - name: Publish multi-arch manifest + uses: home-assistant/builder/actions/publish-multi-arch-manifest@2026.03.2 + with: + architectures: ${{ needs.prepare.outputs.architectures }} + container-registry-password: ${{ secrets.GITHUB_TOKEN }} + image-name: ${{ needs.prepare.outputs.image_name }} + image-tags: | + ${{ needs.prepare.outputs.version }} + latest + registry-prefix: ${{ needs.prepare.outputs.registry_prefix }} diff --git a/.github/workflows/builder.yaml b/.github/workflows/builder.yaml index d207ec9..5ba31eb 100644 --- a/.github/workflows/builder.yaml +++ b/.github/workflows/builder.yaml @@ -1,24 +1,26 @@ name: Builder env: - BUILD_ARGS: "--test" - MONITORED_FILES: "build.yaml config.json Dockerfile run.sh" + MONITORED_FILES: "config.json config.yaml config.yml Dockerfile rootfs" on: - push: + pull_request: branches: - main - pull_request: + push: branches: - main +permissions: + contents: read + jobs: init: - runs-on: ubuntu-latest name: Initialize builds + runs-on: ubuntu-latest outputs: - changed_addons: ${{ steps.changed_addons.outputs.addons }} - changed: ${{ steps.changed_addons.outputs.changed }} + changed: ${{ steps.filter.outputs.changed }} + changed_apps: ${{ steps.filter.outputs.changed_apps }} steps: - name: Check out the repository uses: actions/checkout@v6.0.2 @@ -27,85 +29,53 @@ jobs: id: changed_files uses: tj-actions/changed-files@v47 - - name: Find add-on directories - id: addons + - name: Find app directories + id: apps uses: home-assistant/actions/helpers/find-addons@master - - name: Get changed add-ons - id: changed_addons + - name: Filter changed apps + id: filter + env: + APPS: ${{ steps.apps.outputs.addons }} + CHANGED_FILES: ${{ steps.changed_files.outputs.all_changed_files }} run: | - declare -a changed_addons - for addon in ${{ steps.addons.outputs.addons }}; do - if [[ "${{ steps.changed_files.outputs.all_changed_files }}" =~ $addon ]]; then - for file in ${{ env.MONITORED_FILES }}; do - if [[ "${{ steps.changed_files.outputs.all_changed_files }}" =~ $addon/$file ]]; then - if [[ ! "${changed_addons[@]}" =~ $addon ]]; then - changed_addons+=("\"${addon}\","); - fi - fi - done - fi - done + changed_apps=() - changed=$(echo ${changed_addons[@]} | rev | cut -c 2- | rev) + # If the workflow file itself changed, rebuild all apps + if [[ "${CHANGED_FILES}" =~ \.github/workflows/(builder|build-app)\.yaml ]]; then + changed_apps=(${APPS}) + else + for app in ${APPS}; do + for file in ${MONITORED_FILES}; do + if [[ "${CHANGED_FILES}" =~ ${app}/${file} ]]; then + changed_apps+=("${app}") + break + fi + done + done + fi - if [[ -n ${changed} ]]; then - echo "Changed add-ons: $changed"; - echo "changed=true" >> $GITHUB_OUTPUT; - echo "addons=[$changed]" >> $GITHUB_OUTPUT; + if [[ ${#changed_apps[@]} -gt 0 ]]; then + echo "changed=true" >> "$GITHUB_OUTPUT" + echo "changed_apps=$(jq -nc '$ARGS.positional' --args "${changed_apps[@]}")" >> "$GITHUB_OUTPUT" else - echo "No add-on had any monitored files changed (${{ env.MONITORED_FILES }})"; + echo "changed=false" >> "$GITHUB_OUTPUT" fi - build: + + build-app: + name: Build ${{ matrix.app }} needs: init - runs-on: ubuntu-latest if: needs.init.outputs.changed == 'true' - name: Build ${{ matrix.arch }} ${{ matrix.addon }} add-on + permissions: + contents: read + id-token: write + packages: write strategy: + fail-fast: false matrix: - addon: ${{ fromJson(needs.init.outputs.changed_addons) }} - arch: ["aarch64", "amd64"] - - steps: - - name: Check out repository - uses: actions/checkout@v6.0.2 - - - 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 - run: | - if [[ "${{ steps.info.outputs.architectures }}" =~ ${{ matrix.arch }} ]]; then - echo "build_arch=true" >> $GITHUB_OUTPUT; - echo "image=$(echo ${{ steps.info.outputs.image }} | cut -d'/' -f3)" >> $GITHUB_OUTPUT; - if [[ -z "${{ github.head_ref }}" ]] && [[ "${{ github.event_name }}" == "push" ]]; then - echo "BUILD_ARGS=" >> $GITHUB_ENV; - fi - else - echo "${{ matrix.arch }} is not a valid arch for ${{ matrix.addon }}, skipping build"; - echo "build_arch=false" >> $GITHUB_OUTPUT; - fi - - - name: Login to GitHub Container Registry - if: env.BUILD_ARGS != '--test' - uses: docker/login-action@v4.1.0 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build ${{ matrix.addon }} add-on - if: steps.check.outputs.build_arch == 'true' - uses: home-assistant/builder@2026.03.2 - with: - args: | - ${{ env.BUILD_ARGS }} \ - --${{ matrix.arch }} \ - --target /data/${{ matrix.addon }} \ - --image "${{ steps.check.outputs.image }}" \ - --docker-hub "ghcr.io/${{ github.repository_owner }}" \ - --addon + app: ${{ fromJSON(needs.init.outputs.changed_apps) }} + uses: ./.github/workflows/build-app.yaml + with: + app: ${{ matrix.app }} + publish: ${{ github.event_name == 'push' }} + secrets: inherit From 562084477a62cac88e2e9f84f37c68bdc067add2 Mon Sep 17 00:00:00 2001 From: WillCodeForCats <48533968+WillCodeForCats@users.noreply.github.com> Date: Sat, 18 Apr 2026 08:04:10 -0700 Subject: [PATCH 3/9] Merge build.yaml into Dockerfile --- tekmar_packetserv/Dockerfile | 10 ++++++++-- tekmar_packetserv/build.yaml | 9 --------- 2 files changed, 8 insertions(+), 11 deletions(-) delete mode 100644 tekmar_packetserv/build.yaml diff --git a/tekmar_packetserv/Dockerfile b/tekmar_packetserv/Dockerfile index 543a8ad..78ae333 100755 --- a/tekmar_packetserv/Dockerfile +++ b/tekmar_packetserv/Dockerfile @@ -1,5 +1,5 @@ -ARG BUILD_FROM -FROM $BUILD_FROM +ARG BUILD_FROM=ghcr.io/home-assistant/base:3.18 +FROM ${BUILD_FROM} # Add env ENV LANG=C.UTF-8 @@ -9,3 +9,9 @@ RUN apk add --no-cache python3 py3-pyserial # Copy data COPY rootfs / + +LABEL \ + org.opencontainers.image.title: "Home Assistant App: Tekmar Packet Server" + org.opencontainers.image.description: "Communicate with the Tekmar Gateway 482" + org.opencontainers.image.source: "https://github.com/WillCodeForCats/tekmar-packetserv" + org.opencontainers.image.licenses: "MIT License" diff --git a/tekmar_packetserv/build.yaml b/tekmar_packetserv/build.yaml deleted file mode 100644 index 62d6e17..0000000 --- a/tekmar_packetserv/build.yaml +++ /dev/null @@ -1,9 +0,0 @@ -# https://developers.home-assistant.io/docs/apps/configuration/#app-dockerfile -build_from: - aarch64: "ghcr.io/home-assistant/aarch64-base:3.18" - amd64: "ghcr.io/home-assistant/amd64-base:3.18" -labels: - org.opencontainers.image.title: "Home Assistant App: Tekmar Packet Server" - org.opencontainers.image.description: "Communicate with the Tekmar Gateway 482" - org.opencontainers.image.source: "https://github.com/WillCodeForCats/tekmar-packetserv" - org.opencontainers.image.licenses: "MIT License" From ed8b60936f39ee8a070ed1bd2b07da004c06d8b1 Mon Sep 17 00:00:00 2001 From: WillCodeForCats <48533968+WillCodeForCats@users.noreply.github.com> Date: Sat, 18 Apr 2026 08:12:40 -0700 Subject: [PATCH 4/9] Update config.json --- tekmar_packetserv/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tekmar_packetserv/config.json b/tekmar_packetserv/config.json index 0e7adaa..8ca5f96 100755 --- a/tekmar_packetserv/config.json +++ b/tekmar_packetserv/config.json @@ -5,7 +5,7 @@ "slug": "tekmar_packetserv", "description": "Connect with the Tekmar Gateway 482", "arch": ["aarch64", "amd64"], - "image": "ghcr.io/willcodeforcats/{arch}-tekmar-packetserv", + "image": "ghcr.io/willcodeforcats/tekmar-packetserv", "init": false, "options": { "serial_mode": "Device", From 99c4628fff7e510f04754ee3a36468539b3d7959 Mon Sep 17 00:00:00 2001 From: WillCodeForCats <48533968+WillCodeForCats@users.noreply.github.com> Date: Sat, 18 Apr 2026 08:15:41 -0700 Subject: [PATCH 5/9] Update Dockerfile --- tekmar_packetserv/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tekmar_packetserv/Dockerfile b/tekmar_packetserv/Dockerfile index 78ae333..90ac732 100755 --- a/tekmar_packetserv/Dockerfile +++ b/tekmar_packetserv/Dockerfile @@ -11,7 +11,7 @@ RUN apk add --no-cache python3 py3-pyserial COPY rootfs / LABEL \ - org.opencontainers.image.title: "Home Assistant App: Tekmar Packet Server" - org.opencontainers.image.description: "Communicate with the Tekmar Gateway 482" - org.opencontainers.image.source: "https://github.com/WillCodeForCats/tekmar-packetserv" - org.opencontainers.image.licenses: "MIT License" + org.opencontainers.image.title: "Home Assistant App: Tekmar Packet Server" \ + org.opencontainers.image.description: "Communicate with the Tekmar Gateway 482" \ + org.opencontainers.image.source: "https://github.com/WillCodeForCats/tekmar-packetserv" \ + org.opencontainers.image.licenses: "MIT License" \ No newline at end of file From da1bae62b3a87ef5f33977108c2f262f8976bafc Mon Sep 17 00:00:00 2001 From: WillCodeForCats <48533968+WillCodeForCats@users.noreply.github.com> Date: Sat, 18 Apr 2026 08:18:34 -0700 Subject: [PATCH 6/9] Change to repository.yaml --- repository.json | 5 ----- repository.yaml | 3 +++ 2 files changed, 3 insertions(+), 5 deletions(-) delete mode 100644 repository.json create mode 100644 repository.yaml diff --git a/repository.json b/repository.json deleted file mode 100644 index 913e267..0000000 --- a/repository.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Tekmar Packet Server", - "url": "https://github.com/WillCodeForCats/tekmar-packetserv", - "maintainer": "Seth Mattinen " -} diff --git a/repository.yaml b/repository.yaml new file mode 100644 index 0000000..08ccfcb --- /dev/null +++ b/repository.yaml @@ -0,0 +1,3 @@ +name: Tekmar Packet Server +url: "https://github.com/WillCodeForCats/tekmar-packetserv" +maintainer: Seth Mattinen From c956f9f04b4b7aa3d4988ee183c34085940a2dcd Mon Sep 17 00:00:00 2001 From: WillCodeForCats <48533968+WillCodeForCats@users.noreply.github.com> Date: Sat, 18 Apr 2026 08:21:42 -0700 Subject: [PATCH 7/9] Use latest base image --- tekmar_packetserv/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tekmar_packetserv/Dockerfile b/tekmar_packetserv/Dockerfile index 90ac732..113aa81 100755 --- a/tekmar_packetserv/Dockerfile +++ b/tekmar_packetserv/Dockerfile @@ -1,4 +1,4 @@ -ARG BUILD_FROM=ghcr.io/home-assistant/base:3.18 +ARG BUILD_FROM=ghcr.io/home-assistant/base:3.23 FROM ${BUILD_FROM} # Add env From 86bc3ffb4397b48f58ae34e0af933712df7642d3 Mon Sep 17 00:00:00 2001 From: WillCodeForCats <48533968+WillCodeForCats@users.noreply.github.com> Date: Sat, 18 Apr 2026 08:46:52 -0700 Subject: [PATCH 8/9] Update Dockerfile --- tekmar_packetserv/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tekmar_packetserv/Dockerfile b/tekmar_packetserv/Dockerfile index 113aa81..3c4951c 100755 --- a/tekmar_packetserv/Dockerfile +++ b/tekmar_packetserv/Dockerfile @@ -11,7 +11,7 @@ RUN apk add --no-cache python3 py3-pyserial COPY rootfs / LABEL \ - org.opencontainers.image.title: "Home Assistant App: Tekmar Packet Server" \ - org.opencontainers.image.description: "Communicate with the Tekmar Gateway 482" \ - org.opencontainers.image.source: "https://github.com/WillCodeForCats/tekmar-packetserv" \ - org.opencontainers.image.licenses: "MIT License" \ No newline at end of file + org.opencontainers.image.title="Home Assistant App: Tekmar Packet Server" \ + org.opencontainers.image.description="Communicate with the Tekmar Gateway 482" \ + org.opencontainers.image.source="https://github.com/WillCodeForCats/tekmar-packetserv" \ + org.opencontainers.image.licenses="MIT License" \ No newline at end of file From 50ba33110d364e1b9d31d1352d7689113e513b4a Mon Sep 17 00:00:00 2001 From: WillCodeForCats <48533968+WillCodeForCats@users.noreply.github.com> Date: Sat, 18 Apr 2026 12:32:31 -0700 Subject: [PATCH 9/9] Build 1.3.3 --- tekmar_packetserv/CHANGELOG.md | 6 ++++++ tekmar_packetserv/config.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tekmar_packetserv/CHANGELOG.md b/tekmar_packetserv/CHANGELOG.md index 216e308..cfabcdb 100644 --- a/tekmar_packetserv/CHANGELOG.md +++ b/tekmar_packetserv/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 1.3.3 +- Update to base 3.23 +- Addons are now Apps +- Bind socket to docker container IP +- Migrate from deprecated home-assistant/builder action + ## 1.3.2 - Detect IPv4 mapped IPv6 - Additional logging diff --git a/tekmar_packetserv/config.json b/tekmar_packetserv/config.json index 8ca5f96..2f85ebf 100755 --- a/tekmar_packetserv/config.json +++ b/tekmar_packetserv/config.json @@ -1,6 +1,6 @@ { "name": "Tekmar Packet Server", - "version": "1.3.2", + "version": "1.3.3", "url": "https://github.com/WillCodeForCats/tekmar-packetserv", "slug": "tekmar_packetserv", "description": "Connect with the Tekmar Gateway 482",