Use the correct env vars for uploading snapshots (#1691)

diff --git a/lottie-compose/build.gradle b/lottie-compose/build.gradle
index 00c76f4..16f5ce5 100644
--- a/lottie-compose/build.gradle
+++ b/lottie-compose/build.gradle
@@ -37,6 +37,15 @@
   }
 }
 
+mavenPublish {
+  targets {
+    uploadArchives {
+      repositoryUsername = hasProperty('SONATYPE_USERNAME') ? SONATYPE_USERNAME : ""
+      repositoryPassword = hasProperty('SONATYPE_PASSWORD') ? SONATYPE_PASSWORD : ""
+    }
+  }
+}
+
 dependencies {
   api project(':lottie')
   implementation "androidx.compose.foundation:foundation:$composeVersion"
diff --git a/lottie/build.gradle b/lottie/build.gradle
index 3c2575b..fa46b51 100644
--- a/lottie/build.gradle
+++ b/lottie/build.gradle
@@ -28,6 +28,15 @@
   }
 }
 
+mavenPublish {
+  targets {
+    uploadArchives {
+      repositoryUsername = hasProperty('SONATYPE_USERNAME') ? SONATYPE_USERNAME : ""
+      repositoryPassword = hasProperty('SONATYPE_PASSWORD') ? SONATYPE_PASSWORD : ""
+    }
+  }
+}
+
 dependencies {
   implementation "androidx.appcompat:appcompat:1.0.0"
   // Do not upgrade to 2.0 because it will bring in Kotlin as a transitive dependency.