fix: version bumping and Docker registry authentication (#17)
## Summary This PR fixes the release workflow to properly handle version bumping on PR merge and uses the new Docker registry authentication secrets. ## Changes ### Release Workflow (release.yml) - **Version Bumping**: Now automatically bumps version on PR merge - Determines bump type from commit messages (major/minor/patch) - Commits version bump to `package.json` and `CHANGELOG.md` - Creates git tag for the release - **Docker Registry Auth**: Uses `DOCKER_LOGIN` and `DOCKER_PASSWORD` secrets - Falls back gracefully if secrets are not configured - **Tag Handling**: Checks if tag exists before creating (prevents failures) ### PR Workflow (pr.yml) - NEW - Runs unit tests on every PR - Analyzes commits to suggest bump type - Comments the suggested bump type on the PR ### Documentation - Added `WORKFLOW_ARCHITECTURE.md` explaining the workflow design ## Workflow Architecture **Two-step process:** 1. **PR Workflow** (on PR): Analyzes commits and suggests bump type 2. **Release Workflow** (on merge): Bumps version, creates tag, builds Docker image ## Benefits 1. **No CI Loops**: Version bump commits are detected and skipped 2. **Clear Communication**: PR comments inform developers of version impact 3. **Semantic Versioning**: Automated adherence to semver rules 4. **Traceability**: Git tags and changelog reflect all changes ## Testing The new workflows will be tested when this PR is merged. Closes #13 (Add database test safety configuration) Reviewed-on: #17 Co-authored-by: David Gwilliam <dhgwilliam@gmail.com> Co-committed-by: David Gwilliam <dhgwilliam@gmail.com>
This commit was merged in pull request #17.
This commit is contained in:
@@ -17,20 +17,29 @@ EuchreCamp is a full-stack web application built with Next.js 14+ and TypeScript
|
||||
|
||||
- **Framework**: Next.js 14+ (App Router)
|
||||
- **Language**: TypeScript
|
||||
- **Database**: Prisma ORM with SQLite
|
||||
- **Database**: Prisma ORM with SQLite (default) or PostgreSQL
|
||||
- **Styling**: Tailwind CSS
|
||||
- **Authentication**: Better Auth
|
||||
- **Form Handling**: React Hook Form + Zod validation
|
||||
- **CSV Parsing**: PapaParse
|
||||
- **Unit Testing**: Vitest
|
||||
- **Acceptance Testing**: Playwright
|
||||
- **CI/CD**: Gitea Actions with SQLite for CI tests
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
euchre_camp/
|
||||
├── src/
|
||||
│ ├── app/
|
||||
├── .gitea/workflows/ # CI/CD workflows (Gitea Actions)
|
||||
├── docs/ # Documentation
|
||||
│ ├── deployment/ # Deployment guides
|
||||
│ └── planning/ # Planning documents
|
||||
├── prisma/ # Prisma schema and migrations
|
||||
├── public/ # Static assets
|
||||
├── scripts/ # Utility scripts
|
||||
│ └── python/ # Python scripts (legacy)
|
||||
├── src/ # Source code
|
||||
│ ├── app/ # Next.js app directory
|
||||
│ │ ├── api/ # API routes
|
||||
│ │ ├── auth/ # Authentication pages
|
||||
│ │ ├── admin/ # Admin pages
|
||||
@@ -39,16 +48,15 @@ euchre_camp/
|
||||
│ │ └── components/ # Shared components
|
||||
│ ├── lib/ # Utilities and configuration
|
||||
│ │ ├── auth.ts # Better Auth configuration
|
||||
│ │ ├── prisma.ts # Prisma client
|
||||
│ │ ├── prisma.ts # Prisma client (SQLite/PostgreSQL)
|
||||
│ │ ├── permissions.ts # Authorization functions
|
||||
│ │ └── elo-utils.ts # Elo calculation utilities
|
||||
│ └── __tests__/ # Vitest and Playwright tests
|
||||
├── prisma/ # Prisma schema and migrations
|
||||
├── docs/ # Documentation
|
||||
├── scripts/ # Utility scripts
|
||||
└── public/ # Static assets
|
||||
└── ... # Configuration files in root
|
||||
```
|
||||
|
||||
See [docs/FILE_ORGANIZATION.md](docs/FILE_ORGANIZATION.md) for detailed file organization.
|
||||
|
||||
## Features Implemented
|
||||
|
||||
### Epic 1: Authentication & User Management
|
||||
@@ -242,6 +250,36 @@ Visit `/` to see:
|
||||
|
||||
## Development
|
||||
|
||||
### Using just (recommended)
|
||||
The project includes a `justfile` with common development tasks:
|
||||
|
||||
```bash
|
||||
# Show all available tasks
|
||||
just help
|
||||
|
||||
# Development mode
|
||||
just dev
|
||||
|
||||
# Run all tests (unit + acceptance with SQLite)
|
||||
just test
|
||||
|
||||
# Run PR validation (what runs on pull requests)
|
||||
just pr-validate
|
||||
|
||||
# Run CI pipeline locally
|
||||
just ci
|
||||
|
||||
# Switch database provider
|
||||
just db-switch-sqlite
|
||||
just db-switch-postgres
|
||||
|
||||
# Docker shortcuts
|
||||
just docker-up
|
||||
just docker-down
|
||||
just docker-logs
|
||||
```
|
||||
|
||||
### Using npm scripts directly
|
||||
```bash
|
||||
# Development mode
|
||||
npm run dev
|
||||
@@ -255,6 +293,9 @@ npm run test
|
||||
|
||||
# Run acceptance tests
|
||||
npm run test:acceptance
|
||||
|
||||
# Run acceptance tests with SQLite (CI-style)
|
||||
DATABASE_PROVIDER=sqlite DATABASE_URL=file:./prisma/ci.db npm run test:acceptance
|
||||
```
|
||||
|
||||
### Database Commands
|
||||
@@ -313,6 +354,39 @@ User stories are organized into epics in `docs/USER_STORIES.md`:
|
||||
7. Mobile Responsiveness
|
||||
8. Data Management & Export
|
||||
|
||||
## CI/CD Pipeline
|
||||
|
||||
The application uses Gitea Actions for continuous integration and deployment:
|
||||
|
||||
### Workflow Architecture
|
||||
1. **PR Workflow** (`.gitea/workflows/pr.yml`): Runs on pull requests
|
||||
- Unit tests (fast feedback)
|
||||
- Acceptance tests with SQLite database
|
||||
- Semantic version bump analysis
|
||||
|
||||
2. **Test Workflow** (`.gitea/workflows/test.yml`): Runs on all branch pushes
|
||||
- Unit tests for quick feedback
|
||||
- Skips auto-generated version bumps
|
||||
|
||||
3. **Release Workflow** (`.gitea/workflows/release.yml`): Runs on main branch pushes
|
||||
- Version bumping and tagging
|
||||
- Docker image building and testing
|
||||
- Registry push and deployment
|
||||
|
||||
### Database Strategy for CI
|
||||
- **CI Tests**: SQLite database (fast, no server required)
|
||||
- **Production**: PostgreSQL (production-like environment)
|
||||
- **Configuration**: `DATABASE_PROVIDER` environment variable
|
||||
|
||||
### Running CI Locally
|
||||
```bash
|
||||
# Run unit tests (same as CI)
|
||||
npm run test:run
|
||||
|
||||
# Run acceptance tests with SQLite
|
||||
DATABASE_PROVIDER=sqlite DATABASE_URL=file:./prisma/ci.db npm run test:acceptance
|
||||
```
|
||||
|
||||
## Docker Deployment
|
||||
|
||||
This application can be run using Docker and Docker Compose. See [DOCKER.md](DOCKER.md) for detailed instructions.
|
||||
|
||||
Reference in New Issue
Block a user