diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 144e012..567f736 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,16 +6,69 @@ on: - main jobs: + detect-region-changes: + name: Detect changes to maas-region charm + runs-on: ubuntu-latest + outputs: + any_changed: ${{ steps.echo-changes.outputs.any_changed }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Determine changed files in the commit + id: changed-files + uses: tj-actions/changed-files@v44 + with: + files: | + maas-region/** + - name: Echo changed files + id: echo-changes + run: | + echo "Changes made: ${{ steps.changed-files.outputs.any_changed }}" + echo "Changed files: ${{ steps.changed-files.outputs.all_changed_files }}" + echo "any_changed=${{ steps.changed-files.outputs.any_changed }}" >> $GITHUB_OUTPUT + release-region: + name: Release MAAS Region charm to edge + needs: detect-region-changes + if: needs.detect-region-changes.outputs.any_changed == 'true' uses: canonical/observability/.github/workflows/charm-release.yaml@main secrets: inherit with: charm-path: maas-region provider: lxd + detect-agent-changes: + name: Detect changes to maas-agent charm + needs: release-region + if: always() && !failure() && !cancelled() + runs-on: ubuntu-latest + outputs: + any_changed: ${{ steps.echo-changes.outputs.any_changed }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Determine changed files in the commit + id: changed-files + uses: tj-actions/changed-files@v44 + with: + files: | + maas-agent/** + - name: Echo changed files + id: echo-changes + run: | + echo "Changes made: ${{ steps.changed-files.outputs.any_changed }}" + echo "Changed files: ${{ steps.changed-files.outputs.all_changed_files }}" + echo "any_changed=${{ steps.changed-files.outputs.any_changed }}" >> $GITHUB_OUTPUT + release-agent: + name: Release MAAS Agent charm to edge + needs: detect-agent-changes + if: needs.detect-agent-changes.outputs.any_changed == 'true' uses: canonical/observability/.github/workflows/charm-release.yaml@main - needs: release-region secrets: inherit with: charm-path: maas-agent