Skip to content

Add label-driven release workflow - #157

Merged
haacked merged 1 commit into
mainfrom
haacked/better-release-process
Feb 25, 2026
Merged

Add label-driven release workflow#157
haacked merged 1 commit into
mainfrom
haacked/better-release-process

Conversation

@haacked

@haacked haacked commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Add a label-driven release workflow matching the SDK release process, adapted from posthog-go.

Changes

  • New .github/workflows/release.yml — Triggered when a PR with release + bump-{patch,minor,major} labels is merged to main. The workflow:
    • Posts to #approvals-client-libraries in Slack requesting approval
    • Pauses at the Release GitHub Environment gate for maintainer approval
    • Bumps the version in Directory.Build.props, builds, tests
    • Commits the version bump to main via a GitHub App token
    • Creates a git tag and GitHub Release with auto-generated notes
    • The GitHub Release triggers the existing main.yaml workflow to publish to NuGet
    • Posts Slack thread updates for approval, success, failure, and rejection
    • Sends failure events to PostHog for observability
  • Renamed bin/releasebin/release-local as a manual fallback
  • Updated README with the new release process

Intentional differences from posthog-go

  • No id-token: write permission (NuGet publishing happens in main.yaml, not here)
  • No CHANGELOG.md step (we use gh release create --generate-notes instead)
  • Uses gh release create instead of raw gh api for creating releases

One-time setup required

Per the SDK releases handbook:

  1. GitHub App: Create Releaser (posthog-dotnet) with Contents: Read and write, install on this repo only
  2. GitHub Environment: Create Release environment with PostHog/client-libraries-approvers and PostHog/team-client-libraries as required reviewers, self-review prevention enabled
  3. Environment secrets: GH_APP_POSTHOG_DOTNET_RELEASER_APP_ID and GH_APP_POSTHOG_DOTNET_RELEASER_PRIVATE_KEY
  4. Org secrets/variables access (via Terraform): SLACK_CLIENT_LIBRARIES_BOT_TOKEN, POSTHOG_PROJECT_API_KEY, GROUP_CLIENT_LIBRARIES_SLACK_GROUP_ID, SLACK_APPROVALS_CLIENT_LIBRARIES_CHANNEL_ID
  5. Bypass rulesets: Add the GitHub App to CodeQL and PR bypass lists
  6. Labels: Create release, bump-patch, bump-minor, bump-major

Test plan

  • Complete all one-time setup steps above
  • Create a test PR with a trivial change, add release + bump-patch labels
  • Merge and verify Slack notification posts to #approvals-client-libraries
  • Verify the workflow pauses at the Environment approval gate
  • Approve and verify: version bump commit on main, git tag, GitHub Release with auto-generated notes
  • Verify main.yaml triggers and publishes to NuGet
  • Verify Slack thread gets the success reply

Comment thread .github/workflows/release.yml Fixed
@github-actions

github-actions Bot commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

posthog-dotnet Compliance Report

Date: 2026-02-25 22:16:27 UTC
Duration: 120007ms

✅ All Tests Passed!

29/29 tests passed


Capture Tests

29/29 tests passed

View Details
Test Status Duration
Format Validation.Event Has Required Fields 155ms
Format Validation.Event Has Uuid 126ms
Format Validation.Event Has Lib Properties 110ms
Format Validation.Distinct Id Is String 110ms
Format Validation.Token Is Present 111ms
Format Validation.Custom Properties Preserved 114ms
Format Validation.Event Has Timestamp 111ms
Retry Behavior.Retries On 503 8125ms
Retry Behavior.Does Not Retry On 400 2020ms
Retry Behavior.Does Not Retry On 401 2013ms
Retry Behavior.Respects Retry After Header 8118ms
Retry Behavior.Implements Backoff 22129ms
Retry Behavior.Retries On 500 6120ms
Retry Behavior.Retries On 502 6120ms
Retry Behavior.Retries On 504 6120ms
Retry Behavior.Max Retries Respected 22033ms
Deduplication.Generates Unique Uuids 117ms
Deduplication.Preserves Uuid On Retry 6116ms
Deduplication.Preserves Uuid And Timestamp On Retry 13126ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry 6126ms
Deduplication.No Duplicate Events In Batch 116ms
Deduplication.Different Events Have Different Uuids 111ms
Compression.Sends Gzip When Enabled 109ms
Batch Format.Uses Proper Batch Structure 109ms
Batch Format.Flush With No Events Sends Nothing 107ms
Batch Format.Multiple Events Batched Together 115ms
Error Handling.Does Not Retry On 403 2012ms
Error Handling.Does Not Retry On 413 2012ms
Error Handling.Retries On 408 6117ms

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a label-driven automated release workflow for posthog-dotnet, replacing the manual release process with a GitHub Actions workflow that handles version bumping, tagging, and publishing when PRs with specific labels are merged to main. The workflow includes Slack notifications, environment-based approval gates, and PostHog observability.

Changes:

  • Added automated release workflow triggered by PR labels (release + bump-{patch,minor,major})
  • Renamed manual release script from bin/release to bin/release-local as a fallback option
  • Updated README documentation to reflect the new label-driven release process

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 11 comments.

File Description
.github/workflows/release.yml New automated release workflow with Slack notifications, approval gates, version bumping, and GitHub Release creation
bin/release-local Renamed from bin/release - manual fallback script for local release preparation
README.md Updated release process documentation to describe label-driven workflow and manual fallback

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml Outdated
Comment thread README.md Outdated
Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
Add a GitHub Actions release workflow matching the SDK release process
used by posthog-go. Triggered by PR labels (release + bump-{type}),
with GitHub Environment approval gate and Slack notifications.

The workflow bumps the version in Directory.Build.props, builds, tests,
commits to main via a GitHub App token, creates a tag and GitHub Release
with auto-generated notes, which triggers the existing main.yaml
workflow to publish to NuGet.

Also renames bin/release to bin/release-local as a manual fallback and
updates main.yaml to use actions/setup-dotnet@v4 consistently.
@haacked
haacked force-pushed the haacked/better-release-process branch from 4352405 to d863bff Compare February 25, 2026 22:13
@haacked
haacked marked this pull request as ready for review February 25, 2026 22:18
@haacked
haacked requested a review from a team February 25, 2026 22:20

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

4 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@Piccirello

Copy link
Copy Markdown
Member

All one-time steps above completed!

@haacked
haacked merged commit e95b57c into main Feb 25, 2026
12 checks passed
@haacked
haacked deleted the haacked/better-release-process branch February 25, 2026 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants