From fd0dc9ab8eac81424216131bd9661238ebe8bc89 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Wed, 29 Jun 2022 20:02:15 -0400 Subject: [PATCH] Fix flatpak CI for outside pull requests --- .github/workflows/CI.yml | 16 ++++++---------- .../com.github.sunshinestream.sunshine.yml | 3 ++- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a6ee7c3b..a24a891c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -195,33 +195,29 @@ jobs: - name: Configure Flatpak Manifest run: | # variables for manifest - owner=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]' ) - repo=$(echo ${GITHUB_REPOSITORY#*/} | tr '[:upper:]' '[:lower:]' ) branch=${GITHUB_HEAD_REF} - commit=${{ github.event.pull_request.head.sha }} # check the branch variable if [ -z "$branch" ] then echo "This is a PUSH event" - branch=branch=${{ github.ref_name }} + branch=${{ github.ref_name }} commit=${{ github.sha }} + clone_url=${{ github.event.repository.clone_url }} else echo "This is a PR event" + commit=${{ github.event.pull_request.head.sha }} + clone_url=${{ github.event.pull_request.head.repo.clone_url }} fi - echo "Owner: ${owner}" - echo "Repo: ${repo}" echo "Branch: ${branch}" echo "Commit: ${commit}" + echo "Clone URL: ${clone_url}" mkdir -p build mkdir -p artifacts cd build - cmake -DGITHUB_OWNER=${owner} -DGITHUB_REPO=${repo} -DGITHUB_BRANCH=${branch} -DSUNSHINE_CONFIGURE_FLATPAK=ON -DSUNSHINE_CONFIGURE_ONLY=ON .. - - # add the commit - echo " commit: ${commit}" >> ./com.github.sunshinestream.sunshine.yml + cmake -DGITHUB_CLONE_URL=${clone_url} -DGITHUB_BRANCH=${branch} -DGITHUB_COMMIT=${commit} -DSUNSHINE_CONFIGURE_FLATPAK=ON -DSUNSHINE_CONFIGURE_ONLY=ON .. - name: Build Linux Flatpak working-directory: build diff --git a/packaging/linux/flatpak/com.github.sunshinestream.sunshine.yml b/packaging/linux/flatpak/com.github.sunshinestream.sunshine.yml index 08e47999..f2c297b6 100644 --- a/packaging/linux/flatpak/com.github.sunshinestream.sunshine.yml +++ b/packaging/linux/flatpak/com.github.sunshinestream.sunshine.yml @@ -206,5 +206,6 @@ modules: - -DSUNSHINE_ENABLE_CUDA=ON sources: - type: git - url: https://github.com/@GITHUB_OWNER@/@GITHUB_REPO@.git + url: @GITHUB_CLONE_URL@ branch: @GITHUB_BRANCH@ + commit: @GITHUB_COMMIT@