From fa66bbe8aad1f273aaa5af3dda443cf31987a04b Mon Sep 17 00:00:00 2001 From: pascalyazid Date: Wed, 21 Oct 2026 22:57:13 +0200 Subject: [PATCH] Update .gitea/workflows/appimage.yml --- .gitea/workflows/appimage.yml | 43 +++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/.gitea/workflows/appimage.yml b/.gitea/workflows/appimage.yml index d0de643..bcff96a 100644 --- a/.gitea/workflows/appimage.yml +++ b/.gitea/workflows/appimage.yml @@ -24,29 +24,15 @@ jobs: libxpresent wayland wayland-protocols libxkbcommon alsa-lib libpulse \ pipewire dconf gdk-pixbuf2 - - name: Sync the mirror and find the newest desktop release + - name: Find the newest desktop release run: | set -euo pipefail - mirror="${{ gitea.server_url }}/${{ env.MIRROR }}.git" - latest() { - git ls-remote --tags "$mirror" 'refs/tags/desktop-v*' \ - | sed 's|.*refs/tags/||; s/\^{}$//' \ - | sort -uV | tail -n 1 - } - prev=$(latest) - # force a sync so a just-published tag isn't missed - curl -fsSL -X POST -H "Authorization: token ${{ secrets.PUBLISH_TOKEN }}" \ - "${{ gitea.server_url }}/api/v1/repos/${{ env.MIRROR }}/mirror-sync" - # wait briefly for the sync to land; if nothing new arrives, the - # current latest is still correct (the skip-check will bail) - tag=$prev - for i in $(seq 1 12); do - tag=$(latest) - if [ "$tag" != "$prev" ]; then break; fi - sleep 10 - done + tag=$(git ls-remote --tags "https://github.com/${{ env.UPSTREAM }}.git" 'refs/tags/desktop-v*' \ + | sed 's|.*refs/tags/||; s/\^{}$//' \ + | sort -uV | tail -n 1) if [ -z "$tag" ] || [ "$tag" = "null" ]; then - echo "no desktop-v* tags on the mirror" >&2; exit 1 + echo "no desktop-v* tag on ${{ env.UPSTREAM }}" >&2 + exit 1 fi echo "TAG=$tag" >> "$GITHUB_ENV" echo "VERSION=${tag#desktop-v}" >> "$GITHUB_ENV" @@ -60,6 +46,23 @@ jobs: echo "already built"; echo "SKIP=1" >> "$GITHUB_ENV" fi + - name: Sync the mirror and wait for the tag + if: env.SKIP != '1' + run: | + set -euo pipefail + curl -fsSL -X POST -H "Authorization: token ${{ secrets.PUBLISH_TOKEN }}" \ + "${{ gitea.server_url }}/api/v1/repos/${{ env.MIRROR }}/mirror-sync" + for i in $(seq 1 24); do + if git ls-remote --tags "${{ gitea.server_url }}/${{ env.MIRROR }}.git" \ + "refs/tags/${{ env.TAG }}" | grep -q .; then + echo "the mirror has ${{ env.TAG }}" + exit 0 + fi + sleep 5 + done + echo "the mirror never received ${{ env.TAG }}" >&2 + exit 1 + - name: Check out the mirror at the tag if: env.SKIP != '1' run: |