99# Triggers: Push of semantic version tag (e.g., v1.2.3)
1010# Performance Target: ≤10 minutes total (excluding manual approval)
1111# Artifacts: Reuses build artifacts, creates release packages
12+ #
13+ # Manual Testing on PR:
14+ # 1. Run Build workflow manually on your PR branch first
15+ # 2. Note the commit SHA from the build run
16+ # 3. Use Actions tab → Release → Run workflow
17+ # - Select your PR branch
18+ # - Enter test version (e.g., v0.0.1-test)
19+ # - Check 'Skip Homebrew' to avoid tap updates
20+ # - Check 'Dry run' to skip actual release creation
21+ # 4. Review logs to verify workflow logic
22+ #
23+ # Production Release:
24+ # 1. Merge PR to main → triggers build.yml automatically
25+ # 2. Wait for build to complete successfully
26+ # 3. Tag the merge commit: git tag v1.0.0 && git push origin v1.0.0
27+ # 4. Release workflow triggers automatically
1228
1329name : Release
1430
1935 workflow_dispatch : # Allow manual triggering for testing
2036 inputs :
2137 tag :
22- description : ' Version tag to release (e.g., v1.2.3 )'
38+ description : ' Version tag to release (e.g., v0.0.1-test for testing )'
2339 required : true
2440 type : string
41+ skip_homebrew :
42+ description : ' Skip Homebrew publication (for PR testing)'
43+ required : false
44+ type : boolean
45+ default : false
46+ dry_run :
47+ description : ' Dry run - skip release creation (logs only)'
48+ required : false
49+ type : boolean
50+ default : false
2551
2652# Prevent concurrent releases to avoid conflicts
2753# Do not cancel in-progress releases as they involve publishing to external services
@@ -269,6 +295,15 @@ jobs:
269295 run : |
270296 VERSION="v${{ needs.validate-version.outputs.version }}"
271297
298+ # Check if this is a dry run
299+ if [ "${{ github.event.inputs.dry_run }}" = "true" ]; then
300+ echo "🧪 DRY RUN - Would create release $VERSION"
301+ echo "📝 Release notes:"
302+ cat release-notes.md
303+ echo "⏭️ Skipping actual release creation"
304+ exit 0
305+ fi
306+
272307 # Create release with notes
273308 gh release create "$VERSION" \
274309 --title "Release $VERSION" \
@@ -278,6 +313,12 @@ jobs:
278313
279314 echo "✅ GitHub release created: $VERSION"
280315
316+ # Check if this is a dry run
317+ if [ "${{ github.event.inputs.dry_run }}" = "true" ]; then
318+ echo "🧪 DRY RUN - Skipping artifact uploads"
319+ exit 0
320+ fi
321+
281322 # Upload all artifacts
282323 echo "📤 Uploading artifacts..."
283324
@@ -303,10 +344,12 @@ jobs:
303344 # Performance Target: ≤7 minutes
304345 # Requires: HOMEBREW_TAP_TOKEN secret configured in 'production' environment
305346 # Note: VS Code may show "'production' is not valid" - this is a false positive
347+ # Can be skipped with workflow_dispatch skip_homebrew input for PR testing
306348 publish-homebrew :
307349 name : Publish to Homebrew
308350 runs-on : macos-latest # Changed to macOS for bottle creation
309351 needs : [validate-version, create-github-release]
352+ if : ${{ github.event.inputs.skip_homebrew != 'true' && github.event.inputs.dry_run != 'true' }}
310353 environment :
311354 name : production # Configured in GitHub repository settings
312355 permissions :
0 commit comments