diff --git a/.github/workflows/builder.yaml b/.github/workflows/builder.yaml index 819481c..eb9ce18 100644 --- a/.github/workflows/builder.yaml +++ b/.github/workflows/builder.yaml @@ -17,8 +17,7 @@ jobs: runs-on: ubuntu-latest name: Initialize builds outputs: - changed_addons: ${{ steps.changed_addons.outputs.addons }} - changed: ${{ steps.changed_addons.outputs.changed }} + changed: ${{ steps.check.outputs.changed }} steps: - name: Check out the repository uses: actions/checkout@v4.1.2 @@ -27,43 +26,33 @@ jobs: 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 + - name: Check if monitored files changed + id: check 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 + declare -a changed + for file in ${{ env.MONITORED_FILES }}; do + if [[ -n ${changed} ]]; then + break fi - done - changed=$(echo ${changed_addons[@]} | rev | cut -c 2- | rev) + if [[ "${{ steps.changed_files.outputs.all }}" =~ $file ]]; then + changed=true + fi + done if [[ -n ${changed} ]]; then - echo "Changed add-ons: $changed"; - echo "::set-output name=changed::true"; - echo "::set-output name=addons::[$changed]"; + echo "A monitored file changed."; + echo "changed=true" >> $GITHUB_OUTPUT else - echo "No add-on had any monitored files changed (${{ env.MONITORED_FILES }})"; + echo "No monitored files changed."; fi build: needs: init runs-on: ubuntu-latest if: needs.init.outputs.changed == 'true' - name: Build ${{ matrix.arch }} ${{ matrix.addon }} add-on + name: Build add-on strategy: matrix: - addon: ${{ fromJson(needs.init.outputs.changed_addons) }} arch: ["amd64", "armv7", "aarch64"] steps: @@ -74,20 +63,20 @@ jobs: id: info uses: home-assistant/actions/helpers/info@master with: - path: "./${{ matrix.addon }}" + path: "./" - name: Check if add-on should be built id: check run: | if [[ "${{ steps.info.outputs.architectures }}" =~ ${{ matrix.arch }} ]]; then - echo "::set-output name=build_arch::true"; - echo "::set-output name=image::$(echo ${{ steps.info.outputs.image }} | cut -d'/' -f3)"; + echo "build_arch=true" >> $GITHUB_OUTPUT + echo "image=$(echo ${{ steps.info.outputs.image }} | cut -d'/' -f3)" >> $GITHUB_OUTPUT if [[ -z "${{ github.head_ref }}" ]] && [[ "${{ github.event_name }}" == "push" ]]; then echo "BUILD_ARGS=" >> $GITHUB_ENV; fi else - echo "${{ matrix.arch }} is not a valid arch for ${{ matrix.addon }}, skipping build"; - echo "::set-output name=build_arch::false"; + echo "${{ matrix.arch }} is not a valid arch for this add-on, skipping build"; + echo "build_arch=false" >> $GITHUB_OUTPUT fi - name: Login to GitHub Container Registry @@ -98,13 +87,13 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build ${{ matrix.addon }} add-on + - name: Build add-on if: steps.check.outputs.build_arch == 'true' uses: home-assistant/builder@master with: args: | ${{ env.BUILD_ARGS }} \ --${{ matrix.arch }} \ - --target /data/${{ matrix.addon }} \ + --target /data/ \ --image "${{ steps.check.outputs.image }}" \ --addon diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 4d21274..9df12ee 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -9,26 +9,9 @@ on: - main jobs: - find: - name: Find add-ons - runs-on: ubuntu-latest - outputs: - addons: ${{ steps.addons.outputs.addons_list }} - steps: - - name: ⤵️ Check out code from GitHub - uses: actions/checkout@v4.1.2 - - - name: 🔍 Find add-on directories - id: addons - uses: home-assistant/actions/helpers/find-addons@master - lint: - name: Lint add-on ${{ matrix.path }} + name: Lint add-on runs-on: ubuntu-latest - needs: find - strategy: - matrix: - path: ${{ fromJson(needs.find.outputs.addons) }} steps: - name: ⤵️ Check out code from GitHub uses: actions/checkout@v4.1.2 @@ -36,4 +19,4 @@ jobs: - name: 🚀 Run Home Assistant Add-on Lint uses: frenck/action-addon-linter@v2 with: - path: "./${{ matrix.path }}" + path: "./" diff --git a/README.md b/README.md index 4dd594f..0b4cd01 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ This addon allows you to run [Ghostfolio][] on your Home Assistant server based ![Ghostfolio Version](https://img.shields.io/badge/dynamic/json?label=Ghostfolio%20Version&url=https%3A%2F%2Fraw.githubusercontent.com%2Flildude%2Fha-addon-ghostfolio%2Fmain%2Fbuild.json&query=%24.args.ghostfolio_version) ![Ingress](https://img.shields.io/badge/dynamic/json?label=Ingress&query=%24.ingress&url=https%3A%2F%2Fraw.githubusercontent.com%2Flildude%2Fha-addon-ghostfolio%2Fmain%2Fconfig.json) -![Supported Architecture](https://img.shields.io/badge/dynamic/json?color=green&label=Arch&query=%24.arch&url=https%3A%2F%2Fraw.githubusercontent.com%2Flildude%2Fha-addon-ghostfolio%2Fmain%2Fconfig.json) +![Supported Architectures](https://img.shields.io/badge/dynamic/json?color=green&label=Arch&query=%24.arch&url=https%3A%2F%2Fraw.githubusercontent.com%2Flildude%2Fha-addon-ghostfolio%2Fmain%2Fconfig.json) | Light Mode | Dark Mode | | ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | diff --git a/build.json b/build.json index 86f47db..e4cd60b 100644 --- a/build.json +++ b/build.json @@ -8,7 +8,7 @@ "ghostfolio_version": "2.65.0" }, "labels": { - "org.opencontainers.image.title": "Home Assistant Add-on: Ghostfolio", + "org.opencontainers.image.title": "Home Assistant Add-on: Ghostfolio TESTME", "org.opencontainers.image.description": "Privacy-first, open source dashboard for your personal finances.", "org.opencontainers.image.source": "https://github.com/lildude/ha-addon-ghostfolio/", "org.opencontainers.image.licenses": "MIT" diff --git a/config.json b/config.json index c71b236..cdf0821 100644 --- a/config.json +++ b/config.json @@ -37,5 +37,5 @@ "jwt_secret_key": "str?" }, "codenotary": "colin@symr.io", - "image": "ghcr.io/lildude/ha-addon-ghostfolio/ghostfolio-{arch}" + "image": "ghcr.io/lildude/ha-addon-ghostfolio-{arch}" } \ No newline at end of file