Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Prepare for v3.1.0 release #68

Merged
merged 3 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/publish-sdk.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Publish Android SDK

on:
release:
types: [published]
Expand Down Expand Up @@ -30,5 +31,8 @@ jobs:
mkdir -p ~/.gradle/
echo "GRADLE_USER_HOME=${HOME}/.gradle" >> $GITHUB_ENV

- name: Publish
run: make check-maven-credentials-and-publish
- name: Publish Release artifact
run: ./gradlew publish -Prelease --no-daemon
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
2 changes: 1 addition & 1 deletion .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}

- name: Publish Snapshot artifact
run: ./gradlew publish --no-daemon
run: ./gradlew publish -Psnapshot --no-daemon
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '8.4.2' apply false
id 'com.android.application' version '8.5.0' apply false
id 'com.android.library' version '8.4.1' apply false
}

Expand Down
35 changes: 32 additions & 3 deletions eppo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group = "cloud.eppo"
version = "3.1.0-SNAPSHOT"
version = "3.1.0"

android {
buildFeatures.buildConfig true
Expand Down Expand Up @@ -58,9 +58,9 @@ ext.versions = [
"androidx_junit": "1.1.5",
"androidx_test_core": "1.5.0",
"androidx_runner": "1.5.2",
"androidx_core": "1.8.0",
"androidx_core": "1.9.0",
"gson": "2.9.1",
"okhttp": "4.11.0",
"okhttp": "4.12.0",
"commonsio": "2.14.0",
"semver": "0.10.2"
]
Expand Down Expand Up @@ -156,3 +156,32 @@ task runEppoTests(type: GradleBuild) {
':eppo:connectedDebugAndroidTest'
]
}

// Custom task to ensure we can conditionally publish either a release or snapshot artifact
// based on a command line switch. See github workflow files for more details on usage.
task checkVersion {
doLast {
if (!project.hasProperty('release') && !project.hasProperty('snapshot')) {
throw new GradleException("You must specify either -Prelease or -Psnapshot")
}
if (project.hasProperty('release') && project.version.endsWith('SNAPSHOT')) {
throw new GradleException("You cannot specify -Prelease with a SNAPSHOT version")
}
if (project.hasProperty('snapshot') && !project.version.endsWith('SNAPSHOT')) {
throw new GradleException("You cannot specify -Psnapshot with a non-SNAPSHOT version")
}
project.ext.shouldPublish = true
Comment on lines +164 to +173
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appreciate the defensiveness!

}
}

// Ensure checkVersion runs before publishing
tasks.named('publish').configure {
dependsOn checkVersion
}

// Conditionally enable or disable publishing tasks
tasks.withType(PublishToMavenRepository) {
onlyIf {
project.ext.has('shouldPublish') && project.ext.shouldPublish
}
}
8 changes: 4 additions & 4 deletions example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ if (localPropertiesFile.exists()) {

android {
buildFeatures.buildConfig true
compileSdk 33
compileSdk 34

defaultConfig {
applicationId "cloud.eppo.androidexample"
namespace "com.geteppo.androidexample"
minSdk 21
targetSdk 33
targetSdk 34
versionCode 1
versionName "1.0"

Expand All @@ -39,8 +39,8 @@ android {
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation project(path: ':eppo')
testImplementation 'junit:junit:4.13.2'
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Sep 06 11:52:39 CEST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Loading