pcsx2/.github/workflows/scripts/linux/generate-metainfo.sh
Bart Piotrowski 19c3dd8419
ci: Switch Flatpak build to flathub-infra/flatpak-github-actions (#10838)
* ci: Switch Flatpak build to flathub-infra/flatpak-github-actions

Flathub team has recently forked flatpak-github-actions and merged
various PRs submitted to the original repo. However, it's not versioned
(yet?), so pin the latest commit instead.

Additionally, enable validation of the build using flatpak-builder-lint,
and run all steps in the container with the runtime and required tooling
baked in.

* Update mirror-screenshots-url

* Shush git complaining about "dubious" ownership

* Update date format to iso8601

* Fix flatpak-builder-lint invocations
2024-02-24 14:19:35 +10:00

32 lines
829 B
Bash
Executable file

#!/usr/bin/env bash
SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}")
if [[ $# -lt 1 ]]; then
echo "Output file must be provided as a parameter"
exit 1
fi
OUTFILE=$1
GIT_DATE=$(git log -1 --pretty=%cd --date=iso8601)
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}"
echo "GIT_HASH: ${GIT_HASH}"
cp "${SCRIPTDIR}"/pcsx2-qt.metainfo.xml.in "${OUTFILE}"
sed -i -e "s/@GIT_VERSION@/${GIT_VERSION}/" "${OUTFILE}"
sed -i -e "s/@GIT_DATE@/${GIT_DATE}/" "${OUTFILE}"
sed -i -e "s/@GIT_HASH@/${GIT_HASH}/" "${OUTFILE}"