Add auto-updater support for Linux with Gitea releases
This commit is contained in:
@@ -5,6 +5,11 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- dev
|
- dev
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
env:
|
||||||
|
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-windows:
|
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/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/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
|
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
|
- name: Upload AppImage
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
@@ -99,6 +108,13 @@ jobs:
|
|||||||
name: Cinny-Linux-x64.AppImage
|
name: Cinny-Linux-x64.AppImage
|
||||||
path: src-tauri/target/release/bundle/appimage/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
|
- name: Upload DEB package
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
@@ -209,3 +225,62 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: Cinny-Android.apk
|
name: Cinny-Android.apk
|
||||||
path: src-tauri/gen/android/app/build/outputs/apk/universal/release/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 }}
|
||||||
|
|||||||
2
src-tauri/.gitignore
vendored
2
src-tauri/.gitignore
vendored
@@ -2,3 +2,5 @@
|
|||||||
# will have compiled files and executables
|
# will have compiled files and executables
|
||||||
/target/
|
/target/
|
||||||
WixTools
|
WixTools
|
||||||
|
|
||||||
|
.tauri-private.key
|
||||||
|
|||||||
1
src-tauri/.tauri-private.key.pub
Normal file
1
src-tauri/.tauri-private.key.pub
Normal file
@@ -0,0 +1 @@
|
|||||||
|
dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDExREU1NkVBMDY4MzcxMjAKUldRZ2NZTUc2bGJlRVNaQldnMXpJcHlocVpCWUNNaUdicjBGMVRsck1GQXhvTnJiOUNhVVRHSzQK
|
||||||
@@ -32,6 +32,7 @@ tauri-plugin-deep-link = "2"
|
|||||||
|
|
||||||
[target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies]
|
[target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies]
|
||||||
tauri-plugin-single-instance = "2"
|
tauri-plugin-single-instance = "2"
|
||||||
|
tauri-plugin-updater = "2"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["custom-protocol"]
|
default = ["custom-protocol"]
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ pub fn run() {
|
|||||||
.plugin(tauri_plugin_window_state::Builder::default().build())
|
.plugin(tauri_plugin_window_state::Builder::default().build())
|
||||||
.plugin(tauri_plugin_single_instance::init(|_app, _args, _cwd| {}))
|
.plugin(tauri_plugin_single_instance::init(|_app, _args, _cwd| {}))
|
||||||
.plugin(tauri_plugin_notification::init())
|
.plugin(tauri_plugin_notification::init())
|
||||||
|
.plugin(tauri_plugin_updater::Builder::new().build())
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(any(target_os = "android", target_os = "ios"))]
|
#[cfg(any(target_os = "android", target_os = "ios"))]
|
||||||
|
|||||||
@@ -28,6 +28,12 @@
|
|||||||
"plugins": {
|
"plugins": {
|
||||||
"notification": {
|
"notification": {
|
||||||
"sound": true
|
"sound": true
|
||||||
|
},
|
||||||
|
"updater": {
|
||||||
|
"endpoints": [
|
||||||
|
"http://synbox.ruv.wtf:8418/litruv/cinny-desktop/releases/download/latest/update.json"
|
||||||
|
],
|
||||||
|
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDExREU1NkVBMDY4MzcxMjAKUldRZ2NZTUc2bGJlRVNaQldnMXpJcHlocVpCWUNNaUdicjBGMVRsck1GQXhvTnJiOUNhVVRHSzQK"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bundle": {
|
"bundle": {
|
||||||
|
|||||||
Reference in New Issue
Block a user