Skip to content

Commit 01e241b

Browse files
authored
chore: Upload artifacts from Github CI (#3)
* chore: Upload artifacts from github CI * rework workflow files * add info to readme * rename job * fix signing config * expose env vars * minor fixes * fix release worklow version
1 parent 04c2c99 commit 01e241b

File tree

5 files changed

+86
-21
lines changed

5 files changed

+86
-21
lines changed

.github/workflows/lint-test-sdk.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
paths:
66
- '**/*'
77

8+
env:
9+
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }}
10+
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }}
11+
812
jobs:
913
lint-test-sdk:
1014
runs-on: ubuntu-latest
@@ -21,9 +25,8 @@ jobs:
2125
with:
2226
java-version: ${{ matrix.java-version }}
2327
distribution: 'adopt'
28+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
29+
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
2430

2531
- name: Run tests
26-
run: ./gradlew check
27-
env:
28-
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }}
29-
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }}
32+
run: ./gradlew check --no-daemon

.github/workflows/publish-sdk.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
name: Publish sdk to the Maven Central Repository
1+
name: Publish release SDK to the Maven Central Repository
2+
23
on:
34
release:
45
types: [published]
6+
7+
env:
8+
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }}
9+
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }}
10+
511
jobs:
612
publish:
713
runs-on: ubuntu-latest
@@ -14,24 +20,14 @@ jobs:
1420
java-version: '8'
1521
distribution: 'temurin'
1622
server-id: ossrh
17-
server-username: MAVEN_USERNAME
18-
server-password: MAVEN_PASSWORD
1923
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
20-
gpg-passphrase: GPG_PASSPHRASE
24+
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
2125

2226
- name: Download test data
2327
run: make test-data
2428

25-
- name: Publish package with debug logging
26-
run: mvn --batch-mode deploy -X
27-
env:
28-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
29-
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
30-
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
31-
32-
- name: Release the staging repository
33-
run: mvn nexus-staging:release -X
29+
- name: Publish to Maven Central
30+
run: ./gradlew publish --no-daemon
3431
env:
35-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
36-
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
32+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
3733
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish SDK Snapshot artifact
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
env:
8+
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }}
9+
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }}
10+
11+
jobs:
12+
publish-snapshot:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Set up JDK 17
20+
uses: actions/setup-java@v4
21+
with:
22+
java-version: 17
23+
distribution: 'adopt'
24+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
25+
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
26+
27+
- name: Publish Snapshot artifact
28+
run: ./gradlew publish --no-daemon
29+
env:
30+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
31+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

README.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,38 @@
11
# Eppo JVM common SDK
22

3-
This is the common SDK for the Eppo JVM. It provides a set of classes and interfaces that are used by the Eppo JVM to
4-
interact with the Eppo API.
3+
This is the common SDK for the Eppo JVM SDKs. It provides a set of classes and interfaces that are used by the SDKs to
4+
interact with the Eppo API. You should probably not use this library directly and instead use the [Android](https://github.com/Eppo-exp/android-sdk)
5+
or [JVM](https://github.com/Eppo-exp/java-server-sdk) SDKs.
6+
7+
# Usage
8+
9+
## build.gradle:
10+
11+
```groovy
12+
dependencies {
13+
implementation 'cloud.eppo:sdk-common-jvm:1.0.0'
14+
}
15+
```
16+
17+
# Releasing a new version
18+
19+
Bump the project version in `build.gradle`
20+
To release a new version of the SDK, you need to create a new tag in the repository. The tag should be named `vX.Y.Z`,
21+
where `X.Y.Z` is the version number of the release. For example, if you are releasing version 1.2.3, the tag should be
22+
named `v1.2.3`.
23+
24+
# Using Snapshots
25+
If you would like to live on the bleeding edge, you can try running against a snapshot build. Keep in mind that snapshots
26+
represent the most recent changes on master and may contain bugs.
27+
28+
## build.gradle:
29+
30+
```groovy
31+
repositories {
32+
maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots" }
33+
}
34+
35+
dependencies {
36+
implementation 'cloud.eppo:sdk-common-jvm:1.0.0-SNAPSHOT'
37+
}
38+
```

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ publishing {
107107

108108
signing {
109109
sign publishing.publications.mavenJava
110+
useInMemoryPgpKeys(System.env.GPG_PRIVATE_KEY, System.env.GPG_PASSPHRASE)
110111
}
111112

112113

0 commit comments

Comments
 (0)