Skip to content

Your favorite shift management application!

chore: Improves build configuration and release automation (#13)

panteL1268685783c0
diff --git a/.dockerignore b/.dockerignore
index 73da620..990930b 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -24,7 +24,7 @@ yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
-# env files
+# env files (excluded for security - use build args or runtime env)
.env*
!.env.example
@@ -35,19 +35,27 @@ yarn-error.log*
*.tsbuildinfo
next-env.d.ts
-# database
+# database (local data should not be in image)
sqlite.db
sqlite.db-journal
+sqlite.db-shm
+sqlite.db-wal
data/
# git
.git
.gitignore
+.github
# IDE
.vscode
.idea
+# docker
+docker-compose.override.yml
+
# misc
README.md
*.md
+test-changelog.sh
+LICENSE
\ No newline at end of file
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index cb8ad21..0b75a5f 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -15,11 +15,77 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
+ - name: Generate changelog
+ id: changelog
+ run: |
+ # Get previous tag
+ PREVIOUS_TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sed -n '2p')
+
+ if [ -z "$PREVIOUS_TAG" ]; then
+ echo "No previous tag found, showing all commits"
+ PREVIOUS_TAG=$(git rev-list --max-parents=0 HEAD)
+ fi
+
+ echo "Generating changelog from $PREVIOUS_TAG to $GITHUB_REF_NAME"
+
+ # Get all commits between tags (range already excludes the tag commit)
+ ALL_COMMITS=$(git log $PREVIOUS_TAG..$GITHUB_REF_NAME --pretty=format:"%s|%h" --no-merges)
+
+ # Build changelog with grouping
+ CHANGELOG=""
+
+ # Features
+ FEATURES=$(echo "$ALL_COMMITS" | grep "^feat:" | sed 's/|/ /' | sed 's/^/- /' || true)
+ if [ -n "$FEATURES" ]; then
+ CHANGELOG+="### ✨ Features"$'\n\n'
+ CHANGELOG+="$FEATURES"$'\n\n'
+ fi
+
+ # Bug Fixes
+ FIXES=$(echo "$ALL_COMMITS" | grep "^fix:" | sed 's/|/ /' | sed 's/^/- /' || true)
+ if [ -n "$FIXES" ]; then
+ CHANGELOG+="### πŸ› Bug Fixes"$'\n\n'
+ CHANGELOG+="$FIXES"$'\n\n'
+ fi
+
+ # Documentation
+ DOCS=$(echo "$ALL_COMMITS" | grep "^docs:" | sed 's/|/ /' | sed 's/^/- /' || true)
+ if [ -n "$DOCS" ]; then
+ CHANGELOG+="### πŸ“ Documentation"$'\n\n'
+ CHANGELOG+="$DOCS"$'\n\n'
+ fi
+
+ # Chores
+ CHORES=$(echo "$ALL_COMMITS" | grep "^chore:" | sed 's/|/ /' | sed 's/^/- /' || true)
+ if [ -n "$CHORES" ]; then
+ CHANGELOG+="### πŸ”§ Chores"$'\n\n'
+ CHANGELOG+="$CHORES"$'\n\n'
+ fi
+
+ # Other changes (not matching conventional commits)
+ OTHERS=$(echo "$ALL_COMMITS" | grep -vE "^(feat|fix|docs|chore):" | sed 's/|/ /' | sed 's/^/- /' || true)
+ if [ -n "$OTHERS" ]; then
+ CHANGELOG+="### πŸ”€ Other Changes"$'\n\n'
+ CHANGELOG+="$OTHERS"$'\n\n'
+ fi
+
+ # Use heredoc for multiline output
+ {
+ echo 'changelog<<EOF'
+ echo "$CHANGELOG"
+ echo EOF
+ } >> $GITHUB_OUTPUT
+
+ # Set previous tag
+ echo "previous_tag=$PREVIOUS_TAG" >> $GITHUB_OUTPUT
+
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
@@ -54,22 +120,24 @@ jobs:
- name: Create Release
uses: softprops/action-gh-release@v2
with:
- name: Release v${{ steps.version.outputs.VERSION }}
+ name: v${{ steps.version.outputs.VERSION }}
body: |
- ## What's Changed
+ ## πŸ“¦ What's Changed
+
+ ${{ steps.changelog.outputs.changelog }}
- See the [commit history](https://github.com/${{ github.repository }}/commits/v${{ steps.version.outputs.VERSION }}) for details.
+ **Full Changelog**: https://github.com/${{ github.repository }}/compare/${{ steps.changelog.outputs.previous_tag }}...v${{ steps.version.outputs.VERSION }}
- ## Docker Image
+ ## 🐳 Docker Image
```bash
docker pull ghcr.io/${{ github.repository }}:v${{ steps.version.outputs.VERSION }}
docker pull ghcr.io/${{ github.repository }}:latest
```
- Available tags:
- - `ghcr.io/${{ github.repository }}:v${{ steps.version.outputs.VERSION }}` (specific version)
- - `ghcr.io/${{ github.repository }}:latest` (always latest release)
+ ### Available tags:
+ - `v${{ steps.version.outputs.VERSION }}` - Specific version
+ - `latest` - Latest stable release
draft: false
prerelease: false
env:
diff --git a/.gitignore b/.gitignore
index d8cde63..328b211 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,6 +29,7 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
+lerna-debug.log*
# env files (can opt-in for committing if needed)
.env*
@@ -41,13 +42,29 @@ yarn-error.log*
*.tsbuildinfo
next-env.d.ts
-# database
+# database (local SQLite database and data directory)
sqlite.db
sqlite.db-journal
+sqlite.db-shm
+sqlite.db-wal
data/
-# docker
+# docker (local override configuration)
docker-compose.override.yml
+# IDE (editor configurations)
+.vscode/
+.idea/
+*.swp
+*.swo
+*~
+
+# OS
+.DS_Store
+Thumbs.db
+
# version info (generated at build time)
-public/version.json
\ No newline at end of file
+public/version.json
+
+# scripts (local testing scripts)
+test-changelog.sh
\ No newline at end of file