-
Notifications
You must be signed in to change notification settings - Fork 23
feat: release automation configs #312
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
Merged
+205
−7
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| name: release-please | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
| inputs: | ||
| bump-type: | ||
| description: > | ||
| Version bump type. Select 'explicit' to supply an exact version via | ||
| the 'release-version' field below. Select 'auto' to let | ||
| conventional-commits determine the bump automatically. | ||
| required: false | ||
| type: choice | ||
| default: 'auto' | ||
| options: | ||
| - auto | ||
| - patch | ||
| - minor | ||
| - major | ||
| - explicit | ||
| release-version: | ||
| description: > | ||
| Explicit version to release (e.g. 1.2.3 or 1.4.0-beta.1). | ||
| required: false | ||
| type: string | ||
|
|
||
| jobs: | ||
| release: | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| if: | | ||
| github.event_name == 'workflow_dispatch' || | ||
| startsWith(github.event.head_commit.message, 'release:') | ||
| uses: openfga/sdk-generator/.github/workflows/release-please.yml@main | ||
SoulPancake marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| with: | ||
| trigger-event: ${{ github.event_name }} | ||
| bump-type: ${{ inputs.bump-type || 'auto' }} | ||
| release-version: ${{ inputs.release-version || '' }} | ||
| secrets: | ||
| RELEASER_APP_ID: ${{ secrets.RELEASER_APP_ID }} | ||
| RELEASER_APP_PRIVATE_KEY: ${{ secrets.RELEASER_APP_PRIVATE_KEY }} | ||
| GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | ||
| GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| ".": "0.9.7" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| # Release guide | ||
|
|
||
| This project uses [release-please](https://github.com/googleapis/release-please) via a | ||
| `workflow_dispatch`-triggered GitHub Actions workflow. This document explains how to cut | ||
| a release and what to watch out for. | ||
SoulPancake marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| --- | ||
|
|
||
| ## Versioning rules for this project | ||
|
|
||
| We are pre-1.0.0. Semver conventions are relaxed: | ||
|
|
||
| | Change type | Bump | Example | | ||
| |--- |--- |--- | | ||
| | Breaking change | **Minor** (`0.x.0`) | `0.9.0` → `0.10.0` | | ||
| | Everything else | **Patch** (`0.0.x`) | `0.9.7` → `0.9.8` | | ||
|
|
||
| Major bumps (`1.0.0`) are reserved for a deliberate stable-API graduation decision — not for | ||
| routine breaking changes. | ||
|
|
||
| --- | ||
|
|
||
| ## Cutting a release | ||
|
|
||
| 1. Go to **Actions → release-please** and click **Run workflow**. | ||
| 2. Choose a bump type: | ||
| - `patch` — bugfixes, docs, small changes | ||
| - `minor` — breaking changes (see above) | ||
| - `explicit` — you specify the exact version string (e.g. `0.10.0` or `0.10.0-beta.1`) | ||
| 3. The workflow creates a release PR. Review it, then merge. | ||
| 4. The GitHub Release and tag are created automatically on merge. | ||
|
|
||
SoulPancake marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| > **Note — release-please only understands `auto` or an explicit version string.** | ||
| > The `patch`, `minor`, and `major` options in the workflow dropdown are conveniences | ||
| > implemented in the workflow. The workflow reads the current manifest version, computes | ||
| > the next version (e.g. `0.9.7` + patch = `0.9.8`), and passes that computed string | ||
| > to release-please as an explicit `Release-As:` commit — exactly the same as choosing | ||
| > `explicit` and typing it yourself. There is no native patch/minor/major mode in | ||
| > release-please. This is why `explicit` is always the safest option when in doubt — | ||
| > you are just skipping the arithmetic step. | ||
|
|
||
| --- | ||
|
|
||
| ## When to use `explicit` | ||
|
|
||
| Use `explicit` and type the version yourself in any of these situations: | ||
|
|
||
| **After a beta or non-conventional tag.** | ||
| If the previous release was something like `0.9.7-beta.1`, release-please tracks the | ||
| base semver (`0.9.7`) but cannot reliably decide whether the next release should be | ||
| `0.9.7`, `0.9.8`, or `0.10.0`. It will often guess wrong. | ||
|
|
||
| The rule of thumb: **if the last tag had a pre-release suffix, always use `explicit` for | ||
| the next release.** | ||
|
|
||
| **After a manually created tag.** | ||
| Any tag created outside of the release-please workflow (e.g. hotfixes, manual git tags) | ||
| is invisible to release-please's version logic. Use `explicit` to anchor the next version | ||
| correctly. | ||
|
|
||
| **When you want a beta.** | ||
| Release-please does not increment pre-release suffixes automatically. Use `explicit` for | ||
| every beta, incrementing the suffix manually: | ||
| ``` | ||
| 0.10.0-beta.1 → explicit: 0.10.0-beta.2 → explicit: 0.10.0 | ||
| ``` | ||
SoulPancake marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| --- | ||
|
|
||
| ## What goes in the changelog | ||
|
|
||
| Commit messages must follow [Conventional Commits](https://www.conventionalcommits.org/) | ||
| for release-please to group them correctly: | ||
|
|
||
| ``` | ||
| feat: add support for batch check → Added | ||
| fix: correct retry logic for transient errors → Fixed | ||
| docs: update API reference → Documentation | ||
| perf: cache DNS lookups → Changed | ||
| refactor: extract auth helper → (hidden) | ||
| chore: bump dependencies → (hidden) | ||
| ``` | ||
SoulPancake marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| --- | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| **"Invalid previous_tag parameter" error.** | ||
| The manifest version does not have a corresponding GitHub Release object. Reset the | ||
| manifest to the last valid tag: | ||
| ```bash | ||
| echo '{ ".": "0.x.y" }' > .release-please-manifest.json | ||
| git commit -am "chore: reset manifest to v0.x.y" | ||
| git push origin main | ||
| ``` | ||
|
|
||
| **Duplicate release PRs.** | ||
| Close all stale ones. The workflow auto-closes stale open PRs on each dispatch, but | ||
| merged duplicates need manual labelling with `autorelease: tagged`. | ||
|
|
||
| **Changelog shows everything ungrouped.** | ||
| Make sure `changelog-type` in `release-please-config.json` is set to `"default"`, not | ||
| `"github"`. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| { | ||
| "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", | ||
| "release-type": "simple", | ||
| "packages": { | ||
| ".": { | ||
| "include-component-in-tag": false, | ||
| "changelog-path": "CHANGELOG.md", | ||
| "changelog-type": "default", | ||
| "bump-minor-pre-major": true, | ||
| "bump-patch-for-minor-pre-major": true, | ||
| "changelog-sections": [ | ||
| { "type": "feat", "section": "Added", "hidden": false }, | ||
| { "type": "fix", "section": "Fixed", "hidden": false }, | ||
| { "type": "perf", "section": "Changed", "hidden": false }, | ||
| { "type": "refactor", "section": "Changed", "hidden": false }, | ||
| { "type": "revert", "section": "Removed", "hidden": false }, | ||
| { "type": "docs", "section": "Documentation", "hidden": false }, | ||
| { "type": "test", "section": "Tests", "hidden": true }, | ||
| { "type": "ci", "section": "CI", "hidden": true }, | ||
| { "type": "chore", "section": "Miscellaneous", "hidden": true } | ||
| ], | ||
| "extra-files": [ | ||
| { "type": "generic", "path": "build.gradle" }, | ||
| { "type": "generic", "path": "src/main/java/dev/openfga/sdk/constants/FgaConstants.java" }, | ||
| { "type": "generic", "path": "README.md" }, | ||
| { "type": "generic", "path": "examples/opentelemetry/build.gradle" }, | ||
| { "type": "generic", "path": "examples/basic-examples/build.gradle" }, | ||
| { "type": "generic", "path": "examples/streamed-list-objects/build.gradle" } | ||
| ] | ||
SoulPancake marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.