Skip to content

Commit

Permalink
chore: automate releases, bump version to 0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
booniepepper committed Oct 13, 2023
1 parent 6cecea0 commit 73e45a4
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 22 deletions.
36 changes: 33 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '11', '17', '20' ]
java: [ '11', '17', '21' ]
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.2
- name: Set up JDK
Expand All @@ -27,7 +27,7 @@ jobs:
run: |
./gradlew build
publish:
publish-maven-central:
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -50,10 +50,40 @@ jobs:
- name: Publish package
uses: gradle/gradle-build-action@ef76a971e2fa3f867b617efd72f2fbd72cf6f8bc # v2.8.0
with:
arguments: publish
# Tasks created by https://github.com/gradle-nexus/publish-plugin
arguments: publishpublishToSonatype closeAndReleaseSonatypeStagingRepository
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
ORG_GRADLE_PROJECT_SIGNINGKEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }}
ORG_GRADLE_PROJECT_SIGNINGPASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}

publish-github-packages:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
if: startsWith(github.ref, 'refs/tags/v')
needs: [test]

steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.2

- name: Set up JDK
uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3.12.0
with:
java-version: 11
distribution: 'temurin'

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@56b90f209b02bf6d1deae490e9ef18b21a389cd4 # v1.1.0

- name: Publish package
uses: gradle/gradle-build-action@ef76a971e2fa3f867b617efd72f2fbd72cf6f8bc # v2.8.0
with:
# Tasks created by https://docs.gradle.org/current/userguide/publishing_maven.html
arguments: publishAllPublicationsToGitHubPackagesRepository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_SIGNINGKEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }}
ORG_GRADLE_PROJECT_SIGNINGPASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## v0.2.1

### [0.2.1](https://github.com/openfga/java-sdk/compare/v0.2.0...v0.2.1) (2023-10-13)

No changes, this patch release is just to test release automation.

## v0.2.0

### [0.2.0](https://github.com/openfga/java-sdk/compare/v0.1.0...v0.2.0) (2023-10-11)
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ It can be used with the following:
* Gradle (Groovy)

```groovy
implementation 'dev.openfga:openfga-sdk:0.2.0'
implementation 'dev.openfga:openfga-sdk:0.2.1'
```

* Gradle (Kotlin)

```kotlin
implementation("dev.openfga:openfga-sdk:0.2.0")
implementation("dev.openfga:openfga-sdk:0.2.1")
```

* Apache Maven
Expand All @@ -89,26 +89,26 @@ implementation("dev.openfga:openfga-sdk:0.2.0")
<dependency>
<groupId>dev.openfga</groupId>
<artifactId>openfga-sdk</artifactId>
<version>0.2.0</version>
<version>0.2.1</version>
</dependency>
```

* Ivy

```xml
<dependency org="dev.openfga" name="openfga-sdk" rev="0.2.0"/>
<dependency org="dev.openfga" name="openfga-sdk" rev="0.2.1"/>
```

* SBT

```scala
libraryDependencies += "dev.openfga" % "openfga-sdk" % "0.2.0"
libraryDependencies += "dev.openfga" % "openfga-sdk" % "0.2.1"
```

* Leiningen

```edn
[dev.openfga/openfga-sdk "0.2.0"]
[dev.openfga/openfga-sdk "0.2.1"]
```


Expand Down
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ plugins {
// Publishing
id 'maven-publish'
id 'signing'
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0'
}

apply from: 'publish.gradle'

group = 'dev.openfga'
version = '0.2.0'
version = '0.2.1'

repositories {
mavenCentral()
Expand Down
21 changes: 12 additions & 9 deletions publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ publishing {
pom {
group = 'dev.openfga'
name = 'openfga-sdk'
version = '0.2.0'
version = '0.2.1'
description = 'This is an autogenerated Java SDK for OpenFGA. It provides a wrapper around the [OpenFGA API definition](https://openfga.dev/api).'
url = 'https://openfga.dev'
licenses {
Expand All @@ -30,14 +30,6 @@ publishing {
}
}
repositories {
maven {
name = 'SonatypeOSSRH' // AKA: "Maven Central"
url = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
credentials {
username = System.getenv('MAVEN_USERNAME')
password = System.getenv('MAVEN_PASSWORD')
}
}
maven {
name = 'GitHubPackages'
url = 'https://maven.pkg.github.com/openfga/java-sdk'
Expand All @@ -55,3 +47,14 @@ signing {
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.maven
}

nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri('https://s01.oss.sonatype.org/service/local/'))
snapshotRepositoryUrl.set(uri('https://s01.oss.sonatype.org/content/repositories/snapshots/'))
username.set(System.getenv('MAVEN_USERNAME'))
password.set(System.getenv('MAVEN_PASSWORD'))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
* Configurations for an api client.
*/
public class Configuration implements BaseConfiguration {
public static final String VERSION = "0.2.0";
public static final String VERSION = "0.2.1";

private static final String DEFAULT_API_URL = "http://localhost:8080";
private static final String DEFAULT_USER_AGENT = "openfga-sdk java/0.2.0";
private static final String DEFAULT_USER_AGENT = "openfga-sdk java/0.2.1";
private static final Duration DEFAULT_READ_TIMEOUT = Duration.ofSeconds(10);
private static final Duration DEFAULT_CONNECT_TIMEOUT = Duration.ofSeconds(10);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

class ConfigurationTest {
private static final String DEFAULT_API_URL = "http://localhost:8080";
private static final String DEFAULT_USER_AGENT = "openfga-sdk java/0.2.0";
private static final String DEFAULT_USER_AGENT = "openfga-sdk java/0.2.1";
private static final Duration DEFAULT_READ_TIMEOUT = Duration.ofSeconds(10);
private static final Duration DEFAULT_CONNECT_TIMEOUT = Duration.ofSeconds(10);

Expand Down

0 comments on commit 73e45a4

Please sign in to comment.