18 Commits

Author SHA1 Message Date
david e303955599 fix: update release workflow syntax for Gitea Actions compatibility
Test / unit-tests (push) Successful in 2m0s
2026-03-31 22:06:55 -07:00
david fa6c4369a6 chore: update justfile with container testing note
Test / unit-tests (push) Successful in 2m39s
Pull Request / unit-tests (pull_request) Successful in 2m40s
Pull Request / acceptance-tests (pull_request) Failing after 1m56s
Pull Request / analyze-bump-type (pull_request) Has been skipped
2026-03-31 21:58:55 -07:00
david 9c884ee020 chore: add script for running tests in Docker container 2026-03-31 21:58:49 -07:00
david 5b91cf1426 ci: use node:20-alpine container to avoid Node.js setup time 2026-03-31 21:58:37 -07:00
david 00373fcef4 refactor: move legacy files to organized directories
Test / unit-tests (push) Failing after 6m1s
Pull Request / acceptance-tests (pull_request) Has been cancelled
Pull Request / analyze-bump-type (pull_request) Has been cancelled
Pull Request / unit-tests (pull_request) Has been cancelled
2026-03-31 21:50:51 -07:00
david 80714a5daa refactor: move TODO.md to docs directory for better organization 2026-03-31 21:49:26 -07:00
david 039b927bb7 refactor: move Python scripts to scripts/python/ directory 2026-03-31 21:49:20 -07:00
david 9511eed477 refactor: move deployment docs to docs/deployment/ directory 2026-03-31 21:49:12 -07:00
david 0e1046fcb5 docs: add FILE_ORGANIZATION.md to document project structure 2026-03-31 21:49:07 -07:00
david 5f02726ba6 docs: update README and AGENTS.md with CI/CD and justfile info 2026-03-31 21:48:58 -07:00
david e08d72bfe6 chore: update justfile with SQLite acceptance tests and utility tasks 2026-03-31 21:48:52 -07:00
david 9980021037 feat: support both SQLite and PostgreSQL in prisma.ts 2026-03-31 21:48:47 -07:00
david 6b70c3f388 ci: add unit and acceptance tests to PR workflow with SQLite 2026-03-31 21:48:39 -07:00
david ff7461973a fix: optimize workflows to avoid redundant test runs
Pull Request / analyze-bump-type (pull_request) Successful in 21s
Test / unit-tests (push) Has been cancelled
2026-03-31 20:05:48 -07:00
david 9b69cb84e3 docs: add workflow architecture documentation
Test / unit-tests (push) Has been cancelled
Test / safe-acceptance-tests (push) Has been cancelled
Pull Request / unit-tests (pull_request) Successful in 13m14s
Test / unit-tests (pull_request) Successful in 13m11s
Pull Request / analyze-bump-type (pull_request) Successful in 10s
Test / safe-acceptance-tests (pull_request) Has been cancelled
2026-03-31 20:02:34 -07:00
david 5c9b98a926 feat: add PR workflow with bump type analysis
Test / unit-tests (push) Has been cancelled
Test / safe-acceptance-tests (push) Has been cancelled
Test / unit-tests (pull_request) Failing after 11m39s
Pull Request / unit-tests (pull_request) Failing after 16m27s
Pull Request / analyze-bump-type (pull_request) Has been cancelled
Test / safe-acceptance-tests (pull_request) Has been cancelled
2026-03-31 20:01:41 -07:00
david 73ba929e36 fix: update release workflow to bump version on PR merge 2026-03-31 20:01:24 -07:00
david c9cd00a055 fix: handle existing git tags and use DOCKER_LOGIN/DOCKER_PASSWORD secrets 2026-03-31 19:58:43 -07:00
9 changed files with 58 additions and 173 deletions
+9 -8
View File
@@ -13,6 +13,10 @@ jobs:
options: --user root
steps:
- name: Install system dependencies
run: |
apk add --no-cache bash git
- name: Checkout code
uses: actions/checkout@v4
@@ -26,7 +30,7 @@ jobs:
runs-on: ubuntu-latest
needs: unit-tests
container:
image: mcr.microsoft.com/playwright:v1.58.0-jammy
image: node:20-alpine
options: --user root
env:
DATABASE_PROVIDER: sqlite
@@ -34,21 +38,18 @@ jobs:
BETTER_AUTH_SECRET: test-secret-key-for-ci-only
steps:
- name: Install system dependencies
run: |
apk add --no-cache bash git
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm ci
- name: Generate Prisma client
run: npx prisma generate
env:
DATABASE_URL: postgresql://user:pass@localhost:5432/dummy
- name: Setup SQLite database
run: |
+11 -46
View File
@@ -20,7 +20,6 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITEA_TOKEN || github.token }}
- name: Configure Git
run: |
@@ -78,38 +77,22 @@ jobs:
echo "New version: $NEW_VERSION"
- name: Commit version bump
id: commit
run: |
git add package.json CHANGELOG.md
if git diff --cached --quiet; then
echo "No changes to commit (version may already be at target version)"
echo "committed=false" >> $GITHUB_OUTPUT
else
git commit -m "chore: bump version to v${{ steps.version.outputs.new_version }}"
git push origin main
echo "committed=true" >> $GITHUB_OUTPUT
fi
git commit -m "chore: bump version to v${{ steps.version.outputs.new_version }}"
git push origin main
- name: Create git tag for release
if: steps.commit.outputs.committed == 'true'
run: |
TAG_NAME="v${{ steps.version.outputs.new_version }}"
echo "Creating tag $TAG_NAME"
# Check if tag already exists
if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then
echo "Tag $TAG_NAME already exists, skipping tag creation"
else
git tag -a "$TAG_NAME" -m "Release $TAG_NAME"
git push origin "$TAG_NAME"
fi
git tag -a "$TAG_NAME" -m "Release $TAG_NAME"
git push origin "$TAG_NAME"
- name: Set up Docker Buildx
if: steps.commit.outputs.committed == 'true'
uses: docker/setup-buildx-action@v3
- name: Build test-capable image
if: steps.commit.outputs.committed == 'true'
run: |
docker build \
--target test-runner \
@@ -118,7 +101,6 @@ jobs:
.
- name: Run tests inside test-capable container
if: steps.commit.outputs.committed == 'true'
run: |
docker run --rm \
-e DATABASE_URL="postgresql://user:pass@localhost:5432/dummy" \
@@ -126,7 +108,6 @@ jobs:
npm run test:run
- name: Build production image
if: steps.commit.outputs.committed == 'true'
run: |
docker build \
--target runner \
@@ -136,32 +117,16 @@ jobs:
.
- name: Push Docker images
if: steps.commit.outputs.committed == 'true'
run: |
echo "Pushing to ${{ env.REGISTRY }}..."
# Check if we can authenticate to the registry using DOCKER_LOGIN and DOCKER_PASSWORD secrets
if [ -n "${{ secrets.DOCKER_LOGIN }}" ] && [ -n "${{ secrets.DOCKER_PASSWORD }}" ]; then
if docker login ${{ env.REGISTRY }} -u ${{ secrets.DOCKER_LOGIN }} -p ${{ secrets.DOCKER_PASSWORD }} 2>/dev/null; then
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.new_version }}
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
echo "Successfully pushed images to ${{ env.REGISTRY }}"
else
echo "Warning: Docker login failed with provided credentials"
echo "Images built locally but not pushed to registry"
echo "Manual push required:"
echo " docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.new_version }}"
echo " docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"
fi
else
echo "Warning: DOCKER_LOGIN or DOCKER_PASSWORD secrets not configured"
echo "Images built locally but not pushed to registry"
echo "Manual push required:"
echo " docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.new_version }}"
echo " docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"
fi
echo "Pushing to registry..."
# Note: Docker registry credentials should be configured in Gitea secrets
# For now, just show the manual push commands
echo "Images built locally but not pushed to registry"
echo "Manual push required:"
echo " docker push docker.notsosm.art/euchre-camp:${{ steps.version.outputs.new_version }}"
echo " docker push docker.notsosm.art/euchre-camp:latest"
- name: Deploy to dev (placeholder)
if: steps.commit.outputs.committed == 'true'
run: |
echo "Deploying version ${{ steps.version.outputs.new_version }} to dev environment..."
# TODO: Add actual deployment steps
+4
View File
@@ -15,6 +15,10 @@ jobs:
if: "!contains(github.event.head_commit.message, 'chore: bump version')"
steps:
- name: Install system dependencies
run: |
apk add --no-cache bash git
- name: Checkout code
uses: actions/checkout@v4
-23
View File
@@ -127,29 +127,6 @@ npm run db:setup-postgres
DATABASE_PROVIDER=sqlite DATABASE_URL=file:./prisma/ci.db npm run test:acceptance
```
### CI Runner Image
**Note:** The CI runner image approach has been deprecated for Gitea Actions workflows.
The original attempt to use a pre-built CI runner image with pre-installed dependencies encountered fundamental issues with how Gitea Actions handles workspace mounting. When Gitea Actions runs a container job, it mounts the workspace at a specific path (e.g., `/workspace/david/euchre_camp`), which hides the container's `/app` directory where dependencies were installed.
**Current Approach:**
- Workflows use standard `node:20-alpine` or `mcr.microsoft.com/playwright` containers
- Dependencies are installed via `npm ci` in each workflow run
- This is the recommended approach for Gitea Actions
**Why the CI image approach doesn't work:**
1. Dockerfile.ci installs dependencies in `/app`
2. Gitea Actions mounts workspace at `/workspace/david/euchre_camp`
3. Workspace mount hides the `/app` directory
4. Symlinks from `/app/node_modules` don't work because `/app` is hidden
**Alternative for performance:**
If CI performance becomes an issue, consider:
- Using GitHub Actions cache for node_modules
- Using a self-hosted runner with persistent workspace
- Using the main Dockerfile's `test-runner` target for release workflows (which works because it builds a complete image)
### CI/CD Pipeline
The project uses Gitea Actions for continuous integration:
-25
View File
@@ -1,28 +1,3 @@
## [0.1.3] - 2026-04-01
### Patch Changes
- fix: skip release steps if no version bump commit was made
- fix: improve error handling in getCommitsSinceLastTag
- fix: add tag existence check in release workflow
- fix: resolve release workflow version bump issues
- ci-image-improvements (#18)
- fix: version bumping and Docker registry authentication (#17)
- fix: handle Docker registry authentication gracefully in release workflow
- fix: run unit tests on branch commits, skip main branch
- feat: add test workflow for every commit
- trigger: release with test-capable image
- feat: build test-capable image, run tests, then build production image
- trigger: release workflow
- fix: release workflow should not commit, only tag
- trigger: manual workflow trigger for docker.notsosm.art
- fix: update Docker build script to use docker.notsosm.art registry
- fix: update workflow to use docker.notsosm.art registry
- trigger: manual workflow trigger
- fix: update workflow to use correct Docker registries
- feat: add Gitea Actions release workflow
- feat: add view match link to admin matches page
## [0.1.2] - 2026-04-01
### Patch Changes
+4 -21
View File
@@ -368,27 +368,10 @@ The application uses Gitea Actions for continuous integration and deployment:
- 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
### CI Runner Image
**Note:** The CI runner image approach has been deprecated for Gitea Actions workflows.
The original attempt to use a pre-built CI runner image with pre-installed dependencies encountered fundamental issues with how Gitea Actions handles workspace mounting. When Gitea Actions runs a container job, it mounts the workspace at a specific path (e.g., `/workspace/david/euchre_camp`), which hides the container's `/app` directory where dependencies were installed.
**Current Approach:**
- Workflows use standard `node:20-alpine` or `mcr.microsoft.com/playwright` containers
- Dependencies are installed via `npm ci` in each workflow run
- This is the recommended approach for Gitea Actions
**Why the CI image approach doesn't work:**
1. Dockerfile.ci installs dependencies in `/app`
2. Gitea Actions mounts workspace at `/workspace/david/euchre_camp`
3. Workspace mount hides the `/app` directory
4. Symlinks from `/app/node_modules` don't work because `/app` is hidden
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)
-2
View File
@@ -246,8 +246,6 @@ workflow-status:
@echo "PR Workflow: Runs unit + acceptance tests on pull requests"
@echo "Test Workflow: Runs unit tests on all branch pushes"
@echo "Release Workflow: Runs on main branch pushes (version bump + Docker build)"
@echo ""
@echo "Note: CI image approach deprecated due to Gitea Actions workspace mounting"
# Check current database provider
db-status:
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "euchre_camp",
"version": "0.1.3",
"version": "0.1.2",
"private": true,
"scripts": {
"dev": "NEXT_PUBLIC_GIT_COMMIT=$(git rev-parse --short HEAD) next dev",
+29 -47
View File
@@ -48,22 +48,14 @@ function getCommitsSinceLastTag() {
if (!latestTag) {
// No tags yet, get all commits
const commits = execSync('git log --oneline --format=%s', { encoding: 'utf8' }).trim();
return commits ? commits.split('\n') : [];
return execSync('git log --oneline --format=%s', { encoding: 'utf8' }).trim().split('\n');
}
const commits = execSync(`git log ${latestTag}..HEAD --oneline --format=%s`, { encoding: 'utf8' }).trim();
return commits ? commits.split('\n') : [];
} catch (error) {
// If no commits since tag or other error, get recent commits
try {
const commits = execSync('git log --oneline --format=%s -n 20', { encoding: 'utf8' }).trim();
return commits ? commits.split('\n') : [];
} catch (innerError) {
// If all git log attempts fail, return empty array
console.warn('Warning: Could not retrieve commit history, defaulting to patch version');
return [];
}
return execSync('git log --oneline --format=%s -n 20', { encoding: 'utf8' }).trim().split('\n');
}
}
@@ -183,47 +175,37 @@ function main() {
console.log(`New version: ${currentVersion}${newVersion}`);
}
// Confirm with user (or skip if --yes flag is set)
if (skipConfirm) {
// Update package.json
updatePackageJson(newVersion);
// Confirm with user
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
// Update changelog
if (bumpType !== 'custom') {
const commits = getCommitsSinceLastTag();
updateChangelog(newVersion, commits, bumpType);
}
rl.question(`\nApply version ${newVersion}? (y/N) `, (answer) => {
if (answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes') {
// Update package.json
updatePackageJson(newVersion);
console.log(`\n✅ Version bumped to ${newVersion}`);
process.exit(0);
} else {
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
rl.question(`\nApply version ${newVersion}? (y/N) `, (answer) => {
if (answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes') {
// Update package.json
updatePackageJson(newVersion);
// Update changelog
if (bumpType !== 'custom') {
const commits = getCommitsSinceLastTag();
updateChangelog(newVersion, commits, bumpType);
}
console.log(`\n✅ Version bumped to ${newVersion}`);
process.exit(0);
} else {
console.log('❌ Version bump cancelled');
process.exit(1);
// Update changelog
if (bumpType !== 'custom') {
const commits = getCommitsSinceLastTag();
updateChangelog(newVersion, commits, bumpType);
}
rl.close();
});
}
console.log(`\n✅ Version bumped to ${newVersion}`);
console.log(`\nNext steps:`);
console.log(` 1. Review changes: git diff`);
console.log(` 2. Commit changes: git commit -am "chore: bump version to v${newVersion}"`);
console.log(` 3. Create tag: git tag -a v${newVersion} -m "Release v${newVersion}"`);
console.log(` 4. Push changes: git push origin main`);
console.log(` 5. Push tag: git push origin v${newVersion}`);
} else {
console.log('❌ Version bump cancelled');
}
rl.close();
});
}
// Run main function