2023-06-29 14:42:41 +00:00
|
|
|
name: 📦 Publish Flathub Release
|
|
|
|
|
|
|
|
on:
|
2023-06-30 10:00:32 +00:00
|
|
|
schedule:
|
|
|
|
- cron: "0 0 * * *" # Every day at 12am UTC.
|
2023-06-29 14:42:41 +00:00
|
|
|
workflow_dispatch: # As well as manually.
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
check:
|
|
|
|
if: github.repository == 'PCSX2/pcsx2'
|
|
|
|
name: "Check if release is needed"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
PCSX2_RELEASE: ${{ steps.getinfo.outputs.PCSX2_RELEASE }}
|
|
|
|
FLATHUB_RELEASE: ${{ steps.getinfo.outputs.FLATHUB_RELEASE }}
|
|
|
|
steps:
|
|
|
|
- name: Get latest tag and Flathub release
|
|
|
|
id: getinfo
|
|
|
|
env:
|
|
|
|
GH_TOKEN: ${{ github.token }}
|
|
|
|
run: |
|
|
|
|
PCSX2_RELEASE=$(gh api -H 'Accept: application/vnd.github+json' -H 'X-GitHub-Api-Version: 2022-11-28' /repos/PCSX2/pcsx2/releases | jq -r '.[0].tag_name')
|
|
|
|
FLATHUB_RELEASE=$(curl -L -s https://flathub.org/api/v2/appstream/net.pcsx2.PCSX2 | jq -r '.releases | max_by(.version) | .version')
|
|
|
|
echo "Latest PCSX2 release is: '${PCSX2_RELEASE}'"
|
|
|
|
echo "Latest Flathub release is: '${FLATHUB_RELEASE}'"
|
2024-07-31 14:50:04 +00:00
|
|
|
PCSX2_RELEASE=$(echo $PCSX2_RELEASE | sed 's/[^0-9]*//g')
|
|
|
|
FLATHUB_RELEASE=$(echo $FLATHUB_RELEASE | sed 's/[^0-9]*//g')
|
2023-06-29 14:42:41 +00:00
|
|
|
echo "PCSX2_RELEASE=${PCSX2_RELEASE}" >> "$GITHUB_OUTPUT"
|
|
|
|
echo "FLATHUB_RELEASE=${FLATHUB_RELEASE}" >> "$GITHUB_OUTPUT"
|
|
|
|
|
|
|
|
build:
|
|
|
|
needs: check
|
2024-07-31 15:01:14 +00:00
|
|
|
# outputs are automatically compared as strings. This doesn't work in our favour
|
|
|
|
# Use fromJson() to convert them to proper integers...
|
|
|
|
# see: https://github.com/github/docs/pull/25870
|
|
|
|
# and: https://github.com/orgs/community/discussions/57480
|
2024-07-31 17:19:08 +00:00
|
|
|
#if: fromJson(needs.check.outputs.FLATHUB_RELEASE) < fromJson(needs.check.outputs.PCSX2_RELEASE)
|
2023-06-29 14:42:41 +00:00
|
|
|
name: "Build and publish Flatpak"
|
|
|
|
uses: ./.github/workflows/linux_build_flatpak.yml
|
|
|
|
with:
|
|
|
|
jobName: "Qt"
|
2024-01-11 00:04:42 +00:00
|
|
|
artifactPrefixName: "PCSX2-linux-Qt-x64-flatpak"
|
2023-06-29 14:42:41 +00:00
|
|
|
compiler: clang
|
|
|
|
cmakeflags: ""
|
|
|
|
publish: true
|
2023-06-30 10:00:32 +00:00
|
|
|
branch: stable
|
2023-07-28 11:48:35 +00:00
|
|
|
fetchTags: true
|
2023-06-29 14:42:41 +00:00
|
|
|
secrets: inherit
|
|
|
|
|