diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..075026a --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,55 @@ +name: release-please + +# Keeps one open release pull request that collects the Conventional Commits +# merged since the last release into CHANGELOG.md and picks the next version. +# Merging it pushes the vX.Y.Z tag and a draft GitHub release; the tag starts +# release.yml, which publishes the package. +# +# Needs the organization's release bot GitHub App, because tags and pull +# requests made with the workflow's own GITHUB_TOKEN do not start other +# workflows: +# variable RELEASE_BOT_APP_ID (or RELEASE_BOT_CLIENT_ID) and +# secret RELEASE_BOT_PRIVATE_KEY. +"on": + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: release-please + cancel-in-progress: false + +jobs: + release-please: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Check the release bot is set up + id: bot + env: + APP_ID: ${{ vars.RELEASE_BOT_APP_ID }} + CLIENT_ID: ${{ vars.RELEASE_BOT_CLIENT_ID }} + HAS_KEY: ${{ secrets.RELEASE_BOT_PRIVATE_KEY != '' }} + run: | + if { [ -n "${APP_ID}" ] || [ -n "${CLIENT_ID}" ]; } && [ "${HAS_KEY}" = "true" ]; then + echo "ready=true" >> "$GITHUB_OUTPUT" + else + echo "::warning title=release-please skipped::Set the variable RELEASE_BOT_APP_ID and secret RELEASE_BOT_PRIVATE_KEY (see CONTRIBUTING.md, Releases)." + echo "ready=false" >> "$GITHUB_OUTPUT" + fi + - uses: actions/create-github-app-token@f418cff399f7aef4c2f0ad47e25ca7a6abbdd6fc # v3.4.0 + if: steps.bot.outputs.ready == 'true' + id: app + with: + # GitHub accepts either the App ID or the Client ID here. + client-id: ${{ vars.RELEASE_BOT_CLIENT_ID || vars.RELEASE_BOT_APP_ID }} + private-key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }} + - uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0 + if: steps.bot.outputs.ready == 'true' + with: + token: ${{ steps.app.outputs.token }} + config-file: release-please-config.json + manifest-file: .release-please-manifest.json diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..9d957c7 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1 @@ +{ ".": "0.1.0" } diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..1c13632 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,64 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "release-type": "go", + "include-v-in-tag": true, + "include-component-in-tag": false, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": false, + "draft": true, + "force-tag-creation": true, + "pull-request-title-pattern": "chore: release ${version}", + "changelog-sections": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "perf", + "section": "Performance" + }, + { + "type": "deps", + "section": "Dependencies" + }, + { + "type": "docs", + "section": "Documentation" + }, + { + "type": "refactor", + "section": "Other", + "hidden": true + }, + { + "type": "chore", + "section": "Other", + "hidden": true + }, + { + "type": "ci", + "section": "Other", + "hidden": true + }, + { + "type": "test", + "section": "Other", + "hidden": true + }, + { + "type": "build", + "section": "Other", + "hidden": true + } + ], + "packages": { + ".": { + "package-name": "external-dns-noderings-webhook", + "changelog-path": "CHANGELOG.md" + } + } +}