mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-26 18:43:39 +02:00
Add symlinks update
This commit is contained in:
34
.github/workflows/onpush_builder.yaml
vendored
34
.github/workflows/onpush_builder.yaml
vendored
@@ -21,7 +21,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: ↩️ Checkout
|
- name: ↩️ Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Update path_filters
|
- name: Update path_filters
|
||||||
run: |
|
run: |
|
||||||
# Init
|
# Init
|
||||||
@@ -30,11 +29,12 @@ jobs:
|
|||||||
# Go through all folders, add to filters if not existing
|
# Go through all folders, add to filters if not existing
|
||||||
for f in $( find -- * -maxdepth 0 -type d | sort -r ); do
|
for f in $( find -- * -maxdepth 0 -type d | sort -r ); do
|
||||||
if [ -f "$f"/config.json ]; then
|
if [ -f "$f"/config.json ]; then
|
||||||
|
|
||||||
# Add to file
|
# Add to file
|
||||||
if ! grep "$f:" ".github/paths-filter.yml"; then
|
if ! grep "$f:" ".github/paths-filter.yml"; then
|
||||||
echo "$f: $f/config.*" >> ".github/paths-filter.yml"
|
echo "$f: $f/config.*" >> ".github/paths-filter.yml"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Identify addons with true images
|
# Identify addons with true images
|
||||||
if [ "$(jq '.image' "$f/config.json")" != null ]; then
|
if [ "$(jq '.image' "$f/config.json")" != null ]; then
|
||||||
sed -i "/$f/ s/ # Image : yes//g" ".github/paths-filter.yml"
|
sed -i "/$f/ s/ # Image : yes//g" ".github/paths-filter.yml"
|
||||||
@@ -45,14 +45,12 @@ jobs:
|
|||||||
|
|
||||||
# Sort yaml
|
# Sort yaml
|
||||||
sort -t= ".github/paths-filter.yml" -o ".github/paths-filter.yml"
|
sort -t= ".github/paths-filter.yml" -o ".github/paths-filter.yml"
|
||||||
|
|
||||||
- name: Commit if needed
|
- name: Commit if needed
|
||||||
uses: EndBug/add-and-commit@v9
|
uses: EndBug/add-and-commit@v9
|
||||||
with:
|
with:
|
||||||
commit: -u
|
commit: -u
|
||||||
message: "GitHub bot : scripts executable"
|
message: "GitHub bot : scripts executable"
|
||||||
default_author: github_actions
|
default_author: github_actions
|
||||||
|
|
||||||
check-addon-changes:
|
check-addon-changes:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [correct_path_filters]
|
needs: [correct_path_filters]
|
||||||
@@ -61,7 +59,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: ↩️ Checkout
|
- name: ↩️ Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: 📂 Detect changed files
|
- name: 📂 Detect changed files
|
||||||
uses: dorny/paths-filter@v3
|
uses: dorny/paths-filter@v3
|
||||||
id: filter
|
id: filter
|
||||||
@@ -77,23 +74,24 @@ jobs:
|
|||||||
if: ${{ needs.check-addon-changes.outputs.changedAddons != '[]' }}
|
if: ${{ needs.check-addon-changes.outputs.changedAddons != '[]' }}
|
||||||
needs: [check-addon-changes, correct-CRLF]
|
needs: [check-addon-changes, correct-CRLF]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
addon: ${{ fromJSON(needs.check-addon-changes.outputs.changedAddons) }}
|
addon: ${{ fromJSON(needs.check-addon-changes.outputs.changedAddons) }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repo
|
- name: Checkout Repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Make scripts executable
|
- name: Make scripts executable
|
||||||
run: |
|
run: |
|
||||||
echo "Starting"
|
echo "Starting"
|
||||||
git pull origin master
|
git pull origin master
|
||||||
git config core.filemode true
|
git config core.filemode true
|
||||||
|
# shellcheck disable=SC2086,SC2046
|
||||||
|
#git update-index --chmod=+x $(find "$path" -type f -iname "*.sh")
|
||||||
chmod u+x $(find "$path" -type f -iname "*.sh") || true
|
chmod u+x $(find "$path" -type f -iname "*.sh") || true
|
||||||
env:
|
#git commit -am "fixing the script permissions..."
|
||||||
|
env:
|
||||||
path: "./${{ matrix.addon }}"
|
path: "./${{ matrix.addon }}"
|
||||||
|
|
||||||
- name: Commit if needed
|
- name: Commit if needed
|
||||||
uses: EndBug/add-and-commit@v9
|
uses: EndBug/add-and-commit@v9
|
||||||
with:
|
with:
|
||||||
@@ -111,7 +109,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: ↩️ Checkout
|
- name: ↩️ Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: 🔎 Run Home Assistant Add-on Lint
|
- name: 🔎 Run Home Assistant Add-on Lint
|
||||||
uses: frenck/action-addon-linter@v2
|
uses: frenck/action-addon-linter@v2
|
||||||
with:
|
with:
|
||||||
@@ -132,9 +129,6 @@ jobs:
|
|||||||
- name: Check out repository
|
- name: Check out repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
# ------------------------
|
|
||||||
# Resolve symlinks step
|
|
||||||
# ------------------------
|
|
||||||
- name: Resolve Symlinks
|
- name: Resolve Symlinks
|
||||||
run: |
|
run: |
|
||||||
# Find all symlinks and replace them with the real files or directories
|
# Find all symlinks and replace them with the real files or directories
|
||||||
@@ -162,15 +156,19 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
HEAD: "${{ github.head_ref }}"
|
HEAD: "${{ github.head_ref }}"
|
||||||
run: |
|
run: |
|
||||||
# shellcheck disable=SC2157,SC2086
|
# shellcheck disable=SC2157,SC2086
|
||||||
if [[ "${{ steps.info.outputs.architectures }}" =~ ${{ matrix.arch }} ]]; then
|
if [[ "${{ steps.info.outputs.architectures }}" =~ ${{ matrix.arch }} ]]; then
|
||||||
|
# shellcheck disable=SC2129
|
||||||
echo "build_arch=true" >> $GITHUB_OUTPUT;
|
echo "build_arch=true" >> $GITHUB_OUTPUT;
|
||||||
|
# shellcheck disable=SC2129
|
||||||
echo "image=$(echo ${{ steps.info.outputs.image }} | cut -d'/' -f3)" >> $GITHUB_OUTPUT;
|
echo "image=$(echo ${{ steps.info.outputs.image }} | cut -d'/' -f3)" >> $GITHUB_OUTPUT;
|
||||||
if [[ -z "$HEAD" ]] && [[ "${{ github.event_name }}" == "push" ]]; then
|
if [[ -z "$HEAD" ]] && [[ "${{ github.event_name }}" == "push" ]]; then
|
||||||
|
# shellcheck disable=SC2129
|
||||||
echo "BUILD_ARGS=" >> $GITHUB_ENV;
|
echo "BUILD_ARGS=" >> $GITHUB_ENV;
|
||||||
fi
|
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";
|
||||||
|
# shellcheck disable=SC2129
|
||||||
echo "build_arch=false" >> $GITHUB_OUTPUT;
|
echo "build_arch=false" >> $GITHUB_OUTPUT;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -210,10 +208,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout Repo
|
- name: Checkout Repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Update changelog for minor versions
|
- name: Update changelog for minor versions
|
||||||
run: |
|
run: |
|
||||||
echo "Starting"
|
echo "Starting"
|
||||||
|
# Git pull
|
||||||
git pull || true
|
git pull || true
|
||||||
cd "$path"
|
cd "$path"
|
||||||
# Get version
|
# Get version
|
||||||
@@ -225,13 +223,10 @@ jobs:
|
|||||||
else
|
else
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Exit if test
|
# Exit if test
|
||||||
if [[ "$version" == *"test"* ]]; then exit 0; fi
|
if [[ "$version" == *"test"* ]]; then exit 0; fi
|
||||||
|
|
||||||
# Create changelog
|
# Create changelog
|
||||||
touch CHANGELOG.md
|
touch CHANGELOG.md
|
||||||
|
|
||||||
# If the version does not exist
|
# If the version does not exist
|
||||||
if ! grep -q "$version" CHANGELOG.md; then
|
if ! grep -q "$version" CHANGELOG.md; then
|
||||||
first_line="$(sed -n '/./p' CHANGELOG.md | head -n 1)"
|
first_line="$(sed -n '/./p' CHANGELOG.md | head -n 1)"
|
||||||
@@ -240,8 +235,9 @@ jobs:
|
|||||||
sed -i "1i\- Minor bugs fixed" CHANGELOG.md
|
sed -i "1i\- Minor bugs fixed" CHANGELOG.md
|
||||||
fi
|
fi
|
||||||
sed -i "1i\## $version ($(date '+%d-%m-%Y'))" CHANGELOG.md
|
sed -i "1i\## $version ($(date '+%d-%m-%Y'))" CHANGELOG.md
|
||||||
|
#fi
|
||||||
fi
|
fi
|
||||||
env:
|
env:
|
||||||
path: "./${{ matrix.addon }}"
|
path: "./${{ matrix.addon }}"
|
||||||
- name: Commit if needed
|
- name: Commit if needed
|
||||||
uses: EndBug/add-and-commit@v9
|
uses: EndBug/add-and-commit@v9
|
||||||
|
|||||||
Reference in New Issue
Block a user