Skip to content

Commit

Permalink
Fix CI signing of nightly builds
Browse files Browse the repository at this point in the history
  • Loading branch information
inetic committed Dec 3, 2024
1 parent 4b06d9e commit f4fd47e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ jobs:

- name: Setup secrets for artifact signing (different from the production releases)
run: |
dir=secrets/nightly/android
dir=secrets/android
mkdir -p $dir
echo $NIGHTLY_KEYSTORE_JKS_HEX > $dir/keystore.jks.hex
# Use `keytool` to generate the `keystore.jks` keystore.
Expand Down
14 changes: 10 additions & 4 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,19 @@ def loadKeystorePropertiesFile(String keystorePropertiesPath) {
}
def properties = new Properties()

def proFile = rootProject.file(keystorePropertiesPath)
def propFile = rootProject.file(keystorePropertiesPath)

if (!proFile.exists()) {
return null
if (!propFile.exists()) {
throw new GradleException("The keystore properties file does not exist: ${keystorePropertiesPath}");
}

proFile.withInputStream { properties.load(it) }
propFile.withInputStream { properties.load(it) }

def storeFile = file(properties['storeFile']);

if (!storeFile.exists()) {
throw new GradleException("The store file does not exist: ${storeFile.getPath()}");
}

def config = new SigningConfig(
keyAlias: properties['keyAlias'],
Expand Down
9 changes: 7 additions & 2 deletions util/release.dart
Original file line number Diff line number Diff line change
Expand Up @@ -379,14 +379,19 @@ class Options {
}
}

final androidKeyProperties = results['android-key-properties'];
String? androidKeyProperties = results['android-key-properties'];

if (androidKeyProperties != null) {
if (!await File(androidKeyProperties).exists()) {
final file = File(androidKeyProperties);
if (!await file.exists()) {
print(
"Android keystore properties file '$androidKeyProperties' does not exist");
exit(1);
}

// Convert to absolute path because if it's relative the build.gradle
// script expects it to be relative to the ./android/ directory.
androidKeyProperties = file.absolute.path;
}

final sentryDSNFile = results['sentry'];
Expand Down

0 comments on commit f4fd47e

Please sign in to comment.