Update .gitea/workflows/appimage.yml

This commit is contained in:
pascalyazid committed 2026-10-21 22:57:13 +02:00
1 parent a4345ec1cb
commit fa66bbe8aa
1 file changed
+23 -20
+23 -20
View File
@@ -24,29 +24,15 @@ jobs:
libxpresent wayland wayland-protocols libxkbcommon alsa-lib libpulse \ libxpresent wayland wayland-protocols libxkbcommon alsa-lib libpulse \
pipewire dconf gdk-pixbuf2 pipewire dconf gdk-pixbuf2
- name: Sync the mirror and find the newest desktop release - name: Find the newest desktop release
run: | run: |
set -euo pipefail set -euo pipefail
mirror="${{ gitea.server_url }}/${{ env.MIRROR }}.git" tag=$(git ls-remote --tags "https://github.com/${{ env.UPSTREAM }}.git" 'refs/tags/desktop-v*' \
latest() { | sed 's|.*refs/tags/||; s/\^{}$//' \
git ls-remote --tags "$mirror" 'refs/tags/desktop-v*' \ | sort -uV | tail -n 1)
| 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
if [ -z "$tag" ] || [ "$tag" = "null" ]; then 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 fi
echo "TAG=$tag" >> "$GITHUB_ENV" echo "TAG=$tag" >> "$GITHUB_ENV"
echo "VERSION=${tag#desktop-v}" >> "$GITHUB_ENV" echo "VERSION=${tag#desktop-v}" >> "$GITHUB_ENV"
@@ -60,6 +46,23 @@ jobs:
echo "already built"; echo "SKIP=1" >> "$GITHUB_ENV" echo "already built"; echo "SKIP=1" >> "$GITHUB_ENV"
fi 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 - name: Check out the mirror at the tag
if: env.SKIP != '1' if: env.SKIP != '1'
run: | run: |