Compare commits

...

2 Commits

Author SHA1 Message Date
eta 32821d2604 set env vars in build and push
build-and-push / check-branch (push) Successful in 8s
build-and-push / build (amd64, linux/amd64) (push) Successful in 7m51s
2026-08-15 15:02:33 +03:30
eta e220b5a0c2 fixed runner dependency issue
build-and-push / check-branch (push) Successful in 9s
build-and-push / build (amd64, linux/amd64) (push) Failing after 5m35s
2026-08-15 13:13:50 +03:30
2 changed files with 38 additions and 14 deletions
+36 -12
View File
@@ -16,24 +16,48 @@
# release — Supervisor pulls the image tag matching that version # release — Supervisor pulls the image tag matching that version
# exactly, so an unbumped version means it silently keeps using the # exactly, so an unbumped version means it silently keeps using the
# old image. # old image.
#
# Triggers only on pushed tags matching "v*", and only builds if that
# tag's commit is actually part of main's history (see check-branch job).
name: build-and-push name: build-and-push
on: on:
push: push:
tags: tags:
- "v*" - "v*"
# paths:
# - "mqtt-cert-manager/**"
# branches:
# - main
env: env:
REGISTRY_HOST: git.example.com REGISTRY_HOST: gitea.viratak.com
REGISTRY_OWNER: YOUR_USER REGISTRY_OWNER: bitopa
IMAGE_NAME: mqtt-cert-manager IMAGE_NAME: mqtt-cert-manager
jobs: jobs:
check-branch:
runs-on: ubuntu-latest
outputs:
on_main: ${{ steps.check.outputs.on_main }}
steps:
- name: Checkout (full history)
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Make sure we have main's history too
run: git fetch origin main:refs/remotes/origin/main
- name: Is this tag's commit part of main?
id: check
run: |
if git merge-base --is-ancestor HEAD origin/main; then
echo "on_main=true" >> "$GITHUB_OUTPUT"
else
echo "on_main=false" >> "$GITHUB_OUTPUT"
echo "Tag $GITHUB_REF_NAME points to a commit that is not on main — skipping build."
fi
build: build:
needs: check-branch
if: needs.check-branch.outputs.on_main == 'true'
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
@@ -56,18 +80,18 @@ jobs:
- name: Read add-on version - name: Read add-on version
id: version id: version
# Plain shell instead of python3+PyYAML: the runner's Python has
# no yaml module installed, and this value is a simple one-liner
# anyway (version: "0.1.0"), so there's no need for a real YAML
# parser or an extra apt/pip install step just for this.
run: | run: |
VERSION=$(python3 -c "import yaml; print(yaml.safe_load(open('mqtt-cert-manager/config.yaml'))['version'])") VERSION=$(grep '^version:' mqtt-cert-manager/config.yaml | cut -d'"' -f2)
echo "version=$VERSION" >> "$GITHUB_OUTPUT" echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Read base image for this arch from build.yaml - name: Read base image for this arch from build.yaml
id: base id: base
run: | run: |
BUILD_FROM=$(python3 -c " BUILD_FROM=$(grep -E "^[[:space:]]*${{ matrix.arch }}:" mqtt-cert-manager/build.yaml | cut -d'"' -f2)
import yaml
d = yaml.safe_load(open('mqtt-cert-manager/build.yaml'))
print(d['build_from']['${{ matrix.arch }}'])
")
echo "build_from=$BUILD_FROM" >> "$GITHUB_OUTPUT" echo "build_from=$BUILD_FROM" >> "$GITHUB_OUTPUT"
- name: Set up QEMU (needed to build non-amd64 targets on an amd64 runner) - name: Set up QEMU (needed to build non-amd64 targets on an amd64 runner)
+1 -1
View File
@@ -1,5 +1,5 @@
name: "MQTT Certificate Manager" name: "MQTT Certificate Manager"
version: "0.3.1" version: "0.3.3"
slug: "mqtt_cert_manager" slug: "mqtt_cert_manager"
description: "Local CA that issues and manages TLS client certificates for MQTT nodes" description: "Local CA that issues and manages TLS client certificates for MQTT nodes"
url: "https://gitea.viratak.com/eta/mqtt-cert-manager" url: "https://gitea.viratak.com/eta/mqtt-cert-manager"