501e1b7e23
## 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>
4.6 KiB
4.6 KiB
File Organization
This document describes the organization of files in the EuchreCamp project.
Root Directory
Essential Files (Keep in Root)
README.md- Main project documentationAGENTS.md- AI agent guideCHANGELOG.md- Version changelogpackage.json- Node.js dependencies and scriptspackage-lock.json- Dependency lock filetsconfig.json- TypeScript configurationnext.config.js- Next.js configuration.gitignore- Git ignore fileDockerfile- Docker build configurationjustfile- Development task automation
Configuration Files (Keep in Root)
.eslintrc.json- ESLint configurationpostcss.config.mjs- PostCSS configurationplaywright.config.ts- Playwright test configurationvitest.config.mts- Vitest configurationvitest.setup.ts- Vitest setup.dockerignore- Docker ignore filemise.toml- Mise version manager config
Docker Files (Keep in Root)
docker-compose.yml- Main Docker Composedocker-compose.dev.yml- Development Docker Composedocker-compose.override.yml- Override for devdocker-compose.casaos.yml- CasaOS specific
Environment Files (Keep in Root, Gitignored)
.env- Environment variables.env.development- Development environment
Organized Directories
.gitea/ - Gitea Actions Workflows
workflows/pr.yml- Pull request workflow (unit + acceptance tests)workflows/test.yml- Test workflow (unit tests on branch pushes)workflows/release.yml- Release workflow (version bump + Docker build)WORKFLOW_ARCHITECTURE.md- Workflow architecture documentation
docs/ - Documentation
deployment/- Deployment documentationCASAOS_DEPLOYMENT.md- CasaOS deployment guideDOCKER.md- Docker deployment instructions
TODO.md- Project TODO list (in docs root for visibility)USER_STORIES.md- User stories organized by epic- Other documentation files (design, implementation, testing, etc.)
scripts/ - Utility Scripts
python/- Python scripts (legacy/old functionality)generate_games.py- Generate sample gamesupdate_partnership_stats.py- Update partnership statsupdate_player_stats.py- Update player stats
bump-version.js- Version bumping scriptbuild-and-push-docker.js- Docker build and push scriptswitch-database.js- Database provider switchingcreate-admin-via-api.js- Admin user creation via APIcreate-admin-better-auth.js- Admin user creation via databaselist-users.js- List all usersupdate-admin-password.js- Update admin passwordseed.js- Database seeding- And other Node.js scripts...
src/ - Source Code
app/- Next.js app directoryapi/- API routesauth/- Authentication pagesadmin/- Admin pagesplayers/- Player pagesrankings/- Rankings pagecomponents/- Shared components
lib/- Utilities and configurationauth.ts- Better Auth configurationprisma.ts- Prisma client (supports SQLite and PostgreSQL)permissions.ts- Authorization functionselo-utils.ts- Elo calculation utilities
__tests__/- Vitest and Playwright testsunit/- Unit testse2e/- End-to-end acceptance tests
prisma/ - Database
schema.prisma- Prisma schemamigrations/- Database migrationsdev.db- SQLite development database (if using SQLite)
public/ - Static Assets
- Images, fonts, and other static files
playwright/ - Playwright Test Data
- Authentication state files
Generated Directories (Gitignored)
.next/- Next.js build outputnode_modules/- Node.js dependenciesplaywright-report/- Playwright test reportstest-results/- Test results
File Organization Principles
- Keep standard files in root: package.json, tsconfig.json, etc.
- Organize by function: Group related files in directories
- Separate generated from source: Keep build outputs and dependencies separate
- Document organization: Use this file to explain structure
- Follow conventions: Use standard naming and organization patterns
CI/CD File Organization
Workflows
.gitea/workflows/pr.yml- Pull request validation.gitea/workflows/test.yml- Branch testing.gitea/workflows/release.yml- Main branch release
Database Strategy
- CI/Testing: SQLite (fast, no server)
- Production: PostgreSQL (production-like)
Testing
- Unit tests:
npm run test:run - Acceptance tests (SQLite):
DATABASE_PROVIDER=sqlite npm run test:acceptance - Acceptance tests (PostgreSQL):
npm run test:acceptance(with Docker)