CI/Linux: Hopefully fix Flathub release versioning

This commit is contained in:
Stenzek 2023-07-01 13:02:12 +10:00 committed by Connor McLaughlin
parent b431f1dc0d
commit 9d2d8c0713
2 changed files with 14 additions and 3 deletions

View File

@ -49,6 +49,13 @@ jobs:
with:
submodules: recursive
# Hackity hack. When running the workflow on a schedule, we don't have the tag,
# it doesn't fetch tags, therefore we don't get a version. So grab them manually.
- name: Fetch tags
if: inputs.publish == true
id: fetch-tags
run: git fetch --tags --no-recurse-submodules
- name: Prepare Artifact Metadata
id: artifact-metadata
shell: bash

View File

@ -12,9 +12,13 @@ GIT_DATE=$(git log -1 --pretty=%cd --date=short)
GIT_VERSION=$(git tag --points-at HEAD)
GIT_HASH=$(git rev-parse HEAD)
if [[ "${GIT_VERSION}" == "" ]]; then
# In the odd event that we run this script before the release gets tagged.
GIT_VERSION=$(git describe --tags)
if [[ "${GIT_VERSION}" == "" ]]; then
GIT_VERSION=$(git rev-parse HEAD)
fi
fi
echo "GIT_DATE: ${GIT_DATE}"
echo "GIT_VERSION: ${GIT_VERSION}"