Skip to content

Commit 0d4f196

Browse files
committed
docs: update README with Release section
1 parent 5d205fe commit 0d4f196

1 file changed

Lines changed: 58 additions & 24 deletions

File tree

README.md

Lines changed: 58 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -436,14 +436,14 @@ go tool cover -html=coverage.out
436436
Test without making actual changes:
437437

438438
```bash
439-
DRY_RUN=true ./github-copier
439+
./github-copier -env .env.test -dry-run
440440
```
441441

442442
In dry-run mode:
443-
- Webhooks are processed
444-
- Files are matched and transformed
445-
- Audit events are logged
446-
- **NO actual commits or PRs are created**
443+
- Webhooks are received and processed through the full pipeline
444+
- Files are matched and path transformations are applied
445+
- GitHub auth failures are tolerated (logged as warnings)
446+
- **No commits, PRs, or file uploads are created**
447447

448448
### Structured Logging
449449

@@ -465,12 +465,18 @@ github-copier/
465465
├── github-app-manifest.yml # GitHub App permissions documentation
466466
├── cmd/
467467
│ ├── config-validator/ # CLI validation tool
468+
│ ├── test-pem/ # PEM key validation tool
468469
│ └── test-webhook/ # Webhook testing tool
469470
├── configs/
470471
│ ├── environment.go # Environment configuration
471472
│ ├── .env.local.example # Local environment template
472-
│ ├── env.yaml.example # YAML environment template
473473
│ └── copier-config.example.yaml # Config template
474+
├── scripts/
475+
│ ├── release.sh # Create versioned releases
476+
│ ├── deploy-cloudrun.sh # Cloud Run deployment
477+
│ ├── ci-local.sh # Run CI checks locally
478+
│ ├── integration-test.sh # End-to-end integration tests
479+
│ └── ... # Additional helper scripts
474480
├── services/
475481
│ ├── webhook_handler_new.go # Webhook handler (orchestrator)
476482
│ ├── workflow_processor.go # ProcessWorkflow() - core logic
@@ -484,21 +490,21 @@ github-copier/
484490
│ ├── token_manager.go # Thread-safe token state management
485491
│ ├── rate_limit.go # GitHub API rate limit handling
486492
│ ├── delivery_tracker.go # Webhook idempotency (deduplication)
487-
│ ├── errors.go # Sentinel errors
493+
│ ├── errors.go # Sentinel errors & classification
488494
│ ├── logger.go # Structured logging (slog)
489495
│ ├── service_container.go # Dependency injection container
490496
│ ├── file_state_service.go # Thread-safe upload/deprecation queues
491-
│ ├── health_metrics.go # Health, readiness & metrics endpoints
492-
│ ├── audit_logger.go # MongoDB audit logging
497+
│ ├── health_metrics.go # Health, readiness, metrics & config endpoints
493498
│ ├── slack_notifier.go # Slack notifications
494499
│ └── pr_template_fetcher.go # PR template resolution
495500
├── types/
496501
│ ├── config.go # Configuration types
497502
│ └── types.go # Core types
498503
└── docs/
499-
├── ARCHITECTURE.md # Architecture overview
500-
├── DEPLOYMENT.md # Deployment guide (Cloud Run)
501-
├── FAQ.md # Frequently asked questions
504+
├── DEPLOYMENT.md # Deployment & rollback guide
505+
├── CONFIG-REFERENCE.md # Environment variables & YAML schema
506+
├── WEBHOOK-TESTING.md # Webhook testing guide
507+
├── SLACK-NOTIFICATIONS.md # Slack integration guide
502508
└── ... # Additional documentation
503509
```
504510
@@ -511,31 +517,58 @@ container := NewServiceContainer(config)
511517
// All services initialized and wired together
512518
```
513519

514-
## Deployment
520+
## Releasing
521+
522+
The project uses semantic versioning (`vMAJOR.MINOR.PATCH`) with GitHub Releases. Pushing a version tag triggers CI to build, test, and deploy to Cloud Run.
515523

516-
See [DEPLOYMENT.md](./docs/DEPLOYMENT.md) for complete deployment guide.
524+
### Release Workflow
517525

518-
### Google Cloud Run
526+
1. Merge your changes to `main`.
527+
2. Run the release script:
519528

520529
```bash
521-
cd github-copier
522-
./scripts/deploy-cloudrun.sh
530+
# Preview what will happen (no changes made)
531+
./scripts/release.sh v1.2.0 --dry-run
532+
533+
# Create the release
534+
./scripts/release.sh v1.2.0
523535
```
524536

525-
### Docker
537+
The script:
538+
1. Validates the version format and that the working tree is clean on `main`
539+
2. Renames the `[Unreleased]` section in `CHANGELOG.md` to `[v1.2.0] - YYYY-MM-DD`
540+
3. Commits the changelog update and creates an annotated git tag
541+
4. Pushes the tag to origin — this triggers the CI `deploy` job
542+
5. Creates a GitHub Release with the changelog excerpt
543+
544+
### CI Deploy Pipeline
545+
546+
The `deploy` job in `.github/workflows/ci.yml` runs only on version tag pushes:
547+
548+
- Authenticates to Google Cloud via Workload Identity Federation
549+
- Deploys to Cloud Run with the version stamped as a build arg (`VERSION`)
550+
- Tags the Cloud Run revision with the version for easy rollback
551+
552+
### Version Stamping
553+
554+
The version tag is injected at build time via `-ldflags`:
526555

527556
```bash
528-
docker build -t github-copier .
529-
docker run -p 8080:8080 --env-file env.yaml github-copier
557+
go build -ldflags "-X main.Version=v1.2.0" -o github-copier .
530558
```
531559

560+
The version appears in the startup banner and the `/health` endpoint response.
561+
562+
## Deployment
563+
564+
See [DEPLOYMENT.md](./docs/DEPLOYMENT.md) for the complete deployment and rollback guide.
565+
532566
## Security
533567

534568
- **Webhook Signature Verification** - HMAC-SHA256 validation
535569
- **Webhook Idempotency** - Duplicate delivery detection via `X-GitHub-Delivery`
536570
- **Secret Management** - Google Cloud Secret Manager
537571
- **Least Privilege** - Minimal GitHub App permissions (see `github-app-manifest.yml`)
538-
- **Audit Trail** - Complete operation logging
539572

540573
## Documentation
541574

@@ -549,19 +582,20 @@ docker run -p 8080:8080 --env-file env.yaml github-copier
549582

550583
### Reference
551584

585+
- **[Config Reference](docs/CONFIG-REFERENCE.md)** - Environment variables and YAML schema
552586
- **[Architecture](docs/ARCHITECTURE.md)** - System design and components
553587
- **[Troubleshooting](docs/TROUBLESHOOTING.md)** - Common issues and solutions
554588
- **[FAQ](docs/FAQ.md)** - Frequently asked questions
555-
- **[Deprecation Tracking](docs/DEPRECATION-TRACKING-EXPLAINED.md)** - How deprecation tracking works
589+
- **[Changelog](CHANGELOG.md)** - Release history
556590

557591
### Features
558592

559593
- **[Slack Notifications](docs/SLACK-NOTIFICATIONS.md)** - Slack integration guide
560-
- **[Webhook Testing](docs/WEBHOOK-TESTING.md)** - Test with real PR data
594+
- **[Webhook Testing](docs/WEBHOOK-TESTING.md)** - Webhook testing guide
561595
- **[GitHub App Manifest](github-app-manifest.yml)** - Required permissions and events
562596

563597
### Tools
564598

565599
- **[Config Validator](cmd/config-validator/README.md)** - CLI tool for validating configs
566600
- **[Test Webhook](cmd/test-webhook/README.md)** - CLI tool for testing webhooks
567-
- **[Scripts](scripts/README.md)** - Helper scripts for deployment and testing
601+
- **[Scripts](scripts/README.md)** - Helper scripts for deployment, testing, and releases

0 commit comments

Comments
 (0)