ci: release 2.0.0 (#324) #12
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Release charm's libraries if they have changed | |
| name: Release Charm Library | |
| on: | |
| push: | |
| tags: | |
| - "v**" | |
| jobs: | |
| filter: | |
| name: Check if charm library changes between tags | |
| runs-on: ubuntu-latest | |
| outputs: | |
| run-release: ${{ steps.check.outputs.run_release }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check diff between latest two tags | |
| id: check | |
| run: | | |
| set -e | |
| TAGS=$(git tag --sort=-creatordate | grep "^v" | head -n 2) | |
| LATEST_TAG=$(echo "$TAGS" | sed -n 1p) | |
| PREV_TAG=$(echo "$TAGS" | sed -n 2p) | |
| echo "Latest tag: $LATEST_TAG" | |
| echo "Previous tag: $PREV_TAG" | |
| echo "run_release=false" >> $GITHUB_OUTPUT | |
| if git diff --name-only "$PREV_TAG" "$LATEST_TAG" | grep -q '^lib/charms/identity_platform_login_ui_operator/'; then | |
| echo "Changes found in charm library" | |
| echo "run_release=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "No changes found in charm library" | |
| fi | |
| release-lib: | |
| name: Release any bumped library | |
| needs: filter | |
| if: needs.filter.outputs.run-release == 'true' | |
| uses: canonical/identity-team/.github/workflows/charm-libs-release.yaml@2a4ae518f9c792dcdf14d05f8d86e3d72e160d96 # v1.9.0 | |
| secrets: | |
| CHARMCRAFT_CREDENTIALS: ${{ secrets.CHARMCRAFT_CREDENTIALS }} | |
| PAT_TOKEN: ${{ secrets.PAT_TOKEN }} |