From e2b2db44469e38fc404baaffb0963ed5a9cd6225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolf-Martell=20Montw=C3=A9?= Date: Wed, 7 Feb 2024 12:52:56 +0100 Subject: [PATCH] Add release download of beta versions --- .github/workflows/fdroid.yml | 7 ++++++- download.sh | 38 ++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100755 download.sh diff --git a/.github/workflows/fdroid.yml b/.github/workflows/fdroid.yml index 36357b4..408d21f 100644 --- a/.github/workflows/fdroid.yml +++ b/.github/workflows/fdroid.yml @@ -44,12 +44,17 @@ jobs: chmod 0600 fdroid/config.yml chmod 0600 fdroid/keystore.p12 + - name: Download releases + run: ./download.sh + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Run lint run: fdroid lint working-directory: ./fdroid - name: Run update - run: fdroid update + run: fdroid update --create-metadata --pretty --rename-apks working-directory: ./fdroid - name: Setup Pages diff --git a/download.sh b/download.sh new file mode 100755 index 0000000..99a465b --- /dev/null +++ b/download.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +if ! command -v gh $> /dev/null +then + echo "gh could not be found, please install GitHub CLI" + exit 1 +fi + +load_app_versions () { + gh release list -R $1 --limit 200 --json=tagName,isPrerelease --jq ".[] | select(.isPrerelease == $2) | .tagName" --exclude-drafts > $3 +} + +load_apps () { + counter=1 + while [ $counter -le $2 ] + do + version=$(sed "${counter}q;d" $3) + file=fdroid/repo/${4}-${version}.apk + echo $version + echo $file + gh release download -R $1 $version -O $file + ((counter++)) + done +} + +update_metadata () { + gh repo clone $1 tmp/$1 + rm -r fdroid/metadata/$3 + cp -r tmp/$1/$2/fastlane/metadata/android/ fdroid/metadata/$3 +} + +mkdir -p tmp + +load_app_versions thunderbird/thunderbird-android true tmp/k9-beta-versions.txt + +load_apps thunderbird/thunderbird-android 10 tmp/k9-beta-versions.txt k9-beta + +update_metadata thunderbird/thunderbird-android app-k9mail com.fsck.k9