Repository navigation
ci: add release-please workflow #330
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
Open
fzipi
wants to merge
6
commits into
main
Choose a base branch
from
ci/add-release-please
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ad1bf6e
ci: add release-please workflow
fzipi ec44e75
ci(release-please): address review feedback
fzipi 03144d6
ci(release-please): tighten dry-run permissions and versions
fzipi 1ace53a
ci(release-please): align release-type to simple
fzipi bbb9ca2
ci(release-please): create the release (and its tag) after all
fzipi 7e2ad9c
Apply suggestion from @fzipi
fzipi 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,3 @@ | ||
| { | ||
| ".": "2.10.0" | ||
| } |
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,9 @@ | ||
| { | ||
| "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", | ||
| "release-type": "simple", | ||
| "include-v-in-tag": true, | ||
| "include-component-in-tag": false, | ||
| "packages": { | ||
| ".": {} | ||
| } | ||
| } |
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,76 @@ | ||
| name: release-please | ||
|
|
||
| # default token permissions: none | ||
| permissions: {} | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
| inputs: | ||
| dry-run: | ||
| description: "Dry run — preview the release PR without creating or modifying anything" | ||
| type: boolean | ||
| default: false | ||
|
|
||
| jobs: | ||
| release-please: | ||
| runs-on: ubuntu-latest | ||
| # The real release path's writes (PR, changelog commit, tag) go through | ||
| # the separately-scoped App token below, not this job's GITHUB_TOKEN -- | ||
| # the only thing GITHUB_TOKEN is used for here is the read-only dry-run | ||
| # preview, so it needs no write access. | ||
| permissions: | ||
| contents: read | ||
| pull-requests: read | ||
| issues: read | ||
|
|
||
| steps: | ||
| # GITHUB_TOKEN-authored pushes never trigger other workflows, so a tag | ||
| # created with it would not fire the tag-triggered goreleaser workflow. | ||
| # RELEASE_PLEASE_CLIENT_ID/_APP_PRIVATE_KEY currently hold the same | ||
| # GitHub App credentials as HOMEBREW_APP_ID/_PRIVATE_KEY. client-id (not | ||
| # app-id): create-github-app-token deprecated app-id in favor of it. | ||
| # Skipped for dry-run: the preview below never uses it. | ||
| - uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # ratchet:actions/create-github-app-token@v3.2.0 | ||
| id: app-token | ||
| if: inputs.dry-run != true | ||
| with: | ||
| client-id: ${{ secrets.RELEASE_PLEASE_CLIENT_ID }} | ||
| private-key: ${{ secrets.RELEASE_PLEASE_APP_PRIVATE_KEY }} | ||
| permission-contents: write | ||
| permission-pull-requests: write | ||
| permission-issues: write | ||
|
|
||
| - uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # ratchet:googleapis/release-please-action@v5.0.0 | ||
| if: inputs.dry-run != true | ||
| with: | ||
| token: ${{ steps.app-token.outputs.token }} | ||
| config-file: .github/release-please-config.json | ||
| manifest-file: .github/.release-please-manifest.json | ||
|
|
||
| # A real preview: the release-please CLI's --dry-run reports what would | ||
| # happen via read-only GitHub API calls, no PR or tag is ever created, | ||
| # so it runs on the default GITHUB_TOKEN instead of the write-scoped App | ||
| # token above. | ||
| - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # ratchet:actions/setup-node@v6.0.0 | ||
| if: inputs.dry-run == true | ||
| with: | ||
| node-version: "24" | ||
| package-manager-cache: false | ||
|
|
||
| - name: Preview release PR | ||
| if: inputs.dry-run == true | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| REPO_URL: ${{ github.repository }} | ||
| run: | | ||
| # Pinned to the exact release-please version googleapis/release-please-action@v5.0.0 | ||
| # bundles, so the preview matches what the real run above would compute. | ||
| npx --yes release-please@17.6.0 release-pr \ | ||
| --token="${GITHUB_TOKEN}" \ | ||
| --repo-url="${REPO_URL}" \ | ||
| --config-file=.github/release-please-config.json \ | ||
| --manifest-file=.github/.release-please-manifest.json \ | ||
| --dry-run | ||
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.