mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-03-24 06:51:31 +01:00
Compare commits
1 Commits
copilot/ad
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a7e1822fbb |
2
.github/workflows/daily_README.yaml
vendored
2
.github/workflows/daily_README.yaml
vendored
@@ -228,7 +228,7 @@ jobs:
|
|||||||
echo "... done"
|
echo "... done"
|
||||||
|
|
||||||
- name: Commit if needed
|
- name: Commit if needed
|
||||||
uses: EndBug/add-and-commit@v10
|
uses: EndBug/add-and-commit@v9
|
||||||
with:
|
with:
|
||||||
message: "GitHub bot : README updated"
|
message: "GitHub bot : README updated"
|
||||||
default_author: github_actions
|
default_author: github_actions
|
||||||
|
|||||||
2
.github/workflows/helper_stats_graphs.yaml
vendored
2
.github/workflows/helper_stats_graphs.yaml
vendored
@@ -237,7 +237,7 @@ jobs:
|
|||||||
# Get stars evolution
|
# Get stars evolution
|
||||||
wget -S -O .github/starsevol.svg "https://api.star-history.com/svg?repos=alexbelgium/hassio-addons&type=Date" || true
|
wget -S -O .github/starsevol.svg "https://api.star-history.com/svg?repos=alexbelgium/hassio-addons&type=Date" || true
|
||||||
- name: Commit if needed
|
- name: Commit if needed
|
||||||
uses: EndBug/add-and-commit@v10
|
uses: EndBug/add-and-commit@v9
|
||||||
with:
|
with:
|
||||||
message: "GitHub bot : graphs updated"
|
message: "GitHub bot : graphs updated"
|
||||||
default_author: github_actions
|
default_author: github_actions
|
||||||
|
|||||||
2
.github/workflows/on_issues.yml
vendored
2
.github/workflows/on_issues.yml
vendored
@@ -59,7 +59,7 @@ jobs:
|
|||||||
# Remove issues list
|
# Remove issues list
|
||||||
rm issueslist
|
rm issueslist
|
||||||
- name: Commit if needed
|
- name: Commit if needed
|
||||||
uses: EndBug/add-and-commit@v10
|
uses: EndBug/add-and-commit@v9
|
||||||
with:
|
with:
|
||||||
message: "Github bot : issues linked to readme"
|
message: "Github bot : issues linked to readme"
|
||||||
default_author: github_actions
|
default_author: github_actions
|
||||||
|
|||||||
131
.github/workflows/onpush_builder.yaml
vendored
131
.github/workflows/onpush_builder.yaml
vendored
@@ -11,6 +11,9 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- "**/config.*"
|
- "**/config.*"
|
||||||
|
|
||||||
|
env:
|
||||||
|
BUILD_ARGS: ""
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# 1. Detect which add-on folders changed (by config.json|yaml|yml modification)
|
# 1. Detect which add-on folders changed (by config.json|yaml|yml modification)
|
||||||
detect-changed-addons:
|
detect-changed-addons:
|
||||||
@@ -78,7 +81,7 @@ jobs:
|
|||||||
# 4. Commit any changes we made
|
# 4. Commit any changes we made
|
||||||
# ────────────────────────────────────────────────────────────────
|
# ────────────────────────────────────────────────────────────────
|
||||||
- name: Commit if needed
|
- name: Commit if needed
|
||||||
uses: EndBug/add-and-commit@v10
|
uses: EndBug/add-and-commit@v9
|
||||||
with:
|
with:
|
||||||
commit: -u
|
commit: -u
|
||||||
message: "GitHub bot: sanitize (spaces + LF endings) & chmod"
|
message: "GitHub bot: sanitize (spaces + LF endings) & chmod"
|
||||||
@@ -103,26 +106,16 @@ jobs:
|
|||||||
path: "./${{ matrix.addon }}"
|
path: "./${{ matrix.addon }}"
|
||||||
|
|
||||||
# 4. Build images for changed addons/arches
|
# 4. Build images for changed addons/arches
|
||||||
# Uses composable actions from home-assistant/builder (2026.03.2+)
|
|
||||||
# which replaced the deprecated home-assistant/builder action.
|
|
||||||
build:
|
build:
|
||||||
if: ${{ needs.detect-changed-addons.outputs.changedAddons != '' && needs.detect-changed-addons.outputs.changedAddons != '[]' }}
|
if: ${{ needs.detect-changed-addons.outputs.changedAddons != '' && needs.detect-changed-addons.outputs.changedAddons != '[]' }}
|
||||||
needs: [detect-changed-addons, lint_config]
|
needs: [detect-changed-addons, lint_config]
|
||||||
runs-on: ${{ matrix.runner }}
|
runs-on: ubuntu-latest
|
||||||
environment: CR_PAT
|
environment: CR_PAT
|
||||||
name: Build ${{ matrix.arch }} ${{ matrix.addon }} add-on
|
name: Build ${{ matrix.arch }} ${{ matrix.addon }} add-on
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
addon: ${{ fromJSON(needs.detect-changed-addons.outputs.changedAddons) }}
|
addon: ${{ fromJSON(needs.detect-changed-addons.outputs.changedAddons) }}
|
||||||
arch: ["aarch64", "amd64"]
|
arch: ["aarch64", "amd64"]
|
||||||
include:
|
|
||||||
- arch: amd64
|
|
||||||
runner: ubuntu-24.04
|
|
||||||
- arch: aarch64
|
|
||||||
runner: ubuntu-24.04-arm
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
- name: Resolve Symlinks (in repo)
|
- name: Resolve Symlinks (in repo)
|
||||||
@@ -141,70 +134,11 @@ jobs:
|
|||||||
cp "$target" "$link"
|
cp "$target" "$link"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
- name: Get addon info
|
- name: Get information
|
||||||
id: info
|
id: info
|
||||||
env:
|
uses: home-assistant/actions/helpers/info@master
|
||||||
ADDON: ${{ matrix.addon }}
|
with:
|
||||||
ARCH: ${{ matrix.arch }}
|
path: "./${{ matrix.addon }}"
|
||||||
run: |
|
|
||||||
cd "./$ADDON"
|
|
||||||
|
|
||||||
# --- Read config file (json/yaml/yml) ---
|
|
||||||
version="" image="" name="" description="" arch_list="[]"
|
|
||||||
for ext in json yaml yml; do
|
|
||||||
if [ -f "config.$ext" ]; then
|
|
||||||
if [ "$ext" = "json" ]; then
|
|
||||||
version=$(jq -r '.version // ""' "config.$ext")
|
|
||||||
image=$(jq -r '.image // ""' "config.$ext")
|
|
||||||
name=$(jq -r '.name // ""' "config.$ext")
|
|
||||||
description=$(jq -r '.description // ""' "config.$ext")
|
|
||||||
arch_list=$(jq -c '.arch // []' "config.$ext")
|
|
||||||
else
|
|
||||||
version=$(grep -m1 '^version:' "config.$ext" | sed 's/^version:[[:space:]]*//' | tr -d "\"'")
|
|
||||||
image=$(grep -m1 '^image:' "config.$ext" | sed 's/^image:[[:space:]]*//' | tr -d "\"'")
|
|
||||||
name=$(grep -m1 '^name:' "config.$ext" | sed 's/^name:[[:space:]]*//' | tr -d "\"'")
|
|
||||||
description=$(grep -m1 '^description:' "config.$ext" | sed 's/^description:[[:space:]]*//' | tr -d "\"'")
|
|
||||||
arch_list=$(sed -n '/^arch:/,/^[^ -]/p' "config.$ext" | grep '^ *-' | sed 's/^ *- *//' | tr -d "\"'" | jq -R -s -c 'split("\n") | map(select(length > 0))')
|
|
||||||
fi
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# --- Read build config for build_from (json/yaml/yml) ---
|
|
||||||
build_from="" build_archs=""
|
|
||||||
for ext in json yaml yml; do
|
|
||||||
if [ -f "build.$ext" ]; then
|
|
||||||
if [ "$ext" = "json" ]; then
|
|
||||||
build_from=$(jq -r ".build_from.\"$ARCH\" // \"\"" "build.$ext")
|
|
||||||
build_archs=$(jq -c '.build_from | keys' "build.$ext")
|
|
||||||
else
|
|
||||||
build_from=$(sed -n "/^build_from:/,/^[^ ]/p" "build.$ext" | grep -E "^[[:space:]]+${ARCH}:" | sed "s/^[[:space:]]*${ARCH}:[[:space:]]*//" | tr -d "\"'")
|
|
||||||
build_archs=$(sed -n '/^build_from:/,/^[^ ]/p' "build.$ext" | grep '^ ' | sed 's/:.*//' | tr -d ' ' | jq -R -s -c 'split("\n") | map(select(length > 0))')
|
|
||||||
fi
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Use build config architectures if available (overrides config arch list)
|
|
||||||
if [ -n "$build_archs" ] && [ "$build_archs" != "[]" ]; then
|
|
||||||
arch_list="$build_archs"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Resolve {arch} placeholder in image name
|
|
||||||
resolved_image="${image//\{arch\}/$ARCH}"
|
|
||||||
|
|
||||||
echo "version=$version" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "image=$resolved_image" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "name=$name" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "description=$description" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "architectures=$arch_list" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "build_from=$build_from" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
echo "Addon: $ADDON, Arch: $ARCH"
|
|
||||||
echo " Version: $version"
|
|
||||||
echo " Image: $resolved_image"
|
|
||||||
echo " Build from: $build_from"
|
|
||||||
echo " Architectures: $arch_list"
|
|
||||||
- name: Check if Dockerfile exists
|
- name: Check if Dockerfile exists
|
||||||
id: dockerfile_check
|
id: dockerfile_check
|
||||||
run: |
|
run: |
|
||||||
@@ -216,33 +150,40 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
- name: Check if add-on should be built for arch
|
- name: Check if add-on should be built for arch
|
||||||
id: check
|
id: check
|
||||||
|
env:
|
||||||
|
HEAD: "${{ github.head_ref }}"
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ steps.info.outputs.architectures }}" =~ ${{ matrix.arch }} ]]; then
|
if [[ "${{ steps.info.outputs.architectures }}" =~ ${{ matrix.arch }} ]]; then
|
||||||
echo "build_arch=true" >> "$GITHUB_OUTPUT";
|
echo "build_arch=true" >> "$GITHUB_OUTPUT";
|
||||||
|
echo "image=$(echo "${{ steps.info.outputs.image }}" | cut -d'/' -f3)" >> "$GITHUB_OUTPUT";
|
||||||
|
if [[ -z "$HEAD" ]] && [[ "${{ github.event_name }}" == "push" ]]; then
|
||||||
|
echo "BUILD_ARGS=" >> "$GITHUB_ENV";
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "${{ matrix.arch }} is not a valid arch for ${{ matrix.addon }}, skipping build";
|
echo "${{ matrix.arch }} is not a valid arch for ${{ matrix.addon }}, skipping build";
|
||||||
echo "build_arch=false" >> "$GITHUB_OUTPUT";
|
echo "build_arch=false" >> "$GITHUB_OUTPUT";
|
||||||
fi
|
fi
|
||||||
- name: Build ${{ matrix.addon }} add-on
|
- name: Login to GitHub Container Registry
|
||||||
if: steps.check.outputs.build_arch == 'true' && steps.dockerfile_check.outputs.has_dockerfile == 'true'
|
if: env.BUILD_ARGS != '--test'
|
||||||
uses: home-assistant/builder/actions/build-image@2026.03.2
|
uses: docker/login-action@v4.0.0
|
||||||
with:
|
with:
|
||||||
arch: ${{ matrix.arch }}
|
registry: ghcr.io
|
||||||
context: "./${{ matrix.addon }}"
|
username: ${{ github.repository_owner }}
|
||||||
image: ${{ steps.info.outputs.image }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
image-tags: |
|
- name: Build ${{ matrix.addon }} add-on (attempt 1)
|
||||||
${{ steps.info.outputs.version }}
|
id: builderstep1
|
||||||
latest
|
if: steps.check.outputs.build_arch == 'true' && steps.dockerfile_check.outputs.has_dockerfile == 'true'
|
||||||
version: ${{ steps.info.outputs.version }}
|
uses: home-assistant/builder@2026.03.2
|
||||||
push: "true"
|
env:
|
||||||
cosign: "false"
|
CAS_API_KEY: ${{ secrets.CAS_API_KEY }}
|
||||||
container-registry-password: ${{ secrets.GITHUB_TOKEN }}
|
with:
|
||||||
build-args: |
|
args: |
|
||||||
BUILD_FROM=${{ steps.info.outputs.build_from }}
|
${{ env.BUILD_ARGS }} \
|
||||||
BUILD_DESCRIPTION=${{ steps.info.outputs.description }}
|
--${{ matrix.arch }} \
|
||||||
BUILD_NAME=${{ steps.info.outputs.name }}
|
--target "/data/${{ matrix.addon }}" \
|
||||||
BUILD_REF=${{ github.sha }}
|
--image "${{ steps.check.outputs.image }}" \
|
||||||
BUILD_REPOSITORY=${{ github.repository }}
|
--docker-hub "ghcr.io/${{ github.repository_owner }}" \
|
||||||
|
--addon
|
||||||
|
|
||||||
# 5. Update changelog if needed (for each changed add-on)
|
# 5. Update changelog if needed (for each changed add-on)
|
||||||
make-changelog:
|
make-changelog:
|
||||||
@@ -282,7 +223,7 @@ jobs:
|
|||||||
sed -i "1i\## $version ($(date '+%d-%m-%Y'))" CHANGELOG.md
|
sed -i "1i\## $version ($(date '+%d-%m-%Y'))" CHANGELOG.md
|
||||||
fi
|
fi
|
||||||
- name: Commit if needed
|
- name: Commit if needed
|
||||||
uses: EndBug/add-and-commit@v10
|
uses: EndBug/add-and-commit@v9
|
||||||
with:
|
with:
|
||||||
commit: -u
|
commit: -u
|
||||||
message: "GitHub bot: changelog"
|
message: "GitHub bot: changelog"
|
||||||
|
|||||||
4
.github/workflows/weekly_crlftolf.yaml
vendored
4
.github/workflows/weekly_crlftolf.yaml
vendored
@@ -18,7 +18,7 @@ jobs:
|
|||||||
uses: erclu/check-crlf@v1
|
uses: erclu/check-crlf@v1
|
||||||
|
|
||||||
- name: Commit if needed
|
- name: Commit if needed
|
||||||
uses: EndBug/add-and-commit@v10
|
uses: EndBug/add-and-commit@v9
|
||||||
with:
|
with:
|
||||||
message: "Github bot : CRLF corrected"
|
message: "Github bot : CRLF corrected"
|
||||||
default_author: github_actions
|
default_author: github_actions
|
||||||
@@ -50,7 +50,7 @@ jobs:
|
|||||||
dos2unix -k "$f"
|
dos2unix -k "$f"
|
||||||
done
|
done
|
||||||
- name: Commit if needed
|
- name: Commit if needed
|
||||||
uses: EndBug/add-and-commit@v10
|
uses: EndBug/add-and-commit@v9
|
||||||
with:
|
with:
|
||||||
message: "Github bot : CRLF corrected"
|
message: "Github bot : CRLF corrected"
|
||||||
default_author: github_actions
|
default_author: github_actions
|
||||||
|
|||||||
2
.github/workflows/weekly_reduceimagesize.yml
vendored
2
.github/workflows/weekly_reduceimagesize.yml
vendored
@@ -31,7 +31,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Commit if needed
|
- name: Commit if needed
|
||||||
if: steps.calibre.outputs.markdown != ''
|
if: steps.calibre.outputs.markdown != ''
|
||||||
uses: EndBug/add-and-commit@v10
|
uses: EndBug/add-and-commit@v9
|
||||||
with:
|
with:
|
||||||
message: "Github bot : image compressed"
|
message: "Github bot : image compressed"
|
||||||
default_author: github_actions
|
default_author: github_actions
|
||||||
|
|||||||
2
.github/workflows/weekly_stats.yaml
vendored
2
.github/workflows/weekly_stats.yaml
vendored
@@ -109,7 +109,7 @@ jobs:
|
|||||||
#TOTAL3="$(awk '{SUM+=$2}END{print SUM}' Stats)"
|
#TOTAL3="$(awk '{SUM+=$2}END{print SUM}' Stats)"
|
||||||
|
|
||||||
- name: Commit if needed
|
- name: Commit if needed
|
||||||
uses: EndBug/add-and-commit@v10
|
uses: EndBug/add-and-commit@v9
|
||||||
with:
|
with:
|
||||||
default_author: github_actions
|
default_author: github_actions
|
||||||
message : "Github bot : stats updated"
|
message : "Github bot : stats updated"
|
||||||
|
|||||||
Reference in New Issue
Block a user