2828 outputs :
2929 lts_tag : ${{ steps.set_outputs.outputs.lts_tag }}
3030 release_tag : ${{ steps.set_outputs.outputs.release_tag }}
31+ python_version : ${{ steps.set_outputs.outputs.python_version }}
3132
3233 steps :
3334 - name : Checkout repository
@@ -94,24 +95,36 @@ jobs:
9495 fi
9596
9697 # Read LTS versions from config file (remove comments and empty lines)
97- LTS_VERSIONS=$(grep -v '^#' .github/lts-versions.txt | grep -v '^$' | tr '\n' '|' | sed 's/|$//')
98+ # Format: major.minor:python_version
99+ LTS_ENTRIES=$(grep -v '^#' .github/lts-versions.txt | grep -v '^$')
98100
99- if [ -z "$LTS_VERSIONS " ]; then
101+ if [ -z "$LTS_ENTRIES " ]; then
100102 echo "No LTS versions configured in .github/lts-versions.txt"
101103 echo "skip=true" >> "$GITHUB_OUTPUT"
102104 exit 0
103105 fi
104106
105- echo "Configured LTS versions : $LTS_VERSIONS "
107+ echo "Configured LTS entries : $LTS_ENTRIES "
106108 echo "Checking release: $RELEASE_TAG"
107109
108110 # Extract major.minor from release tag
109111 SHORT_TAG=$(echo "$RELEASE_TAG" | cut -d. -f1,2)
110112
111- # Check if it matches any LTS version pattern
112- if echo "$SHORT_TAG" | grep -qE "^($LTS_VERSIONS)$"; then
113- echo "Release $RELEASE_TAG matches LTS version $SHORT_TAG"
113+ # Check if it matches any LTS version pattern and extract python version
114+ PYTHON_VERSION=""
115+ while IFS= read -r entry; do
116+ LTS_VER=$(echo "$entry" | cut -d: -f1)
117+ PY_VER=$(echo "$entry" | cut -d: -f2)
118+ if [ "$SHORT_TAG" == "$LTS_VER" ]; then
119+ PYTHON_VERSION="$PY_VER"
120+ break
121+ fi
122+ done <<< "$LTS_ENTRIES"
123+
124+ if [ -n "$PYTHON_VERSION" ]; then
125+ echo "Release $RELEASE_TAG matches LTS version $SHORT_TAG (python $PYTHON_VERSION)"
114126 echo "skip=false" >> "$GITHUB_OUTPUT"
127+ echo "python_version=$PYTHON_VERSION" >> "$GITHUB_OUTPUT"
115128 else
116129 echo "Release $RELEASE_TAG (version $SHORT_TAG) is not configured as LTS"
117130 echo "skip=true" >> "$GITHUB_OUTPUT"
@@ -219,6 +232,7 @@ jobs:
219232 run : |
220233 echo "lts_tag=${{ steps.vars.outputs.LTS_TAG }}" >> "$GITHUB_OUTPUT"
221234 echo "release_tag=${{ steps.set_release_tag.outputs.release_tag }}" >> "$GITHUB_OUTPUT"
235+ echo "python_version=${{ steps.check_lts.outputs.python_version }}" >> "$GITHUB_OUTPUT"
222236 echo "Set job outputs for downstream job"
223237
224238 tag-lts-images :
@@ -232,7 +246,6 @@ jobs:
232246 packages : write
233247 strategy :
234248 matrix :
235- python-version : ["3.12", "3.13"]
236249 image-name : ["acapy-agent", "acapy-agent-bbs"]
237250
238251 steps :
@@ -249,8 +262,8 @@ jobs:
249262
250263 - name : Tag Images with LTS
251264 env :
252- SOURCE_TAG : py${{ matrix.python-version }}-${{ needs.recreate-lts-release.outputs.release_tag }}
253- LTS_TAG : py${{ matrix.python-version }}-${{ needs.recreate-lts-release.outputs.lts_tag }}
265+ SOURCE_TAG : py${{ needs.recreate-lts-release.outputs.python_version }}-${{ needs.recreate-lts-release.outputs.release_tag }}
266+ LTS_TAG : py${{ needs.recreate-lts-release.outputs.python_version }}-${{ needs.recreate-lts-release.outputs.lts_tag }}
254267 IMAGE_NAME : ghcr.io/${{ steps.lower.outputs.owner }}/${{ matrix.image-name }}
255268 run : |
256269 echo "Tagging \"$IMAGE_NAME:$SOURCE_TAG\" with \"$LTS_TAG\""
0 commit comments