Skip to content

chore(release): 1.8.2 — Yomitan/Migaku OCR line-scanning hotfix (#254) #147

chore(release): 1.8.2 — Yomitan/Migaku OCR line-scanning hotfix (#254)

chore(release): 1.8.2 — Yomitan/Migaku OCR line-scanning hotfix (#254) #147

Workflow file for this run

name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run Prettier
run: npx prettier --check .
- name: Run ESLint
run: npx eslint .
typecheck:
name: Type Check
runs-on: ubuntu-latest
# Non-blocking: svelte-check has incomplete Svelte 5 runes support
# causing false positives. Re-enable when svelte-check improves.
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run svelte-check
run: npm run check
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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 -- --run
- name: Run tests with coverage
run: npm run test:coverage
- name: Upload coverage reports
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
continue-on-error: true
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
release-check:
name: Release Check
runs-on: ubuntu-latest
# Only relevant for release PRs (develop -> main); skip on PRs into develop.
if: github.event_name == 'pull_request' && github.base_ref == 'main'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for version and changelog updates
run: |
# Check for skip label
if gh pr view ${{ github.event.pull_request.number }} --json labels -q '.labels[].name' | grep -q "skip-release-check"; then
echo "⏭️ Skipping release check (skip-release-check label)"
exit 0
fi
# Get changed files
CHANGED_FILES=$(git diff --name-only origin/main...HEAD)
# Check for version change
MAIN_VERSION=$(git show origin/main:package.json | grep '"version"' | sed 's/.*: *"\([^"]*\)".*/\1/')
PR_VERSION=$(grep '"version"' package.json | sed 's/.*: *"\([^"]*\)".*/\1/')
VERSION_CHANGED=false
if [ "$MAIN_VERSION" != "$PR_VERSION" ]; then
VERSION_CHANGED=true
echo "✅ Version changed: $MAIN_VERSION → $PR_VERSION"
fi
# Check for changelog update
CHANGELOG_CHANGED=false
if echo "$CHANGED_FILES" | grep -q "^CHANGELOG.md$"; then
CHANGELOG_CHANGED=true
echo "✅ CHANGELOG.md updated"
fi
# Both must be present, or neither (for non-release PRs)
if [ "$VERSION_CHANGED" = true ] && [ "$CHANGELOG_CHANGED" = true ]; then
echo ""
echo "✅ Release PR: version bumped and changelog updated"
exit 0
elif [ "$VERSION_CHANGED" = false ] && [ "$CHANGELOG_CHANGED" = false ]; then
echo ""
echo "✅ Non-release PR: no version or changelog changes"
exit 0
else
echo ""
echo "❌ Incomplete release changes!"
echo ""
if [ "$VERSION_CHANGED" = true ]; then
echo " - Version was changed but CHANGELOG.md was not updated"
else
echo " - CHANGELOG.md was updated but version was not bumped"
fi
echo ""
echo "For a release, you must update BOTH:"
echo " 1. version in package.json"
echo " 2. CHANGELOG.md with release notes"
echo ""
echo "Or add the 'skip-release-check' label to bypass this check."
exit 1
fi
env:
GH_TOKEN: ${{ github.token }}