From 2f24743f84d783bb5e5fa911256a0943051cb999 Mon Sep 17 00:00:00 2001 From: prolic Date: Wed, 13 Nov 2024 23:19:49 -0300 Subject: [PATCH] split repo for stable and continuous releases --- .github/workflows/flatpak-repo.yml | 31 +++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/.github/workflows/flatpak-repo.yml b/.github/workflows/flatpak-repo.yml index 2016674..2f3b789 100644 --- a/.github/workflows/flatpak-repo.yml +++ b/.github/workflows/flatpak-repo.yml @@ -37,20 +37,37 @@ jobs: - name: Setup gh-pages branch run: | git checkout gh-pages 2>/dev/null || git checkout -b gh-pages - rm -rf repo + rm -rf repo-stable repo-continuous + + - name: Download Flatpak Bundle + uses: actions/download-artifact@v3 + with: + name: flatpak-bundle - name: Create/Update Repository run: | - mkdir -p repo - flatpak build-update-repo --generate-static-deltas repo + # Create separate repos for stable and continuous + mkdir -p repo-stable repo-continuous + + # Initialize repos if they don't exist + [ ! -d "repo-stable/objects" ] && flatpak build-update-repo repo-stable + [ ! -d "repo-continuous/objects" ] && flatpak build-update-repo repo-continuous + if [ -f "futr.flatpak" ]; then - flatpak build-import-bundle repo futr.flatpak + # Determine which repo to update based on the source workflow + if [[ "${{ github.event.workflow_run.name }}" == "Flatpak Tagged Release" ]]; then + flatpak build-import-bundle repo-stable futr.flatpak + flatpak build-update-repo --generate-static-deltas repo-stable + else + flatpak build-import-bundle repo-continuous futr.flatpak + flatpak build-update-repo --generate-static-deltas repo-continuous + fi fi - name: Commit Repository Updates run: | - git add repo - git commit -m "Update Flatpak repository" || echo "No changes to commit" + git add repo-stable repo-continuous + git commit -m "Update Flatpak repositories" || echo "No changes to commit" git push origin gh-pages - name: Setup Pages @@ -59,7 +76,7 @@ jobs: - name: Upload Repository uses: actions/upload-pages-artifact@v3 with: - path: 'repo' + path: '.' - name: Deploy to GitHub Pages id: deployment