-
Notifications
You must be signed in to change notification settings - Fork 3
49 lines (41 loc) · 1.49 KB
/
release_libs.yaml
File metadata and controls
49 lines (41 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
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@59d4d2782bcb8fc2deea2aa08442e4c8603f2689 # v1.11.2
secrets:
CHARMCRAFT_CREDENTIALS: ${{ secrets.CHARMCRAFT_CREDENTIALS }}
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}