Skip to content

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

[WIP] Fix F-Droid version file workflow (#8583)

Vasyl Gelloa6febb281659
diff --git a/.github/workflows/fdroid.yml b/.github/workflows/fdroid.yml
index 49fb8c53e..2dbc3a936 100644
--- a/.github/workflows/fdroid.yml
+++ b/.github/workflows/fdroid.yml
@@ -1,4 +1,4 @@
-name: Fdroid
+name: Fdroid version file generation
on:
workflow_dispatch:
@@ -11,15 +11,16 @@ on:
jobs:
# https://gitlab.com/fdroid/fdroiddata/-/blob/master/metadata/com.carriez.flutter_hbb.yml
- # https://gitlab.com/basilgello/rustdesk-fdroid-versioner
+ # Finds latest release and transforms F-Droid vereion code from version as follows:
+ # X.Y.Z-A => X * 1e9 + Y * 1e6 + Z * 1e3 + A
update-fdroid-version-file:
name: Publish RustDesk version file for F-Droid updater
runs-on: ubuntu-latest
steps:
- name: Generate RustDesk version file
run: |
- UPSTREAM_VERNAME="$GITHUB_REF_NAME"
- UPSTREAM_VERCODE="$(echo "$UPSTREAM_VERNAME" | tr -d '.')"
+ UPSTREAM_VERNAME="$(curl https://api.github.com/repos/rustdesk/rustdesk/releases/latest | jq -r .tag_name | sed 's/^v//')"
+ UPSTREAM_VERCODE="$(echo "$UPSTREAM_VERNAME" | tr '.' ' ' | tr '-' ' ' | while read -r MAJOR MINOR PATCH REV; do [ -z "$MAJOR" ] && MAJOR=0; [ -z "$MINOR" ] && MINOR=0; [ -z "$PATCH" ] && PATCH=0; [ -z "$REV" ] && REV=0; echo "$(( 1000000000 * $MAJOR + 1000000 * $MINOR + 1000 * $PATCH + $REV ))"; done)"
echo "versionName=$UPSTREAM_VERNAME" > rustdesk-version.txt
echo "versionCode=$UPSTREAM_VERCODE" >> rustdesk-version.txt
shell: bash