Skip to content

Commit

Permalink
remove init stage
Browse files Browse the repository at this point in the history
  • Loading branch information
besanur committed May 23, 2022
1 parent feac156 commit ab90a0b
Showing 1 changed file with 1 addition and 45 deletions.
46 changes: 1 addition & 45 deletions .github/workflows/builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,15 @@ on:
types: [created]

jobs:
init:
runs-on: ubuntu-latest
name: Initialize builds
outputs:
changed_addons: ${{ steps.changed_addons.outputs.addons }}
changed: ${{ steps.changed_addons.outputs.changed }}
steps:
- name: Check out the repository
uses: actions/checkout@v3.0.2

- name: Get changed files
id: changed_files
uses: jitterbit/get-changed-files@v1

- name: Find add-on directories
id: addons
uses: home-assistant/actions/helpers/find-addons@master

- name: Get changed add-ons
id: changed_addons
run: |
declare -a changed_addons
for addon in ${{ steps.addons.outputs.addons }}; do
if [[ "${{ steps.changed_files.outputs.all }}" =~ $addon ]]; then
for file in ${{ env.MONITORED_FILES }}; do
if [[ "${{ steps.changed_files.outputs.all }}" =~ $addon/$file ]]; then
if [[ ! "${changed_addons[@]}" =~ $addon ]]; then
changed_addons+=("\"${addon}\",");
fi
fi
done
fi
done
changed=$(echo ${changed_addons[@]} | rev | cut -c 2- | rev)
if [[ -n ${changed} ]]; then
echo "Changed add-ons: $changed";
echo "::set-output name=changed::true";
echo "::set-output name=addons::[$changed]";
else
echo "No add-on had any monitored files changed (${{ env.MONITORED_FILES }})";
fi
build:
needs: init
runs-on: ubuntu-latest
if: needs.init.outputs.changed == 'true'
name: Build ${{ matrix.arch }} ${{ matrix.addon }} add-on
permissions:
contents: read
packages: write
strategy:
matrix:
addon: ${{ fromJson(needs.init.outputs.changed_addons) }}
addon: ["prayer-times"]
arch: ["aarch64", "amd64"]

steps:
Expand Down

0 comments on commit ab90a0b

Please sign in to comment.