Skip to content

Commit

Permalink
Add release download of beta versions
Browse files Browse the repository at this point in the history
  • Loading branch information
wmontwe committed Feb 7, 2024
1 parent 64d169b commit 135b61b
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/fdroid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
38 changes: 38 additions & 0 deletions download.sh
Original file line number Diff line number Diff line change
@@ -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 || true
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

0 comments on commit 135b61b

Please sign in to comment.