fixed runner dependency issue
This commit is contained in:
@@ -16,16 +16,15 @@
|
||||
# release — Supervisor pulls the image tag matching that version
|
||||
# exactly, so an unbumped version means it silently keeps using the
|
||||
# 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
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
# paths:
|
||||
# - "mqtt-cert-manager/**"
|
||||
# branches:
|
||||
# - main
|
||||
|
||||
env:
|
||||
REGISTRY_HOST: git.example.com
|
||||
@@ -33,7 +32,32 @@ env:
|
||||
IMAGE_NAME: mqtt-cert-manager
|
||||
|
||||
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:
|
||||
needs: check-branch
|
||||
if: needs.check-branch.outputs.on_main == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
@@ -56,18 +80,18 @@ jobs:
|
||||
|
||||
- name: Read add-on 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: |
|
||||
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"
|
||||
|
||||
- name: Read base image for this arch from build.yaml
|
||||
id: base
|
||||
run: |
|
||||
BUILD_FROM=$(python3 -c "
|
||||
import yaml
|
||||
d = yaml.safe_load(open('mqtt-cert-manager/build.yaml'))
|
||||
print(d['build_from']['${{ matrix.arch }}'])
|
||||
")
|
||||
BUILD_FROM=$(grep -E "^[[:space:]]*${{ matrix.arch }}:" mqtt-cert-manager/build.yaml | cut -d'"' -f2)
|
||||
echo "build_from=$BUILD_FROM" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Set up QEMU (needed to build non-amd64 targets on an amd64 runner)
|
||||
@@ -93,4 +117,4 @@ jobs:
|
||||
BUILD_FROM=${{ steps.base.outputs.build_from }}
|
||||
tags: |
|
||||
${{ env.REGISTRY_HOST }}/${{ env.REGISTRY_OWNER }}/${{ env.IMAGE_NAME }}-${{ matrix.arch }}:${{ steps.version.outputs.version }}
|
||||
${{ env.REGISTRY_HOST }}/${{ env.REGISTRY_OWNER }}/${{ env.IMAGE_NAME }}-${{ matrix.arch }}:latest
|
||||
${{ env.REGISTRY_HOST }}/${{ env.REGISTRY_OWNER }}/${{ env.IMAGE_NAME }}-${{ matrix.arch }}:latest
|
||||
@@ -1,5 +1,5 @@
|
||||
name: "MQTT Certificate Manager"
|
||||
version: "0.3.1"
|
||||
version: "0.3.2"
|
||||
slug: "mqtt_cert_manager"
|
||||
description: "Local CA that issues and manages TLS client certificates for MQTT nodes"
|
||||
url: "https://gitea.viratak.com/eta/mqtt-cert-manager"
|
||||
|
||||
Reference in New Issue
Block a user