Add auto-updater support for Linux with Gitea releases
Some checks failed
Build / build-windows (push) Has been cancelled
Build / build-android (push) Has been cancelled
Build / create-release (push) Has been cancelled
Build / build-linux (push) Has been cancelled

This commit is contained in:
2026-01-24 04:21:36 +11:00
parent 74879140b2
commit 82a3cb9674
6 changed files with 86 additions and 0 deletions

View File

@@ -5,6 +5,11 @@ on:
branches:
- main
- dev
tags:
- 'v*'
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
jobs:
build-windows:
@@ -92,6 +97,10 @@ jobs:
cp src-tauri/target/release/bundle/appimage/*.AppImage src-tauri/target/release/bundle/appimage/Cinny-Linux-x64.AppImage
cp src-tauri/target/release/bundle/deb/*.deb src-tauri/target/release/bundle/deb/Cinny-Linux-x64.deb
cp src-tauri/target/release/bundle/rpm/*.rpm src-tauri/target/release/bundle/rpm/Cinny-Linux-x64.rpm
# Copy signature file for updater
if [ -f src-tauri/target/release/bundle/appimage/*.AppImage.sig ]; then
cp src-tauri/target/release/bundle/appimage/*.AppImage.sig src-tauri/target/release/bundle/appimage/Cinny-Linux-x64.AppImage.sig
fi
- name: Upload AppImage
uses: actions/upload-artifact@v3
@@ -99,6 +108,13 @@ jobs:
name: Cinny-Linux-x64.AppImage
path: src-tauri/target/release/bundle/appimage/Cinny-Linux-x64.AppImage
- name: Upload AppImage Signature
uses: actions/upload-artifact@v3
if: always()
with:
name: Cinny-Linux-x64.AppImage.sig
path: src-tauri/target/release/bundle/appimage/Cinny-Linux-x64.AppImage.sig
- name: Upload DEB package
uses: actions/upload-artifact@v3
with:
@@ -209,3 +225,62 @@ jobs:
with:
name: Cinny-Android.apk
path: src-tauri/gen/android/app/build/outputs/apk/universal/release/Cinny-Android.apk
create-release:
runs-on: ubuntu-latest
needs: [build-windows, build-linux, build-android]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Get version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Create update.json
run: |
VERSION="${{ steps.version.outputs.VERSION }}"
APPIMAGE_SIG=""
if [ -f "artifacts/Cinny-Linux-x64.AppImage.sig/Cinny-Linux-x64.AppImage.sig" ]; then
APPIMAGE_SIG=$(cat "artifacts/Cinny-Linux-x64.AppImage.sig/Cinny-Linux-x64.AppImage.sig")
fi
cat > update.json << EOF
{
"version": "${VERSION}",
"notes": "Update to version ${VERSION}",
"pub_date": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
"platforms": {
"linux-x86_64": {
"signature": "${APPIMAGE_SIG}",
"url": "http://synbox.ruv.wtf:8418/litruv/cinny-desktop/releases/download/v${VERSION}/Cinny-Linux-x64.AppImage"
}
}
}
EOF
cat update.json
- name: Prepare release files
run: |
mkdir -p release-files
# Move artifacts out of subdirectories
find artifacts -type f \( -name "*.msi" -o -name "*.AppImage" -o -name "*.deb" -o -name "*.rpm" -o -name "*.apk" -o -name "*.sig" \) -exec cp {} release-files/ \;
cp update.json release-files/
ls -la release-files/
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: release-files/*
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}