Skip to content

Latest commit

 

History

History
120 lines (80 loc) · 4.44 KB

File metadata and controls

120 lines (80 loc) · 4.44 KB

Deployment Procedure

Cutting a Release from the GitHub Web UI

The Cut Release workflow (cut-release.yml) performs the whole procedure below without a workstation. Run it from Actions -> Cut Release -> Run workflow, entering the new version (e.g. 0.3.2, no v prefix).

It replicates the workstation steps: builds and runs the tests on a Windows runner, stamps the version into main.go, README.md, and CHANGELOG.md, commits Release X.Y.Z, tags X.Y.Z, and pushes to master — which triggers the normal Release workflow chain.

Prerequisites:

  • CHANGELOG.md must have a populated ## [Unreleased] section on master; the workflow renames it to ## [X.Y.Z] - date and uses it as the release notes. Keep release notes accumulating there as changes land.
  • The WINGET_TOKEN secret must be set. The workflow pushes the tag with this PAT because tags pushed with the default GITHUB_TOKEN do not trigger other workflows (the Release workflow would never run).
  • The workflow always releases from master, regardless of which ref it is dispatched on.

Release Checklist

Before releasing a new version:

  1. Test the build locally

    go build -o claude-code-switcher.exe -ldflags="-H windowsgui" .
  2. Run tests

    go test ./...
  3. Test the executable manually - verify the fix/feature works

Release Steps

1. Update CHANGELOG.md

Add a new section at the top (below the header):

## [X.Y.Z] - YYYY-MM-DD

### Added
- New features

### Fixed
- Bug fixes

### Changed
- Changes to existing functionality

2. Update README.md

Update the version number in the badge line:

> **Latest Version**: X.Y.Z | [See What's New](CHANGELOG.md)

3. Update main.go

Update the appVersion constant:

const appVersion = "X.Y.Z"

4. Commit and Tag

# Stage and commit your changes (if not already committed)
git add .
git commit -m "Description of changes"

# Commit the version bump
git add CHANGELOG.md README.md main.go
git commit -m "Release X.Y.Z"

# Create the tag (NO 'v' prefix - required for GitHub Actions)
git tag -a X.Y.Z -m "Release X.Y.Z"

# Push commits and tag
git push
git push origin X.Y.Z

Tag Format

The GitHub Actions release workflow triggers on tags matching [0-9]+.[0-9]+.[0-9]+.

  • Correct: 0.1.1, 1.0.0, 2.3.4
  • Wrong: v0.1.1, 0.1, release-0.1.1

What Happens Automatically

When you push a correctly formatted tag, GitHub Actions will:

  1. Release workflow (release.yml): builds the exe, extracts changelog, creates a GitHub Release with the binary attached
  2. Publish to WinGet (winget.yml): runs from release.yml via workflow_call and submits an updated manifest PR to microsoft/winget-pkgs (requires WINGET_TOKEN)
  3. Publish to Scoop (scoop.yml): runs from release.yml via workflow_call and updates fanis/scoop-apps bucket/claude-code-switcher.json
  4. Publish to Chocolatey (chocolatey.yml): manual workflow_dispatch only, used when you explicitly want to publish an already-released version to chocolatey.org (requires CHOCO_API_KEY)

The package publishing workflows support workflow_dispatch, so a specific released version can be republished manually if needed without creating a new tag. Chocolatey is intentionally manual-only.

Verifying the Release

After pushing the tag:

  1. Check the Release workflow run: https://github.com/fanis/claude-code-switcher/actions
  2. Verify the GitHub Release: https://github.com/fanis/claude-code-switcher/releases
  3. Check that Publish to WinGet and Publish to Scoop ran after the Release job.
  4. If you want Chocolatey for that version, run Publish to Chocolatey manually with the version input.
  5. Check winget PRs: https://github.com/microsoft/winget-pkgs/pulls?q=ClaudeCodeSwitcher
  6. Check the Scoop bucket manifest: https://github.com/fanis/scoop-apps/blob/master/bucket/claude-code-switcher.json
  7. Check Chocolatey: https://community.chocolatey.org/packages/claude-code-switcher.portable

Repo Secrets

Secret Source Purpose
WINGET_TOKEN GitHub PAT with public_repo scope winget-releaser action pushes manifest PRs to microsoft/winget-pkgs; also used by Cut Release to push the release commit and tag so the tag triggers the Release workflow
CHOCO_API_KEY Chocolatey account API key choco push to chocolatey.org