diff --git a/.forgejo/workflows/auto-tag.yml b/.forgejo/workflows/auto-tag.yml new file mode 100644 index 0000000..c8173f9 --- /dev/null +++ b/.forgejo/workflows/auto-tag.yml @@ -0,0 +1,121 @@ +name: Auto Tag Release + +on: + push: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + auto-tag: + runs-on: self-hosted + name: Create Auto Tag + + steps: + - name: Checkout code + uses: https://code.forgejo.org/actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + run: | + node --version + npm --version + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm test + + - name: Build project + run: npm run build + + - name: Generate version tag + id: version + run: | + # Get the current date in YYYY.MM.DD format + DATE_VERSION=$(date +%Y.%m.%d) + + # Check if a tag with today's date already exists + if git tag -l | grep -q "^v${DATE_VERSION}$"; then + # If it exists, add a patch number + PATCH_NUM=$(git tag -l "v${DATE_VERSION}.*" | wc -l) + PATCH_NUM=$((PATCH_NUM + 1)) + VERSION="v${DATE_VERSION}.${PATCH_NUM}" + else + VERSION="v${DATE_VERSION}" + fi + + echo "Generated version: $VERSION" + echo "version=$VERSION" >> $GITHUB_OUTPUT + + - name: Create and push tag + run: | + VERSION="${{ steps.version.outputs.version }}" + + # Configure git + git config --local user.email "action@forgejo.org" + git config --local user.name "Forgejo Action" + + # Create annotated tag with commit info + COMMIT_MSG=$(git log -1 --pretty=%B) + git tag -a "$VERSION" -m "Release $VERSION + + Latest changes: + $COMMIT_MSG + + Auto-generated on $(date)" + + # Push the tag + git push origin "$VERSION" + + echo "✅ Created and pushed tag: $VERSION" + + - name: Create release notes + run: | + VERSION="${{ steps.version.outputs.version }}" + + # Get the previous tag to generate changelog + PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "") + + echo "# Release $VERSION" > RELEASE_NOTES.md + echo "" >> RELEASE_NOTES.md + echo "**Release Date:** $(date '+%Y-%m-%d %H:%M:%S UTC')" >> RELEASE_NOTES.md + echo "**Commit:** ${{ github.sha }}" >> RELEASE_NOTES.md + echo "" >> RELEASE_NOTES.md + + if [ -n "$PREV_TAG" ]; then + echo "## Changes since $PREV_TAG" >> RELEASE_NOTES.md + echo "" >> RELEASE_NOTES.md + + # Get commits since last tag + git log $PREV_TAG..HEAD --pretty=format:"- %s" >> RELEASE_NOTES.md + else + echo "## Latest Changes" >> RELEASE_NOTES.md + echo "" >> RELEASE_NOTES.md + git log -5 --pretty=format:"- %s" >> RELEASE_NOTES.md + fi + + echo "" >> RELEASE_NOTES.md + echo "" >> RELEASE_NOTES.md + echo "## Installation" >> RELEASE_NOTES.md + echo "" >> RELEASE_NOTES.md + echo '```bash' >> RELEASE_NOTES.md + echo "# Clone the repository" >> RELEASE_NOTES.md + echo "git clone https://git.deco.sh/deco/ice.git" >> RELEASE_NOTES.md + echo "cd ice" >> RELEASE_NOTES.md + echo "" >> RELEASE_NOTES.md + echo "# Checkout this release" >> RELEASE_NOTES.md + echo "git checkout $VERSION" >> RELEASE_NOTES.md + echo "" >> RELEASE_NOTES.md + echo "# Install and build" >> RELEASE_NOTES.md + echo "npm install" >> RELEASE_NOTES.md + echo "npm run build" >> RELEASE_NOTES.md + echo "npm start" >> RELEASE_NOTES.md + echo '```' >> RELEASE_NOTES.md + + echo "Release notes created:" + cat RELEASE_NOTES.md \ No newline at end of file diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 7507cfa..87291a0 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -51,7 +51,7 @@ jobs: test: runs-on: self-hosted - name: Run Tests + name: Run Tests (Node ${{ matrix.node-version }}) strategy: matrix: @@ -94,7 +94,7 @@ jobs: - name: Upload coverage reports uses: https://code.forgejo.org/forgejo/upload-artifact@v4 with: - name: coverage-report + name: coverage-report.zip path: coverage/ build: diff --git a/.forgejo/workflows/pr-labeler.yml b/.forgejo/workflows/pr-labeler.yml deleted file mode 100644 index dc3fbf2..0000000 --- a/.forgejo/workflows/pr-labeler.yml +++ /dev/null @@ -1,110 +0,0 @@ -name: PR Labeler - -on: - pull_request: - types: [opened, edited, synchronize] - -jobs: - label: - runs-on: self-hosted - name: Label Pull Request - - steps: - - name: Checkout code - uses: https://code.forgejo.org/actions/checkout@v4 - - - name: Analyze and label PR - run: | - echo "Analyzing PR for automatic labeling..." - - # Get changed files - git fetch origin main - # Try different approaches to get the diff - if git merge-base origin/main HEAD >/dev/null 2>&1; then - CHANGED_FILES=$(git diff --name-only origin/main...HEAD) - else - # Fallback: compare with origin/main directly - CHANGED_FILES=$(git diff --name-only origin/main HEAD || echo "") - fi - - if [ -z "$CHANGED_FILES" ]; then - echo "Unable to determine changed files, using all files in current branch" - CHANGED_FILES=$(find . -name "*.ts" -o -name "*.js" -o -name "*.scss" -o -name "*.json" | grep -v node_modules | head -20) - fi - - # Initialize labels array - LABELS="" - - # Check file types and paths - if echo "$CHANGED_FILES" | grep -q "^src/.*\.ts$"; then - LABELS="$LABELS,backend" - fi - - if echo "$CHANGED_FILES" | grep -q "^src/frontend/.*\.ts$"; then - LABELS="$LABELS,frontend" - fi - - if echo "$CHANGED_FILES" | grep -q "^public/.*\.\(js\|html\)$"; then - LABELS="$LABELS,frontend" - fi - - if echo "$CHANGED_FILES" | grep -q "^src/scss/.*\.scss$"; then - LABELS="$LABELS,styles" - fi - - if echo "$CHANGED_FILES" | grep -q "^tests/.*\.test\.ts$"; then - LABELS="$LABELS,tests" - fi - - if echo "$CHANGED_FILES" | grep -q "^\.forgejo/workflows/"; then - LABELS="$LABELS,ci/cd" - fi - - if echo "$CHANGED_FILES" | grep -q "package.*\.json$"; then - LABELS="$LABELS,dependencies" - fi - - if echo "$CHANGED_FILES" | grep -q "^docs/\|README\.md\|CLAUDE\.md"; then - LABELS="$LABELS,documentation" - fi - - if echo "$CHANGED_FILES" | grep -q "^src/i18n/"; then - LABELS="$LABELS,i18n" - fi - - if echo "$CHANGED_FILES" | grep -q "^scripts/"; then - LABELS="$LABELS,tooling" - fi - - # Check PR title/body for keywords - PR_TITLE="${{ github.event.pull_request.title }}" - PR_BODY="${{ github.event.pull_request.body }}" - - if echo "$PR_TITLE $PR_BODY" | grep -qi "security\|vulnerability\|CVE"; then - LABELS="$LABELS,security" - fi - - if echo "$PR_TITLE $PR_BODY" | grep -qi "performance\|optimize\|speed"; then - LABELS="$LABELS,performance" - fi - - if echo "$PR_TITLE $PR_BODY" | grep -qi "bug\|fix\|issue"; then - LABELS="$LABELS,bug" - fi - - if echo "$PR_TITLE $PR_BODY" | grep -qi "feature\|enhancement\|add"; then - LABELS="$LABELS,enhancement" - fi - - if echo "$PR_TITLE $PR_BODY" | grep -qi "breaking change\|BREAKING"; then - LABELS="$LABELS,breaking-change" - fi - - # Remove leading comma and duplicates - LABELS=$(echo "$LABELS" | sed 's/^,//' | tr ',' '\n' | sort -u | tr '\n' ',' | sed 's/,$//') - - echo "Suggested labels: $LABELS" - - # Note: In actual Forgejo/Gitea, you would use the API to apply labels - # This is just for demonstration - echo "To apply labels, use: tea pr edit ${{ github.event.pull_request.number }} --add-label \"$LABELS\"" \ No newline at end of file diff --git a/public/admin.html b/public/admin.html index c281bfd..41a6400 100644 --- a/public/admin.html +++ b/public/admin.html @@ -188,7 +188,6 @@ - diff --git a/public/i18n.js b/public/i18n.js index cb8f552..378a410 100644 --- a/public/i18n.js +++ b/public/i18n.js @@ -9,7 +9,6 @@ class I18nService { this.defaultLocale = 'en'; this.availableLocales = ['en', 'es-MX']; this.currentLocale = this.getStoredLocale() || this.detectBrowserLocale(); - this.loadTranslations(); } /** diff --git a/public/index.html b/public/index.html index 20bc4f0..813cc74 100644 --- a/public/index.html +++ b/public/index.html @@ -173,8 +173,6 @@ placeholder="Enter address, intersection (e.g., Main St & Second St, City), or l - - diff --git a/public/privacy.html b/public/privacy.html index 39544c3..b46ee36 100644 --- a/public/privacy.html +++ b/public/privacy.html @@ -139,7 +139,6 @@ -