📦 Publish Flathub Release #376
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 📦 Publish Flathub Release | |
on: | |
schedule: | |
- cron: "0 0 * * *" # Every day at 12am UTC. | |
workflow_dispatch: # As well as manually. | |
jobs: | |
# check is disabled as the flathub api does not give us beta repository information | |
# Alternatively we can "flatpak remote-info or parse the appstream directly for the beta repo" | |
# Maybe in the future if we don't want to publish the same version twice if we get no commits | |
# for 24 hours. | |
# check: | |
# if: github.repository == 'PCSX2/pcsx2' | |
# name: "Check if release is needed" | |
# runs-on: ubuntu-latest | |
# timeout-minutes: 180 | |
# 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}'" | |
# PCSX2_RELEASE=$(echo $PCSX2_RELEASE | sed 's/[^0-9]*//g') | |
# FLATHUB_RELEASE=$(echo $FLATHUB_RELEASE | sed 's/[^0-9]*//g') | |
# echo "PCSX2_RELEASE=${PCSX2_RELEASE}" >> "$GITHUB_OUTPUT" | |
# echo "FLATHUB_RELEASE=${FLATHUB_RELEASE}" >> "$GITHUB_OUTPUT" | |
build: | |
# needs: check | |
# 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 | |
# if: fromJson(needs.check.outputs.FLATHUB_RELEASE) < fromJson(needs.check.outputs.PCSX2_RELEASE) | |
# As the check step is disabled, perform repository check here | |
if: github.repository == 'PCSX2/pcsx2' | |
name: "Build and publish Flatpak" | |
uses: ./.github/workflows/linux_build_flatpak.yml | |
with: | |
jobName: "Qt" | |
artifactPrefixName: "PCSX2-linux-Qt-x64-flatpak" | |
compiler: clang | |
cmakeflags: "" | |
publish: true | |
fetchTags: true | |
stableBuild: false | |
secrets: inherit | |