File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # Release login_ui_endpoints library only if it has changed
2- name : Release library
1+ # Release charm's libraries if they have changed
2+ name : Release Charm Library
33
44on :
55 push :
6- branches :
7- - main
8- paths :
9- - " lib/charms/identity_platform_login_ui_operator/**"
6+ tags :
7+ - " v**"
108
119jobs :
10+ filter :
11+ name : Check if charm library changes between tags
12+ runs-on : ubuntu-latest
13+ outputs :
14+ run-release : ${{ steps.check.outputs.run_release }}
15+ steps :
16+ - name : Checkout
17+ uses : actions/checkout@v4
18+ with :
19+ fetch-depth : 0
20+
21+ - name : Check diff between latest two tags
22+ id : check
23+ run : |
24+ set -e
25+
26+ TAGS=$(git tag --sort=-creatordate | grep "^v" | head -n 2)
27+ LATEST_TAG=$(echo "$TAGS" | sed -n 1p)
28+ PREV_TAG=$(echo "$TAGS" | sed -n 2p)
29+
30+ echo "Latest tag: $LATEST_TAG"
31+ echo "Previous tag: $PREV_TAG"
32+
33+ echo "run_release=false" >> $GITHUB_OUTPUT
34+
35+ if git diff --name-only "$PREV_TAG" "$LATEST_TAG" | grep -q '^lib/charms/identity_platform_login_ui_operator/'; then
36+ echo "Changes found in charm library"
37+ echo "run_release=true" >> $GITHUB_OUTPUT
38+ else
39+ echo "No changes found in charm library"
40+ fi
41+
1242 release-lib :
1343 name : Release any bumped library
44+ needs : filter
45+ if : needs.filter.outputs.run-release == 'true'
1446 uses : canonical/identity-team/.github/workflows/charm-libs-release.yaml@f18247249f506f3c9210b86e43a2c4dd063088c5 # v1.8.7
1547 secrets :
1648 CHARMCRAFT_CREDENTIALS : ${{ secrets.CHARMCRAFT_CREDENTIALS }}
You can’t perform that action at this time.
0 commit comments