diff --git a/.github/workflows/cooker-selfhosted.yml b/.github/workflows/cooker-selfhosted.yml index d3f7729e..26538dd2 100644 --- a/.github/workflows/cooker-selfhosted.yml +++ b/.github/workflows/cooker-selfhosted.yml @@ -32,7 +32,7 @@ jobs: - name: Generate build ID id: generating_buildid - run: echo "##[set-output name=build-id;]$(echo "${{ steps.extract_branch.outputs.branch }}-${{ steps.date.outputs.date }}")" + run: echo "##[set-output name=build-id;]$(echo "$( git rev-parse --short HEAD )")" - uses: actions/checkout@v3 @@ -55,19 +55,21 @@ jobs: run: | flatpak-builder --user --force-clean --install-deps-from=flathub --install-deps-from=flathub-beta --repo=${GITHUB_WORKSPACE}/local ${GITHUB_WORKSPACE}/retrodeck-flatpak-cooker net.retrodeck.retrodeck.yml + - name: Create Artifact for flathub + run: | + tar -czf ${GITHUB_WORKSPACE}/RetroDECK-Artifact.tar.gz -C ${GITHUB_WORKSPACE}/retrodeck-flatpak-cooker . + hash=($(sha256sum ${GITHUB_WORKSPACE}/RetroDECK-Artifact.tar.gz)) + echo $hash > ${GITHUB_WORKSPACE}/RetroDECK-Artifact.sha + mv -f RetroDECK-Artifact.* ${{ secrets.ARTIFACT_REPO }} + continue-on-error: true + - name: Create Bundle run: | - flatpak-builder --user --force-clean --repo=${GITHUB_WORKSPACE}/local ${GITHUB_WORKSPACE}/retrodeck-flatpak-cooker net.retrodeck.retrodeck.yml - flatpak build-bundle $GITHUB_WORKSPACE/local RetroDECK.flatpak net.retrodeck.retrodeck - - - name: Read version from version file - id: version - run: echo "##[set-output name=version;]$(cat $(find . -name version))" + flatpak build-bundle ${GITHUB_WORKSPACE}/local RetroDECK.flatpak net.retrodeck.retrodeck - name: Publish the flatpak in a new cooker release uses: ncipollo/release-action@v1 with: - #tag: "${{ steps.version.outputs.version }}" tag: "${{ steps.generating_buildid.outputs.build-id }}" body: | # Release Notes (Cooker) @@ -76,7 +78,7 @@ jobs: Cooker channel is provided for the community to test fixes and explore new functionality. Please DO NOT open issues or ask support on this build. - artifacts: "RetroDECK.flatpak" + artifacts: "RetroDECK.flatpak,RetroDECK-Artifact.tar.gz" allowUpdates: true prerelease: true draft: false @@ -90,4 +92,4 @@ jobs: with: name: retrodeck-flatpak path: RetroDECK.flatpak - continue-on-error: true + continue-on-error: true \ No newline at end of file diff --git a/.github/workflows/flathub_push_cooker.yml b/.github/workflows/flathub_push_cooker.yml index 788a47f9..213825ea 100644 --- a/.github/workflows/flathub_push_cooker.yml +++ b/.github/workflows/flathub_push_cooker.yml @@ -2,13 +2,6 @@ name: PUSH-cooker-flathub on: -# push: -# branches: -# - cooker* -# pull_request: -# branches: -# - cooker* - workflow_dispatch: jobs: @@ -19,12 +12,11 @@ jobs: - name: Pushing shell: bash run: | - # EDITABLES: - rd_branch="cooker" - gits_folder="${GITHUB_WORKSPACE}/gits" # without last / - # NON-EDITABLES - branch="$rd_branch-"$(date +%d%m%y.%H%M) + # EDITABLES: + rd_branch=${GITHUB_REF_NAME} + echo $rd_branch + gits_folder="${GITHUB_WORKSPACE}/gits" # without last / mkdir -vp $gits_folder cd $gits_folder @@ -35,6 +27,11 @@ jobs: cd $gits_folder git clone --recursive https://github.com/XargonWan/RetroDECK RetroDECK cd $gits_folder/RetroDECK + + # NON-EDITABLES + #relname="$rd_branch-"$(date +%d%m%y.%H%M) + relname="cooker-"$(git rev-parse --short HEAD) + git checkout $rd_branch git submodule init git submodule update @@ -43,47 +40,49 @@ jobs: #sync -rav --progress --exclude={'res/screenshots/','shared-modules/','rd-submodules/retroarch','.git/','docs','retrodeck-flatpak/','retrodeck-flatpak-cooker/','.flatpak-builder/'} ~/RetroDECK/ ~/flathub/ cd $gits_folder/flathub - git checkout -b $branch + + git checkout -b $relname + git rm -rf * git clean -fxd # restroing git index # Copying only a few files as the others are cloned by git in retrodeck.sh cd $gits_folder/RetroDECK cp -rf \ - 'rd-submodules' \ 'flathub.json' \ 'LICENSE' \ - 'net.retrodeck.retrodeck.appdata.xml' \ - 'net.retrodeck.retrodeck.desktop' \ - 'net.retrodeck.retrodeck.yml' \ + 'flathub.yml' \ 'README.md' \ $gits_folder/flathub/ cd $gits_folder/flathub - ls -la + ls -lah - if [ -d .git/modules ]; then - rm -rfv .git/modules/* - fi + # manipulating manifest + mv flathub.yml net.retrodeck.retrodeck.yml - # Adding the real submodules, please update this every time a submodule is added - - if [ -d shared-modules ]; then - git rm -rf --ignore-unmatch shared-modules - rm -rfv shared-modules - fi - git submodule add https://github.com/flathub/shared-modules.git ./shared-modules + # Getting latest release name + # version=$(\ + # curl -sL \ + # -H "Accept: application/vnd.github+json" \ + # -H "Authorization: Bearer ${{ secrets.TRIGGER_BUILD_TOKEN }}" \ + # https://api.github.com/repos/XargonWan/RetroDECK-cooker/releases \ + # | jq .[0].tag_name \ + # | tr -d \" \ + # ) - if [ -d rd-submodules/retroarch ]; then - git rm -rf --ignore-unmatch rd-submodules/retroarch - rm -rfv rd-submodules/retroarch - fi - git submodule add https://github.com/flathub/org.libretro.RetroArch.git ./rd-submodules/retroarch + sha=$(curl -sL https://artifacts.retrodeck.net/artifacts/RetroDECK-Artifact.sha) + + sed -i "s#__SHA__#$sha#g" net.retrodeck.retrodeck.yml + + echo -e "Resulting manifest:\n" + cat net.retrodeck.retrodeck.yml + + git config --global user.name "${{ secrets.GITNAME }}" + git config --global user.email "${{ secrets.GITMAIL }}" - # unbinds all submodules - git submodule deinit -f . - # checkout again - git submodule update --init --recursive git add * git commit -m "Updated flathub/net.retrodeck.retrodeck from RetroDECK/$rd_branch" - git push origin $branch \ No newline at end of file + + git remote -v + git push --force https://${{ secrets.TRIGGER_BUILD_TOKEN }}@github.com/flathub/net.retrodeck.retrodeck.git $relname \ No newline at end of file diff --git a/flathub.yml b/flathub.yml new file mode 100644 index 00000000..be76eedf --- /dev/null +++ b/flathub.yml @@ -0,0 +1,45 @@ +app-id: net.retrodeck.retrodeck +runtime: org.kde.Platform +runtime-version: 5.15-21.08 +#runtime-version: 6.3 # bumped because of pcsx2-qt +sdk: org.kde.Sdk +sdk-extensions: + - org.freedesktop.Sdk.Extension.llvm14 # Needed for rpcs3 + - org.freedesktop.Sdk.Extension.dotnet6 # Needed for Ryujinx +base: io.qt.qtwebengine.BaseApp # Needed for Yuzu +base-version: 5.15-21.08 # Needed for Yuzu +command: retrodeck.sh + +finish-args: + - --socket=x11 + - --socket=wayland + - --socket=pulseaudio + - --share=ipc + - --share=network + - --device=all + - --filesystem=~/retrodeck:create + - --filesystem=/run/media + - --filesystem=/media + - --allow=multiarch + - --talk-name=org.freedesktop.ScreenSaver + - --talk-name=org.freedesktop.PowerManagement.Inhibit + - --talk-name=org.freedesktop.login1 + - --filesystem=xdg-run/app/com.discordapp.Discord:create + # Yuzu + # - --filesystem=home:ro # This may break Yuzu, let's see + # - --filesystem=/run/media:ro + # Dolphin + - --allow=bluetooth + #- --env=QT_QPA_PLATFORM=xcb #not sure if this will break something + # rpcs3 + - --socket=fallback-x11 + +modules: + - name: retrodeck + buildsystem: simple + build-commands: + - cp -rn files/* /app + sources: + - type: archive + url: https://artifacts.retrodeck.net/artifacts/RetroDECK-Artifact.tar.gz + sha256: __SHA__ \ No newline at end of file diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index a9fa98cd..9c66373f 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -67,6 +67,7 @@ modules: # [ ] Update the VERSION variable # [ ] Update the appdata.xml with the version number and notes # [ ] change branch into main in retrodeck module (last one) + # [ ] if header (before modules) was edited, edit it even in flathub.yml # [ ] change the screenshots link from cooker to main # - name: version-initialization @@ -78,9 +79,7 @@ modules: VERSION="0.5.0b-cooker" if [[ $VERSION == *"cooker"* ]]; then - # Disabled until I figure it out - # VERSION=$(git describe --tags | tr - .) - VERSION="cooker-"$(date +%d%m%y.%H%M) + VERSION="cooker-"$(git rev-parse --short HEAD) fi echo $VERSION >> ${FLATPAK_DEST}/retrodeck/version cat ${FLATPAK_DEST}/retrodeck/version