Skip to content

Commit

Permalink
ci: release charms when files are changed (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
skatsaounis authored Apr 17, 2024
1 parent f7388fb commit ec77f1c
Showing 1 changed file with 54 additions and 1 deletion.
55 changes: 54 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ec77f1c

Please sign in to comment.