diff --git a/.github/workflows/pr-label-check.yml b/.github/workflows/pr-label-check.yml index d41a482..3378f29 100644 --- a/.github/workflows/pr-label-check.yml +++ b/.github/workflows/pr-label-check.yml @@ -15,15 +15,16 @@ jobs: HAS_MAJOR=$(echo "$LABELS" | grep -c '"major"' || true) HAS_MINOR=$(echo "$LABELS" | grep -c '"minor"' || true) HAS_PATCH=$(echo "$LABELS" | grep -c '"patch"' || true) + HAS_CHORE=$(echo "$LABELS" | grep -c '"chore"' || true) - COUNT=$((HAS_MAJOR + HAS_MINOR + HAS_PATCH)) + COUNT=$((HAS_MAJOR + HAS_MINOR + HAS_PATCH + HAS_CHORE)) if [ "$COUNT" -eq 0 ]; then - echo "::error::PR must have one of: major, minor, patch label" + echo "::error::PR must have one of: major, minor, patch, chore label" exit 1 elif [ "$COUNT" -gt 1 ]; then - echo "::error::PR must have exactly one version label (major, minor, or patch). Found multiple." + echo "::error::PR must have exactly one label (major, minor, patch, or chore). Found multiple." exit 1 fi - echo "✓ Version label found" + echo "✓ Label found" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4af2680..55aad5e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,7 @@ # - "major" label → 1.2.3 → 2.0.0 # - "minor" label → 1.2.3 → 1.3.0 # - "patch" label → 1.2.3 → 1.2.4 (also the default fallback) +# - "chore" label → no release (CI housekeeping, docs, relicense, etc.) # 3. Decodes your keystore from a GitHub secret # 4. Builds a signed release APK with the new version # 5. Creates a GitHub Release with the APK attached @@ -27,13 +28,11 @@ permissions: contents: write jobs: - build: + detect: runs-on: ubuntu-latest - + outputs: + type: ${{ steps.bump.outputs.type }} steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Detect bump type from merged PR labels id: bump env: @@ -41,9 +40,12 @@ jobs: run: | # Find the PR associated with this merge commit COMMIT_SHA="${{ github.sha }}" - LABELS=$(gh pr list --state merged --search "$COMMIT_SHA" --json labels -q '.[0].labels[].name' 2>/dev/null || echo "") + LABELS=$(gh pr list --state merged --search "$COMMIT_SHA" --repo "${{ github.repository }}" --json labels -q '.[0].labels[].name' 2>/dev/null || echo "") - if echo "$LABELS" | grep -qi "major"; then + if echo "$LABELS" | grep -qi "chore"; then + echo "type=chore" >> "$GITHUB_OUTPUT" + echo "Chore PR — skipping release" + elif echo "$LABELS" | grep -qi "major"; then echo "type=major" >> "$GITHUB_OUTPUT" elif echo "$LABELS" | grep -qi "minor"; then echo "type=minor" >> "$GITHUB_OUTPUT" @@ -52,6 +54,15 @@ jobs: fi echo "Bump type: $(grep type "$GITHUB_OUTPUT" | cut -d= -f2)" + build: + needs: detect + if: needs.detect.outputs.type != 'chore' + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Determine next version id: version env: @@ -70,7 +81,7 @@ jobs: # Parse semver IFS='.' read -r MAJOR MINOR PATCH <<< "$LATEST" - BUMP="${{ steps.bump.outputs.type }}" + BUMP="${{ needs.detect.outputs.type }}" if [ "$BUMP" = "major" ]; then MAJOR=$((MAJOR + 1)) diff --git a/CLAUDE.md b/CLAUDE.md index 57f44e3..1905de0 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -2,18 +2,20 @@ ## PR Creation Rules -When creating a PR to `master`, you MUST add exactly one version label based on the changes: +When creating a PR to `master`, you MUST add exactly one label based on the changes: - **`major`** — Breaking changes, major new features, architecture overhaul - **`minor`** — New features, significant enhancements, new UI screens - **`patch`** — Bug fixes, small tweaks, translation updates, dependency bumps +- **`chore`** — CI/workflow changes, docs-only edits, relicensing, repo housekeeping (no release is cut) Use `gh pr create --label