Skip to content
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
18 changes: 18 additions & 0 deletions .github/workflows/__prepare-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Internal - Prepare release

on: # yamllint disable-line rule:truthy
push:
branches: [main]
pull_request:
branches: [main]
types: [opened, reopened, synchronize, edited]

permissions: {}

jobs:
release:
uses: hoverkraft-tech/ci-github-publish/.github/workflows/prepare-release.yml@f06e0e72a76bfca57c34d08d03e5c1914275fd4c # 2.0.0
permissions:
contents: read
pull-requests: write
75 changes: 75 additions & 0 deletions .github/workflows/__release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
name: Internal - Release

on: # yamllint disable-line rule:truthy
workflow_dispatch:
# checkov:skip=CKV_GHA_7: force only bypasses the no-changes guard; source and CI settings stay fixed.
inputs:
force:
description: "Release even when no relevant changes are detected."
type: boolean
required: false
default: false

schedule:
- cron: "25 8 * * 1"

permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

jobs:
ci:
if: github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch
uses: $/.github/workflows/__shared-ci.yml
permissions:
actions: read
contents: read
id-token: write
issues: write
packages: read
pull-requests: write
security-events: write
statuses: write

release:
name: Create and publish release
needs: ci
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
steps:
# Use the app token so publishing the tag triggers the main CI documentation jobs.
- id: generate-token
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
with:
client-id: ${{ vars.CI_BOT_APP_CLIENT_ID }}
private-key: ${{ secrets.CI_BOT_APP_PRIVATE_KEY }} # zizmor: ignore[secrets-outside-env] CI bot authentication is required to trigger tag workflows
permission-contents: write
permission-pull-requests: read

- name: Plan release
id: plan-release
uses: hoverkraft-tech/ci-github-publish/actions/release/plan@f06e0e72a76bfca57c34d08d03e5c1914275fd4c # 2.0.0
with:
target-sha: ${{ github.sha }}
github-token: ${{ steps.generate-token.outputs.token }}

- name: Create and publish release
if: (steps.plan-release.outputs.has-changes == 'true' || (github.event_name == 'workflow_dispatch' && inputs.force)) && steps.plan-release.outputs.tag != ''
uses: hoverkraft-tech/ci-github-publish/actions/release/create@f06e0e72a76bfca57c34d08d03e5c1914275fd4c # 2.0.0
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} # zizmor: ignore[secrets-outside-env] repository secret is scoped to the release summary step
with:
tag: ${{ steps.plan-release.outputs.tag }}
target-sha: ${{ github.sha }}
publish: "true"
changelog-summary: |
{
"llmAuth": ${{ toJSON(env.OPENAI_API_KEY) }},
"llmProvider": "openai"
}
github-token: ${{ steps.generate-token.outputs.token }}
49 changes: 49 additions & 0 deletions docs/development/releases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Releases

The repository uses the shared Hoverkraft release actions to calculate versions,
publish GitHub releases, and generate release summaries.

## Release preparation

[Prepare release](../../.github/workflows/__prepare-release.yml) runs on pushes to
`main` and when pull requests targeting `main` are opened, reopened, updated, or
edited. It applies the shared Conventional Commit labels to pull requests.

The shared release configuration increments the major version for breaking
changes, the minor version for features, and the patch version for other changes.
Tags use the existing `MAJOR.MINOR.PATCH` format. No repository override is needed
for these defaults.

## Publishing

[Release](../../.github/workflows/__release.yml) runs every Monday at 08:25 UTC and
supports manual dispatch. It runs only on the default branch and:

1. Runs the shared CI workflow.
2. Plans a release for the exact commit validated by CI.
3. Creates and publishes the release when relevant changes exist and a tag was
planned. Release notes include a generated summary.

Failed or skipped CI prevents publication. Concurrent release runs are serialized.
The GitHub App token lets the new tag trigger
[main CI](../../.github/workflows/__main-ci.yml), which regenerates action and
workflow documentation and sends its artifact to the public documentation site.

To release manually, open **Actions → Internal - Release → Run workflow** and
select `main`. Leave `force` disabled for normal releases. Enable it only to bypass
the no-changes check; the default-branch restriction, CI checks, and planned-tag
requirement still apply.

## Credentials

The workflow uses repository or inherited organization settings:

| Setting | Kind | Purpose |
| ------------------------ | -------- | ------------------------------------------------------------------------------- |
| `CI_BOT_APP_CLIENT_ID` | Variable | Identify the installed CI bot GitHub App. |
| `CI_BOT_APP_PRIVATE_KEY` | Secret | Create an installation token with Contents write and Pull requests read access. |
| `OPENAI_API_KEY` | Secret | Generate the release summary. |

The GitHub App must be installed on this repository and allowed to create release
tags. Keep these settings available to the repository before enabling scheduled
releases.
Loading