Skip to content

feat: Add release-please #233

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
merged 1 commit into from
Jan 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/release-please/release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"packages": {
".": {
"release-type": "go",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": false,
"include-component-in-tag": false,
"changelog-sections": [
{ "type": "feat", "section": "Features" },
{ "type": "fix", "section": "Fixes" },
{ "type": "docs", "section": "Documentation" },
{ "type": "chore", "section": "Miscellaneous Chores" }
]
}
},
"draft-pull-request": true,
"pull-request-title-pattern": "chore: release ${version}",
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}
3 changes: 3 additions & 0 deletions .github/release-please/release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.10.0"
}
49 changes: 49 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release Please

on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: write
pull-requests: write
id-token: write

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- name: Retrieve release app credentials
id: get-secrets
uses: grafana/shared-workflows/actions/get-vault-secrets@main
with:
repo_secrets: |
GITHUB_APP_ID=github-app:app-id
GITHUB_APP_INSTALLATION_ID=github-app:app-installation-id
GITHUB_APP_PRIVATE_KEY=github-app:private-key

- name: Get repository name
env:
REPOSITORY: ${{ github.repository }}
id: info
run: echo "repository_name=${REPOSITORY#*/}" >> "$GITHUB_OUTPUT"

- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@c1a285145b9d317df6ced56c09f525b5c2b6f755 # v1
with:
app-id: ${{ env.GITHUB_APP_ID }}
private-key: ${{ env.GITHUB_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: ${{ steps.info.outputs.repository_name }}

- name: Release
id: release
uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f # v4
with:
token: ${{ steps.generate-token.outputs.token }}
target-branch: main
config-file: .github/release-please/release-please-config.json
manifest-file: .github/release-please/release-please-manifest.json