Skip to content

Commit bb4c21f

Browse files
committed
[CNSL-1941] Add release workflow and CLAUDE.md
Add a GitHub Actions workflow that runs autotag-from-changelog on pushes to main and dispatches an sdk-release event to ccloud-private when a new tag is created. The dispatch step requires a DISPATCH_TOKEN repository secret with repo scope on cockroachdb/ccloud-private, and a repository_dispatch workflow in ccloud-private listening for the sdk-release event type. Neither exists yet.
1 parent 749e493 commit bb4c21f

3 files changed

Lines changed: 52 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release SDK
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
# contents:write is required for autotag-from-changelog to push tags.
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v6
16+
with:
17+
fetch-depth: 0
18+
19+
- uses: cockroachdb/actions/autotag-from-changelog@v0
20+
id: autotag
21+
22+
# Dispatches an sdk-release event to ccloud-private. Requires a
23+
# CCLOUD_PRIVATE_DISPATCH_PAT secret — a fine-grained PAT with
24+
# contents:write on cockroachdb/ccloud-private, since GITHUB_TOKEN
25+
# cannot trigger workflows in other repositories.
26+
- name: Dispatch to ccloud-private
27+
if: steps.autotag.outputs.tag-created == 'true'
28+
env:
29+
GH_TOKEN: ${{ secrets.CCLOUD_PRIVATE_DISPATCH_PAT }}
30+
run: |
31+
if [ -z "$GH_TOKEN" ]; then
32+
echo "::warning::CCLOUD_PRIVATE_DISPATCH_PAT secret is not set. Skipping dispatch to ccloud-private for ${{ steps.autotag.outputs.tag }}."
33+
exit 0
34+
fi
35+
gh api repos/cockroachdb/ccloud-private/dispatches \
36+
-f event_type=sdk-release \
37+
-f "client_payload[version]=${{ steps.autotag.outputs.tag }}"

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased]
9+
10+
### Added
11+
12+
- Added release workflow that auto-tags from CHANGELOG and dispatches
13+
sdk-release events to ccloud-private. Requires a `CCLOUD_PRIVATE_DISPATCH_PAT`
14+
repository secret (fine-grained PAT with contents:write on
15+
cockroachdb/ccloud-private) and a corresponding `repository_dispatch`
16+
workflow in ccloud-private to handle the `sdk-release` event
17+
818
## [6.10.0] - 2025-11-19
919

1020
### Added

CLAUDE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# CLAUDE.md
2+
3+
## GitHub Actions
4+
5+
- When writing or modifying GitHub Actions workflows, always look up the latest major version of each action before using it. Do not assume you know the current version.

0 commit comments

Comments
 (0)