- ci.yml: Complete CI pipeline with lint, type-check, tests, build, security, and i18n validation - code-quality.yml: Advanced code analysis including complexity, TODO tracking, and import analysis - dependency-review.yml: Automated dependency update review with security checks - pr-labeler.yml: Intelligent PR labeling based on files and content - release.yml: Automated release process with changelog generation - Documentation and best practices guide Features: - Multi-node testing (Node 18, 20) - Security scanning for hardcoded secrets - Bundle size impact analysis - Translation key validation - Complexity analysis and code quality metrics 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
99 lines
No EOL
3.4 KiB
YAML
99 lines
No EOL
3.4 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
name: Create Release
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Run tests
|
|
run: npm test
|
|
|
|
- name: Build project
|
|
run: npm run build
|
|
|
|
- name: Generate changelog
|
|
run: |
|
|
echo "# Changelog" > CHANGELOG_CURRENT.md
|
|
echo "" >> CHANGELOG_CURRENT.md
|
|
|
|
# Get the previous tag
|
|
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
|
|
CURRENT_TAG="${{ github.ref_name }}"
|
|
|
|
if [ -n "$PREV_TAG" ]; then
|
|
echo "## Changes since $PREV_TAG" >> CHANGELOG_CURRENT.md
|
|
echo "" >> CHANGELOG_CURRENT.md
|
|
|
|
# Group commits by type
|
|
echo "### Features" >> CHANGELOG_CURRENT.md
|
|
git log $PREV_TAG..HEAD --grep="feat:" --pretty=format:"- %s" >> CHANGELOG_CURRENT.md || true
|
|
echo "" >> CHANGELOG_CURRENT.md
|
|
|
|
echo "### Bug Fixes" >> CHANGELOG_CURRENT.md
|
|
git log $PREV_TAG..HEAD --grep="fix:" --pretty=format:"- %s" >> CHANGELOG_CURRENT.md || true
|
|
echo "" >> CHANGELOG_CURRENT.md
|
|
|
|
echo "### Other Changes" >> CHANGELOG_CURRENT.md
|
|
git log $PREV_TAG..HEAD --grep -v "feat:\|fix:" --pretty=format:"- %s" >> CHANGELOG_CURRENT.md || true
|
|
else
|
|
echo "## Initial Release" >> CHANGELOG_CURRENT.md
|
|
git log --pretty=format:"- %s" >> CHANGELOG_CURRENT.md
|
|
fi
|
|
|
|
- name: Create release archive
|
|
run: |
|
|
# Create a release archive excluding unnecessary files
|
|
tar -czf "ice-report-${{ github.ref_name }}.tar.gz" \
|
|
--exclude=node_modules \
|
|
--exclude=.git \
|
|
--exclude=.env \
|
|
--exclude=*.db \
|
|
--exclude=coverage \
|
|
--exclude=.forgejo \
|
|
.
|
|
|
|
- name: Create release notes
|
|
run: |
|
|
echo "# Release ${{ github.ref_name }}" > RELEASE_NOTES.md
|
|
echo "" >> RELEASE_NOTES.md
|
|
echo "## Installation" >> RELEASE_NOTES.md
|
|
echo "" >> RELEASE_NOTES.md
|
|
echo '```bash' >> RELEASE_NOTES.md
|
|
echo "wget https://git.deco.sh/deco/ice/releases/download/${{ github.ref_name }}/ice-report-${{ github.ref_name }}.tar.gz" >> RELEASE_NOTES.md
|
|
echo "tar -xzf ice-report-${{ github.ref_name }}.tar.gz" >> RELEASE_NOTES.md
|
|
echo "cd ice-report" >> RELEASE_NOTES.md
|
|
echo "npm install" >> RELEASE_NOTES.md
|
|
echo "npm run build" >> RELEASE_NOTES.md
|
|
echo '```' >> RELEASE_NOTES.md
|
|
echo "" >> RELEASE_NOTES.md
|
|
cat CHANGELOG_CURRENT.md >> RELEASE_NOTES.md
|
|
|
|
# Note: In actual Forgejo/Gitea, you would use their release API
|
|
# This is a placeholder showing what would be done
|
|
- name: Display release information
|
|
run: |
|
|
echo "Release ${{ github.ref_name }} is ready!"
|
|
echo "Archive: ice-report-${{ github.ref_name }}.tar.gz"
|
|
echo ""
|
|
echo "Release notes:"
|
|
cat RELEASE_NOTES.md |