refactor: move distributed files to src/, add sync check CI

- Distributed files now live in src/ — consumers use `path: src/`
- Top-level files are identical copies (repo eats its own dog food)
- CI sync-check job validates top-level and src/ stay in sync
- Removed .common-repo.yaml (path: scoping replaces source excludes)
- Updated README with new structure and usage
This commit is contained in:
2026-03-15 01:26:38 -07:00
parent 170f4c7b5f
commit aa94b0a057
7 changed files with 226 additions and 8 deletions

20
src/.github/workflows/commitlint.yml vendored Normal file
View File

@@ -0,0 +1,20 @@
name: Commitlint
on:
pull_request:
branches:
- main
permissions:
contents: read
pull-requests: read
jobs:
commitlint:
name: Lint Commits
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@b948419dd99f3fd78a6548c61b7286b4ffe7cb3d # v6

70
src/.github/workflows/release.yaml vendored Normal file
View File

@@ -0,0 +1,70 @@
name: Release
on:
workflow_dispatch:
push:
branches:
- main
permissions:
contents: write
issues: write
pull-requests: write
jobs:
ci:
name: CI
permissions:
issues: write
contents: write
pull-requests: write
uses: ./.github/workflows/ci.yaml
secrets: inherit
release:
name: Release
needs: ci
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Generate app token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.CHRISTMAS_ISLAND_APP_ID }}
private-key: ${{ secrets.CHRISTMAS_ISLAND_PRIVATE_KEY }}
owner: christmas-island
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}
persist-credentials: true
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
with:
cache: npm
cache-dependency-path: ".releaserc.yaml"
node-version: lts/*
- name: Semantic Release
id: release
run: |
# Semantic Release
npm install --no-save --no-package-lock \
"@semantic-release/commit-analyzer" \
"@semantic-release/release-notes-generator" \
"@semantic-release/changelog" \
"@semantic-release/git" \
"@semantic-release/github" \
"semantic-release-major-tag" \
"conventional-changelog-conventionalcommits"
npx semantic-release > release.log 2>&1 || true
cat release.log
if grep -q "There are no relevant changes, so no new version is released." release.log; then
echo "publish=false" >> "$GITHUB_OUTPUT"
else
echo "publish=true" >> "$GITHUB_OUTPUT"
fi
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
outputs:
publish: ${{ steps.release.outputs.publish }}

61
src/.releaserc.yaml Normal file
View File

@@ -0,0 +1,61 @@
---
branches:
- main
preset: "conventionalcommits"
tagFormat: "v${version}"
plugins:
- - "@semantic-release/commit-analyzer"
- preset: conventionalcommits
- - "@semantic-release/release-notes-generator"
- preset: conventionalcommits
- - "@semantic-release/changelog"
- - "@semantic-release/git"
- - "@semantic-release/github"
# Disable noisy issue/PR comments to avoid GH rate limits
- failComment: false
failTitle: false
labels: false
releasedLabels: false
successComment: false
- - "semantic-release-major-tag"
generateNotes:
- path: "@semantic-release/release-notes-generator"
writerOpts:
commitsSort:
- subject
- scope
presetConfig:
types:
- type: build
section: Build System
hidden: false
- type: chore
section: Miscellaneous
hidden: false
- type: ci
section: Continuous Integration
hidden: false
- type: docs
section: Documentation
hidden: false
- type: feat
section: Features
hidden: false
- type: fix
section: Bug Fixes
hidden: false
- type: perf
section: Performance Improvements
hidden: false
- type: refactor
section: Code Refactoring
hidden: false
- type: style
section: Styles
hidden: false
- type: test
section: Tests
hidden: false

3
src/commitlint.config.js Normal file
View File

@@ -0,0 +1,3 @@
module.exports = {
extends: ["@commitlint/config-conventional"],
};