use git describe to find latest tag

This commit is contained in:
Mikio Stewart 2024-07-11 12:33:16 -07:00
parent 9d5b8fa0ca
commit b8a280e3a9

View file

@ -194,6 +194,7 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
ref: ${{ github.event.inputs.commit_hash }} ref: ${{ github.event.inputs.commit_hash }}
fetch-depth: 0
- name: Log in to the Container registry - name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
@ -208,9 +209,14 @@ jobs:
- name: Get LiteLLM Latest Tag - name: Get LiteLLM Latest Tag
id: current_app_tag id: current_app_tag
uses: WyriHaximus/github-action-get-previous-tag@v1.3.0 shell: bash
env: run: |
CHART_NAME: ${{ env.APP_NAME }} LATEST_TAG=$(git describe --tags --exclude "*dev*" --abbrev=0)
if [ -z "${LATEST_TAG}" ]; then
echo "latest_tag=latest" | tee -a $GITHUB_OUTPUT
else
echo "latest_tag=${LATEST_TAG}" | tee -a $GITHUB_OUTPUT
fi
- name: Get last published chart version - name: Get last published chart version
id: current_version id: current_version
@ -238,7 +244,7 @@ jobs:
name: ${{ env.CHART_NAME }} name: ${{ env.CHART_NAME }}
repository: ${{ env.REPO_OWNER }} repository: ${{ env.REPO_OWNER }}
tag: ${{ github.event.inputs.chartVersion || steps.bump_version.outputs.next-version || '0.1.0' }} tag: ${{ github.event.inputs.chartVersion || steps.bump_version.outputs.next-version || '0.1.0' }}
app_version: ${{ steps.current_app_tag.outputs.tag || 'latest' }} app_version: ${{ steps.current_app_tag.outputs.latest_tag || 'latest' }}
path: deploy/charts/${{ env.CHART_NAME }} path: deploy/charts/${{ env.CHART_NAME }}
registry: ${{ env.REGISTRY }} registry: ${{ env.REGISTRY }}
registry_username: ${{ github.actor }} registry_username: ${{ github.actor }}