Skip to content

DTEKInfo: Rework Nighttime (#9) #26

DTEKInfo: Rework Nighttime (#9)

DTEKInfo: Rework Nighttime (#9) #26

Workflow file for this run

name: Blackout / Builder
on:
push:
branches:
- master
paths-ignore:
- '.github/**'
workflow_call:
workflow_dispatch:
jobs:
addon_changes:
name: πŸ‘€ Check for Addon changes
runs-on: ubuntu-latest
outputs:
changed_config: ${{ steps.config.outputs.changes }}
changed_addons: ${{ steps.addons.outputs.changes }}
steps:
- name: ↩️ Git Checkout
uses: actions/checkout@v4
- name: πŸ”Ž Make Addon list
run: |
# Init
echo "Starting"
mkdir addon-list
touch addon-list/paths-config.yml
touch addon-list/paths-addons.yml
# Go through all folders, add to filters if not existing
for f in $( find -- * -maxdepth 0 -type d | sort -r ); do
if [ -f "$f"/config.yaml ]; then
# Add to file
if ! grep "$f:" "addon-list/paths-config.yml"; then
echo "$f: $f/config.*" >> "addon-list/paths-config.yml"
fi
if ! grep "$f:" "addon-list/paths-addons.yml"; then
echo "$f: $f/**" >> "addon-list/paths-addons.yml"
fi
fi
done
# Sort yaml
sort -t= "addon-list/paths-config.yml" -o "addon-list/paths-config.yml"
sort -t= "addon-list/paths-addons.yml" -o "addon-list/paths-addons.yml"
- name: βš™οΈ Detect changed configs
uses: dorny/paths-filter@v3
id: config
with:
filters: addon-list/paths-config.yml
- name: βš™οΈ Detect changed addons
uses: dorny/paths-filter@v3
id: addons
with:
filters: addon-list/paths-addons.yml
test:
if: ${{ needs.addon_changes.outputs.changed_addons != '[]' }}
name: πŸš€ Test ${{ matrix.addon }} add-on
needs:
- addon_changes
strategy:
matrix:
addon: ${{ fromJSON(needs.addon_changes.outputs.changed_addons) }}
uses: ./.github/workflows/docker_test.yml
with:
addon: ${{ matrix.addon }}
build:
if: ${{ needs.addon_changes.outputs.changed_config != '[]' }}
name: πŸš€ Build ${{ matrix.addon }} add-on
needs:
- test
- addon_changes
strategy:
matrix:
addon: ${{ fromJSON(needs.addon_changes.outputs.changed_config) }}
uses: ./.github/workflows/docker_build.yml
with:
addon: ${{ matrix.addon }}
permissions:
contents: read
packages: write
secrets: inherit
release:
name: πŸ“¦ Blackout / Release
runs-on: ubuntu-latest
needs:
- build
permissions:
contents: write
steps:
- name: Get Release Version
run: |
echo "version=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
id: version
- name: Get Release Tag
run: |
echo "tag=$(date +'%Y%m%d.%H%M')" >> $GITHUB_OUTPUT
id: tag
- name: Release
uses: softprops/action-gh-release@v2
with:
name: Blackout Addons - ${{steps.version.outputs.version}}
tag_name: v${{steps.tag.outputs.tag}}
generate_release_notes: true
ci-status:
name: 🎭 Status
runs-on: ubuntu-latest
needs:
- test
- build
if: always()
steps:
- name: πŸŽ‰ Success
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: ❌ Failure
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1