Skip to content
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

chore: Setup release-please #933

Merged
merged 5 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
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
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 @@
{
".": "1.15.2"
}
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": "node",
"bump-minor-pre-major": true,
"include-component-in-tag": false,
"changelog-sections": [
{ "type": "feat", "section": "Features" },
{ "type": "fix", "section": "Fixes" },
{ "type": "docs", "section": "Documentation" },
{ "type": "chore", "section": "Miscellaneous Chores" },
{ "type": "refactor", "section": "Code Refactoring" },
{ "type": "release", "section": "Release"}
]
}
},
"draft-pull-request": true,
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, merging to main will always trigger the release, is that right?

Copy link
Contributor Author

@ka3de ka3de Oct 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah apologies, I should have linked here the actual process definition, you can see it in https://github.com/grafana/deployment_tools/pull/177384, this is the part specifically for the app here. I'll appreciate any comment that you have on that PR too.

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@3378cda945da322a8db4b193e19d46352ebe2de5 # 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
Loading