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

@ -3,8 +3,8 @@
SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}")
if [[ $# -lt 1 ]]; then
echo "Output file must be provided as a parameter"
exit 1
echo "Output file must be provided as a parameter"
exit 1
fi
OUTFILE=$1
@ -13,7 +13,11 @@ GIT_VERSION=$(git tag --points-at HEAD)
GIT_HASH=$(git rev-parse HEAD)
if [[ "${GIT_VERSION}" == "" ]]; then
GIT_VERSION=$(git rev-parse HEAD)
# 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}"