gitlab-ci: fix broken logic for running publish when signatures are there

!8834
92f77359dd
This commit is contained in:
Hans-Christoph Steiner 2021-04-21 11:05:38 +02:00
parent 29db88b161
commit 52b802517f
No known key found for this signature in database
GPG key ID: 3E177817BA1B9BFA
2 changed files with 17 additions and 3 deletions

View file

@ -243,7 +243,9 @@ fdroid build:
chown -R vagrant $VAGRANT_HOME;
$fdroid fetchsrclibs $build --verbose;
$fdroid build --verbose --test --scan-binary --on-server --no-tarball $build;
./tools/should-run-publish.py $build && (apt-get install sudo; $fdroid publish --verbose $build);
./tools/build-contains-signatures.py $build || continue;
apt-get install sudo;
$fdroid publish --verbose $build;
done

View file

@ -8,17 +8,29 @@ import yaml
from colorama import Fore, Style
if len(sys.argv) != 2:
print(Fore.RED + ('ERROR: incorrect number of arguments') + Style.RESET_ALL)
print(
Fore.RED
+ ('ERROR: incorrect number of arguments: ' + ' '.join(sys.argv[1:]))
+ Style.RESET_ALL
)
exit(1)
appid, versionCode = sys.argv[1].split(':')
if not glob.glob('metadata/%s/signatures/%s/*' % (appid, versionCode)):
print(Fore.RED + ('ERROR: no signatures found') + Style.RESET_ALL)
print('no signatures found, skipping publish')
exit(1)
for f in glob.glob('tmp/%s_%s.apk' % (appid, versionCode)):
os.rename(f, f.replace('tmp/', 'unsigned/'))
if not glob.glob('unsigned/%s_%s.apk' % (appid, versionCode)):
print('no unsigned APK found, skipping publish')
exit(1)
print(
Fore.GREEN
+ ('Found signatures for %s, running publish...' % sys.argv[1])
+ Style.RESET_ALL
)