Skip to content

Commit dbd003f

Browse files
authored
feat: release automation configs (#312)
* feat: release automation configs * feat: address comments * feat: update workflow
1 parent 00ad715 commit dbd003f

11 files changed

Lines changed: 205 additions & 7 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: release-please
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches: [main]
9+
workflow_dispatch:
10+
inputs:
11+
bump-type:
12+
description: >
13+
Version bump type. Select 'explicit' to supply an exact version via
14+
the 'release-version' field below. Select 'auto' to let
15+
conventional-commits determine the bump automatically.
16+
required: false
17+
type: choice
18+
default: 'auto'
19+
options:
20+
- auto
21+
- patch
22+
- minor
23+
- major
24+
- explicit
25+
release-version:
26+
description: >
27+
Explicit version to release (e.g. 1.2.3 or 1.4.0-beta.1).
28+
required: false
29+
type: string
30+
31+
jobs:
32+
release:
33+
permissions:
34+
contents: write
35+
pull-requests: write
36+
if: |
37+
github.event_name == 'workflow_dispatch' ||
38+
startsWith(github.event.head_commit.message, 'release:')
39+
uses: openfga/sdk-generator/.github/workflows/release-please.yml@main
40+
with:
41+
trigger-event: ${{ github.event_name }}
42+
bump-type: ${{ inputs.bump-type || 'auto' }}
43+
release-version: ${{ inputs.release-version || '' }}
44+
secrets:
45+
RELEASER_APP_ID: ${{ secrets.RELEASER_APP_ID }}
46+
RELEASER_APP_PRIVATE_KEY: ${{ secrets.RELEASER_APP_PRIVATE_KEY }}
47+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
48+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.9.7"
3+
}

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Maven Central](https://img.shields.io/maven-central/v/dev.openfga/openfga-sdk.svg?label=Maven%20Central)](https://central.sonatype.com/artifact/dev.openfga/openfga-sdk)
44
[![Javadoc](https://javadoc.io/badge2/dev.openfga/openfga-sdk/javadoc.svg)](https://javadoc.io/doc/dev.openfga/openfga-sdk)
5-
[![Socket Badge](https://badge.socket.dev/maven/package/dev.openfga:openfga-sdk/0.9.7)](https://socket.dev/maven/package/dev.openfga:openfga-sdk)
5+
[![Socket Badge](https://badge.socket.dev/maven/package/dev.openfga:openfga-sdk/0.9.7)](https://socket.dev/maven/package/dev.openfga:openfga-sdk) <!-- x-release-please-version -->
66
[![DeepWiki](https://img.shields.io/badge/DeepWiki-openfga%2Fjava--sdk-blue.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAyCAYAAAAnWDnqAAAAAXNSR0IArs4c6QAAA05JREFUaEPtmUtyEzEQhtWTQyQLHNak2AB7ZnyXZMEjXMGeK/AIi+QuHrMnbChYY7MIh8g01fJoopFb0uhhEqqcbWTp06/uv1saEDv4O3n3dV60RfP947Mm9/SQc0ICFQgzfc4CYZoTPAswgSJCCUJUnAAoRHOAUOcATwbmVLWdGoH//PB8mnKqScAhsD0kYP3j/Yt5LPQe2KvcXmGvRHcDnpxfL2zOYJ1mFwrryWTz0advv1Ut4CJgf5uhDuDj5eUcAUoahrdY/56ebRWeraTjMt/00Sh3UDtjgHtQNHwcRGOC98BJEAEymycmYcWwOprTgcB6VZ5JK5TAJ+fXGLBm3FDAmn6oPPjR4rKCAoJCal2eAiQp2x0vxTPB3ALO2CRkwmDy5WohzBDwSEFKRwPbknEggCPB/imwrycgxX2NzoMCHhPkDwqYMr9tRcP5qNrMZHkVnOjRMWwLCcr8ohBVb1OMjxLwGCvjTikrsBOiA6fNyCrm8V1rP93iVPpwaE+gO0SsWmPiXB+jikdf6SizrT5qKasx5j8ABbHpFTx+vFXp9EnYQmLx02h1QTTrl6eDqxLnGjporxl3NL3agEvXdT0WmEost648sQOYAeJS9Q7bfUVoMGnjo4AZdUMQku50McDcMWcBPvr0SzbTAFDfvJqwLzgxwATnCgnp4wDl6Aa+Ax283gghmj+vj7feE2KBBRMW3FzOpLOADl0Isb5587h/U4gGvkt5v60Z1VLG8BhYjbzRwyQZemwAd6cCR5/XFWLYZRIMpX39AR0tjaGGiGzLVyhse5C9RKC6ai42ppWPKiBagOvaYk8lO7DajerabOZP46Lby5wKjw1HCRx7p9sVMOWGzb/vA1hwiWc6jm3MvQDTogQkiqIhJV0nBQBTU+3okKCFDy9WwferkHjtxib7t3xIUQtHxnIwtx4mpg26/HfwVNVDb4oI9RHmx5WGelRVlrtiw43zboCLaxv46AZeB3IlTkwouebTr1y2NjSpHz68WNFjHvupy3q8TFn3Hos2IAk4Ju5dCo8B3wP7VPr/FGaKiG+T+v+TQqIrOqMTL1VdWV1DdmcbO8KXBz6esmYWYKPwDL5b5FA1a0hwapHiom0r/cKaoqr+27/XcrS5UwSMbQAAAABJRU5ErkJggg==)](https://deepwiki.com/openfga/java-sdk)
77
[![Release](https://img.shields.io/github/v/release/openfga/java-sdk?sort=semver&color=green)](https://github.com/openfga/java-sdk/releases)
88
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fopenfga%2Fjava-sdk.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fopenfga%2Fjava-sdk?ref=badge_shield)
@@ -82,43 +82,55 @@ It can be used with the following:
8282

8383
* Gradle (Groovy)
8484

85+
<!-- x-release-please-start-version -->
8586
```groovy
8687
implementation 'dev.openfga:openfga-sdk:0.9.7'
8788
```
89+
<!-- x-release-please-end -->
8890

8991
* Gradle (Kotlin)
9092

93+
<!-- x-release-please-start-version -->
9194
```kotlin
9295
implementation("dev.openfga:openfga-sdk:0.9.7")
9396
```
97+
<!-- x-release-please-end -->
9498

9599
* Apache Maven
96100

101+
<!-- x-release-please-start-version -->
97102
```xml
98103
<dependency>
99104
<groupId>dev.openfga</groupId>
100105
<artifactId>openfga-sdk</artifactId>
101106
<version>0.9.7</version>
102107
</dependency>
103108
```
109+
<!-- x-release-please-end -->
104110

105111
* Ivy
106112

113+
<!-- x-release-please-start-version -->
107114
```xml
108115
<dependency org="dev.openfga" name="openfga-sdk" rev="0.9.7"/>
109116
```
117+
<!-- x-release-please-end -->
110118

111119
* SBT
112120

121+
<!-- x-release-please-start-version -->
113122
```scala
114123
libraryDependencies += "dev.openfga" % "openfga-sdk" % "0.9.7"
115124
```
125+
<!-- x-release-please-end -->
116126

117127
* Leiningen
118128

129+
<!-- x-release-please-start-version -->
119130
```edn
120131
[dev.openfga/openfga-sdk "0.9.7"]
121132
```
133+
<!-- x-release-please-end -->
122134

123135

124136
## Getting Started

RELEASE.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# Release guide
2+
3+
This project uses [release-please](https://github.com/googleapis/release-please) via a
4+
`workflow_dispatch`-triggered GitHub Actions workflow. This document explains how to cut
5+
a release and what to watch out for.
6+
7+
---
8+
9+
## Versioning rules for this project
10+
11+
We are pre-1.0.0. Semver conventions are relaxed:
12+
13+
| Change type | Bump | Example |
14+
|--- |--- |--- |
15+
| Breaking change | **Minor** (`0.x.0`) | `0.9.0``0.10.0` |
16+
| Everything else | **Patch** (`0.0.x`) | `0.9.7``0.9.8` |
17+
18+
Major bumps (`1.0.0`) are reserved for a deliberate stable-API graduation decision — not for
19+
routine breaking changes.
20+
21+
---
22+
23+
## Cutting a release
24+
25+
1. Go to **Actions → release-please** and click **Run workflow**.
26+
2. Choose a bump type:
27+
- `patch` — bugfixes, docs, small changes
28+
- `minor` — breaking changes (see above)
29+
- `explicit` — you specify the exact version string (e.g. `0.10.0` or `0.10.0-beta.1`)
30+
3. The workflow creates a release PR. Review it, then merge.
31+
4. The GitHub Release and tag are created automatically on merge.
32+
33+
> **Note — release-please only understands `auto` or an explicit version string.**
34+
> The `patch`, `minor`, and `major` options in the workflow dropdown are conveniences
35+
> implemented in the workflow. The workflow reads the current manifest version, computes
36+
> the next version (e.g. `0.9.7` + patch = `0.9.8`), and passes that computed string
37+
> to release-please as an explicit `Release-As:` commit — exactly the same as choosing
38+
> `explicit` and typing it yourself. There is no native patch/minor/major mode in
39+
> release-please. This is why `explicit` is always the safest option when in doubt —
40+
> you are just skipping the arithmetic step.
41+
42+
---
43+
44+
## When to use `explicit`
45+
46+
Use `explicit` and type the version yourself in any of these situations:
47+
48+
**After a beta or non-conventional tag.**
49+
If the previous release was something like `0.9.7-beta.1`, release-please tracks the
50+
base semver (`0.9.7`) but cannot reliably decide whether the next release should be
51+
`0.9.7`, `0.9.8`, or `0.10.0`. It will often guess wrong.
52+
53+
The rule of thumb: **if the last tag had a pre-release suffix, always use `explicit` for
54+
the next release.**
55+
56+
**After a manually created tag.**
57+
Any tag created outside of the release-please workflow (e.g. hotfixes, manual git tags)
58+
is invisible to release-please's version logic. Use `explicit` to anchor the next version
59+
correctly.
60+
61+
**When you want a beta.**
62+
Release-please does not increment pre-release suffixes automatically. Use `explicit` for
63+
every beta, incrementing the suffix manually:
64+
```
65+
0.10.0-beta.1 → explicit: 0.10.0-beta.2 → explicit: 0.10.0
66+
```
67+
68+
---
69+
70+
## What goes in the changelog
71+
72+
Commit messages must follow [Conventional Commits](https://www.conventionalcommits.org/)
73+
for release-please to group them correctly:
74+
75+
```
76+
feat: add support for batch check → Added
77+
fix: correct retry logic for transient errors → Fixed
78+
docs: update API reference → Documentation
79+
perf: cache DNS lookups → Changed
80+
refactor: extract auth helper → (hidden)
81+
chore: bump dependencies → (hidden)
82+
```
83+
84+
---
85+
86+
## Troubleshooting
87+
88+
**"Invalid previous_tag parameter" error.**
89+
The manifest version does not have a corresponding GitHub Release object. Reset the
90+
manifest to the last valid tag:
91+
```bash
92+
echo '{ ".": "0.x.y" }' > .release-please-manifest.json
93+
git commit -am "chore: reset manifest to v0.x.y"
94+
git push origin main
95+
```
96+
97+
**Duplicate release PRs.**
98+
Close all stale ones. The workflow auto-closes stale open PRs on each dispatch, but
99+
merged duplicates need manual labelling with `autorelease: tagged`.
100+
101+
**Changelog shows everything ungrouped.**
102+
Make sure `changelog-type` in `release-please-config.json` is set to `"default"`, not
103+
`"github"`.

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ plugins {
1919
apply from: 'publish.gradle'
2020

2121
group = 'dev.openfga'
22-
version = '0.9.7'
22+
version = '0.9.7' // x-release-please-version
2323

2424
repositories {
2525
mavenCentral()

examples/basic-examples/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ext {
2323
}
2424

2525
dependencies {
26-
implementation("dev.openfga:openfga-sdk:0.9.7")
26+
implementation("dev.openfga:openfga-sdk:0.9.7") // x-release-please-version
2727

2828
// Serialization
2929
implementation("com.fasterxml.jackson.core:jackson-core:$jacksonVersion")

examples/opentelemetry/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ repositories {
7474
}
7575

7676
ext {
77-
fgaSdkVersion = "0.9.7"
77+
fgaSdkVersion = "0.9.7" // x-release-please-version
7878
openTelemetryVersion = "1.60.1"
7979
openTelemetryAlphaVersion = "1.60.1-alpha"
8080
}

examples/streamed-list-objects/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ext {
1717

1818
dependencies {
1919
// Use local build of SDK
20-
implementation files('../../build/libs/openfga-sdk-0.9.7.jar')
20+
implementation files('../../build/libs/openfga-sdk-0.9.7.jar') // x-release-please-version
2121

2222
// OpenFGA Language SDK for DSL transformation
2323
implementation("dev.openfga:openfga-language:v0.2.0-beta.1")

publish.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ publishing {
66
pom {
77
group = 'dev.openfga'
88
name = 'openfga-sdk'
9-
version = '0.9.7'
9+
version = project.version
1010
description = 'This is an autogenerated Java SDK for OpenFGA. It provides a wrapper around the [OpenFGA API definition](https://openfga.dev/api).'
1111
url = 'https://openfga.dev'
1212
licenses {

release-please-config.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"release-type": "simple",
4+
"packages": {
5+
".": {
6+
"include-component-in-tag": false,
7+
"changelog-path": "CHANGELOG.md",
8+
"changelog-type": "default",
9+
"bump-minor-pre-major": true,
10+
"bump-patch-for-minor-pre-major": true,
11+
"changelog-sections": [
12+
{ "type": "feat", "section": "Added", "hidden": false },
13+
{ "type": "fix", "section": "Fixed", "hidden": false },
14+
{ "type": "perf", "section": "Changed", "hidden": false },
15+
{ "type": "refactor", "section": "Changed", "hidden": false },
16+
{ "type": "revert", "section": "Removed", "hidden": false },
17+
{ "type": "docs", "section": "Documentation", "hidden": false },
18+
{ "type": "test", "section": "Tests", "hidden": true },
19+
{ "type": "ci", "section": "CI", "hidden": true },
20+
{ "type": "chore", "section": "Miscellaneous", "hidden": true }
21+
],
22+
"extra-files": [
23+
{ "type": "generic", "path": "build.gradle" },
24+
{ "type": "generic", "path": "src/main/java/dev/openfga/sdk/constants/FgaConstants.java" },
25+
{ "type": "generic", "path": "README.md" },
26+
{ "type": "generic", "path": "examples/opentelemetry/build.gradle" },
27+
{ "type": "generic", "path": "examples/basic-examples/build.gradle" },
28+
{ "type": "generic", "path": "examples/streamed-list-objects/build.gradle" }
29+
]
30+
}
31+
}
32+
}

0 commit comments

Comments
 (0)