mirror of https://github.com/PCSX2/pcsx2.git
CI/Linux: Publish Flathub builds daily [disabled for now]
This commit is contained in:
parent
db642b05c0
commit
e9c3807509
|
@ -0,0 +1,41 @@
|
||||||
|
name: 📦 Publish Flathub Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
#schedule:
|
||||||
|
# - cron: "0 0 * * *" # Every day at 12am UTC.
|
||||||
|
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}'"
|
||||||
|
echo "PCSX2_RELEASE=${PCSX2_RELEASE}" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "FLATHUB_RELEASE=${FLATHUB_RELEASE}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
build:
|
||||||
|
needs: check
|
||||||
|
if: needs.check.outputs.FLATHUB_RELEASE < needs.check.outputs.PCSX2_RELEASE
|
||||||
|
name: "Build and publish Flatpak"
|
||||||
|
uses: ./.github/workflows/linux_build_flatpak.yml
|
||||||
|
with:
|
||||||
|
jobName: "Qt"
|
||||||
|
compiler: clang
|
||||||
|
cmakeflags: ""
|
||||||
|
publish: true
|
||||||
|
branch: beta
|
||||||
|
secrets: inherit
|
||||||
|
|
|
@ -20,6 +20,10 @@ on:
|
||||||
cmakeflags:
|
cmakeflags:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
branch:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: "stable"
|
||||||
publish:
|
publish:
|
||||||
required: false
|
required: false
|
||||||
type: boolean
|
type: boolean
|
||||||
|
@ -84,7 +88,7 @@ jobs:
|
||||||
build-bundle: true
|
build-bundle: true
|
||||||
verbose: true
|
verbose: true
|
||||||
mirror-screenshots-url: https://dl.flathub.org/repo/screenshots
|
mirror-screenshots-url: https://dl.flathub.org/repo/screenshots
|
||||||
branch: beta
|
branch: ${{ inputs.branch }}
|
||||||
cache: true
|
cache: true
|
||||||
restore-cache: true
|
restore-cache: true
|
||||||
cache-key: ${{ inputs.os }} ${{ inputs.platform }} ${{ inputs.compiler }} ${{ inputs.detail }} flatpak ${{ hashFiles('.github/workflows/scripts/linux/flatpak/**/*.json') }}
|
cache-key: ${{ inputs.os }} ${{ inputs.platform }} ${{ inputs.compiler }} ${{ inputs.detail }} flatpak ${{ hashFiles('.github/workflows/scripts/linux/flatpak/**/*.json') }}
|
||||||
|
@ -93,10 +97,19 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
ostree commit --repo=repo --canonical-permissions --branch=screenshots/x86_64 .github/workflows/scripts/linux/flatpak/screenshots
|
ostree commit --repo=repo --canonical-permissions --branch=screenshots/x86_64 .github/workflows/scripts/linux/flatpak/screenshots
|
||||||
|
|
||||||
- name: Push to Flathub
|
- name: Push to Flathub beta
|
||||||
if: inputs.publish == true
|
if: inputs.publish == true && inputs.branch == 'beta'
|
||||||
uses: flatpak/flatpak-github-actions/flat-manager@v6.1
|
uses: flatpak/flatpak-github-actions/flat-manager@v6.1
|
||||||
with:
|
with:
|
||||||
flat-manager-url: https://hub.flathub.org/
|
flat-manager-url: https://hub.flathub.org/
|
||||||
repository: beta
|
repository: beta
|
||||||
token: ${{ secrets.FLATHUB_BETA_TOKEN }}
|
token: ${{ secrets.FLATHUB_BETA_TOKEN }}
|
||||||
|
|
||||||
|
- name: Push to Flathub stable
|
||||||
|
if: inputs.publish == true && inputs.branch == 'stable'
|
||||||
|
uses: flatpak/flatpak-github-actions/flat-manager@v6.1
|
||||||
|
with:
|
||||||
|
flat-manager-url: https://hub.flathub.org/
|
||||||
|
repository: stable
|
||||||
|
token: ${{ secrets.FLATHUB_TOKEN }}
|
||||||
|
|
||||||
|
|
|
@ -28,3 +28,4 @@ jobs:
|
||||||
compiler: clang
|
compiler: clang
|
||||||
cmakeflags: ""
|
cmakeflags: ""
|
||||||
publish: false
|
publish: false
|
||||||
|
secrets: inherit
|
||||||
|
|
|
@ -26,7 +26,8 @@ jobs:
|
||||||
jobName: "Flatpak"
|
jobName: "Flatpak"
|
||||||
compiler: clang
|
compiler: clang
|
||||||
cmakeflags: ""
|
cmakeflags: ""
|
||||||
publish: true
|
branch: "stable"
|
||||||
|
publish: false
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
# Windows
|
# Windows
|
||||||
|
|
Loading…
Reference in New Issue