From 3302d79c382a58a9349474f3f777cdb3aa376f94 Mon Sep 17 00:00:00 2001 From: le king fu Date: Fri, 27 Feb 2026 21:10:50 -0500 Subject: [PATCH] Fix updater: use Forgejo package registry for stable latest.json URL - Forgejo has no /releases/latest/download/ route (GitHub-specific) - Upload latest.json to generic package registry for a stable endpoint - Fix Linux signature collection: use .AppImage.sig (not .tar.gz.sig) - Collect all platform signatures (.deb.sig, .rpm.sig, .AppImage.sig) - Bump to v0.4.3 Co-Authored-By: Claude Opus 4.6 --- .forgejo/workflows/release.yml | 48 ++++++++++++++++++++++++++++------ CHANGELOG.md | 7 +++++ package.json | 2 +- src-tauri/Cargo.toml | 2 +- src-tauri/tauri.conf.json | 4 +-- 5 files changed, 51 insertions(+), 12 deletions(-) diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml index 98be8ef..3fd65b4 100644 --- a/.forgejo/workflows/release.yml +++ b/.forgejo/workflows/release.yml @@ -59,10 +59,11 @@ jobs: run: | mkdir -p release-assets cp src-tauri/target/release/bundle/deb/*.deb release-assets/ 2>/dev/null || true + cp src-tauri/target/release/bundle/deb/*.deb.sig release-assets/ 2>/dev/null || true cp src-tauri/target/release/bundle/appimage/*.AppImage release-assets/ 2>/dev/null || true - cp src-tauri/target/release/bundle/appimage/*.AppImage.tar.gz release-assets/ 2>/dev/null || true - cp src-tauri/target/release/bundle/appimage/*.AppImage.tar.gz.sig release-assets/ 2>/dev/null || true + cp src-tauri/target/release/bundle/appimage/*.AppImage.sig release-assets/ 2>/dev/null || true cp src-tauri/target/release/bundle/rpm/*.rpm release-assets/ 2>/dev/null || true + cp src-tauri/target/release/bundle/rpm/*.rpm.sig release-assets/ 2>/dev/null || true cp src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*.exe release-assets/ 2>/dev/null || true cp src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*.exe.sig release-assets/ 2>/dev/null || true ls -la release-assets/ @@ -89,15 +90,15 @@ jobs: BASE_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/releases/download/${TAG}" LINUX_SIG="" - APPIMAGE_TAR="" + APPIMAGE_FILE="" WINDOWS_SIG="" WINDOWS_EXE="" - for f in release-assets/*.AppImage.tar.gz.sig; do + for f in release-assets/*.AppImage.sig; do [ -f "$f" ] && LINUX_SIG=$(cat "$f") done - for f in release-assets/*.AppImage.tar.gz; do - [ -f "$f" ] && APPIMAGE_TAR=$(basename "$f") + for f in release-assets/*.AppImage; do + [ -f "$f" ] && APPIMAGE_FILE=$(basename "$f") done for f in release-assets/*-setup.exe.sig; do [ -f "$f" ] && WINDOWS_SIG=$(cat "$f") @@ -107,10 +108,10 @@ jobs: done PLATFORMS="{}" - if [ -n "$LINUX_SIG" ] && [ -n "$APPIMAGE_TAR" ]; then + if [ -n "$LINUX_SIG" ] && [ -n "$APPIMAGE_FILE" ]; then PLATFORMS=$(echo "$PLATFORMS" | jq \ --arg sig "$LINUX_SIG" \ - --arg url "${BASE_URL}/${APPIMAGE_TAR}" \ + --arg url "${BASE_URL}/${APPIMAGE_FILE}" \ '. + {"linux-x86_64": {"signature": $sig, "url": $url}}') fi if [ -n "$WINDOWS_SIG" ] && [ -n "$WINDOWS_EXE" ]; then @@ -192,3 +193,34 @@ jobs: done echo "Release created: ${GITHUB_SERVER_URL}/${REPO}/releases/tag/${TAG}" + + - name: Publish latest.json to package registry + env: + FORGEJO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + API_URL="${GITHUB_SERVER_URL}/api/packages/${GITHUB_REPOSITORY_OWNER}/generic/simpl-resultat/latest" + echo "Uploading latest.json to package registry..." + HTTP_CODE=$(curl -w "%{http_code}" -X PUT \ + "${API_URL}/latest.json" \ + -H "Authorization: token ${FORGEJO_TOKEN}" \ + -H "Content-Type: application/json" \ + --data-binary "@release-assets/latest.json" \ + -o /tmp/pkg_response.json) + echo "HTTP $HTTP_CODE" + if [ "$HTTP_CODE" != "201" ] && [ "$HTTP_CODE" != "409" ]; then + echo "Upload failed:" + cat /tmp/pkg_response.json + fi + if [ "$HTTP_CODE" = "409" ]; then + echo "Package version exists, deleting and re-uploading..." + curl -s -X DELETE \ + "${API_URL}/latest.json" \ + -H "Authorization: token ${FORGEJO_TOKEN}" + HTTP_CODE=$(curl -w "%{http_code}" -X PUT \ + "${API_URL}/latest.json" \ + -H "Authorization: token ${FORGEJO_TOKEN}" \ + -H "Content-Type: application/json" \ + --data-binary "@release-assets/latest.json" \ + -o /tmp/pkg_response.json) + echo "Re-upload HTTP $HTTP_CODE" + fi diff --git a/CHANGELOG.md b/CHANGELOG.md index c4a49e1..b584a4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ ## [Unreleased] +## [0.4.3] + +### Fixed +- Auto-updater endpoint now uses Forgejo package registry for stable URL +- Linux updater signatures (.AppImage.sig) now correctly collected in CI +- All platform signatures (.deb.sig, .rpm.sig) now included in release assets + ## [0.4.2] ### Changed diff --git a/package.json b/package.json index 7c5abc2..c67c64d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "simpl_result_scaffold", "private": true, - "version": "0.4.2", + "version": "0.4.3", "type": "module", "scripts": { "dev": "vite", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 90c5fb1..ffd6db8 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "simpl-result" -version = "0.4.2" +version = "0.4.3" description = "Personal finance management app" authors = ["you"] edition = "2021" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 7b6c980..6cb8ace 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "Simpl Resultat", - "version": "0.4.2", + "version": "0.4.3", "identifier": "com.simpl.resultat", "build": { "beforeDevCommand": "npm run dev", @@ -37,7 +37,7 @@ "updater": { "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDgyRDc4MDEyQjQ0MzAxRTMKUldUakFVTzBFb0RYZ3NRNmFxMHdnTzBMZzFacTlCbTdtMEU3Ym5pZWNSN3FRZk43R3lZSUM2OHQK", "endpoints": [ - "https://git.lacompagniemaximus.com/maximus/simpl-resultat/releases/latest/download/latest.json" + "https://git.lacompagniemaximus.com/api/packages/maximus/generic/simpl-resultat/latest/latest.json" ], "windows": { "installMode": "basicUi"