mirror of
https://github.com/glittercowboy/get-shit-done
synced 2026-04-25 17:25:23 +02:00
feat: add CI/CD and release automation
- Add GitHub Actions CI for cross-platform testing (ubuntu/windows/macos × node 18/20/22) - Add release workflow that auto-creates GitHub Releases and publishes to npm on tag push - Add CONTRIBUTING.md with branching strategy (maintainers direct commit, contributors PR) - Add MAINTAINERS.md with release workflows and recovery procedures - Add PR template for contributors Closes #221 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
24
.github/pull_request_template.md
vendored
Normal file
24
.github/pull_request_template.md
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
## What
|
||||
|
||||
<!-- One sentence: what does this PR do? -->
|
||||
|
||||
## Why
|
||||
|
||||
<!-- One sentence: why is this change needed? -->
|
||||
|
||||
## Testing
|
||||
|
||||
- [ ] Tested on macOS
|
||||
- [ ] Tested on Windows
|
||||
- [ ] Tested on Linux
|
||||
|
||||
## Checklist
|
||||
|
||||
- [ ] Follows GSD style (no enterprise patterns, no filler)
|
||||
- [ ] Updates CHANGELOG.md for user-facing changes
|
||||
- [ ] No unnecessary dependencies added
|
||||
- [ ] Works on Windows (backslash paths tested)
|
||||
|
||||
## Breaking Changes
|
||||
|
||||
None
|
||||
70
.github/workflows/ci.yml
vendored
Normal file
70
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
node-version: [18, 20, 22]
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build hooks
|
||||
run: npm run build:hooks
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
if npm pkg get scripts.test | grep -q '"test"'; then
|
||||
npm test
|
||||
else
|
||||
echo "No test script defined, skipping"
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
- name: Verify installation
|
||||
run: |
|
||||
npm link
|
||||
npx get-shit-done-cc --version
|
||||
shell: bash
|
||||
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
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 lint
|
||||
run: |
|
||||
if npm pkg get scripts.lint | grep -q '"lint"'; then
|
||||
npm run lint
|
||||
else
|
||||
echo "No lint script defined, skipping"
|
||||
fi
|
||||
83
.github/workflows/release.yml
vendored
Normal file
83
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+'
|
||||
- '!v*-*' # Exclude pre-release tags
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Extract version from tag
|
||||
id: version
|
||||
run: |
|
||||
VERSION=${GITHUB_REF#refs/tags/v}
|
||||
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo "Releasing version: $VERSION"
|
||||
|
||||
- name: Extract changelog section
|
||||
id: changelog
|
||||
run: |
|
||||
VERSION="${{ steps.version.outputs.VERSION }}"
|
||||
awk -v ver="$VERSION" '
|
||||
/^## \[/ {
|
||||
if (found) exit
|
||||
if ($0 ~ "\\[" ver "\\]") found=1
|
||||
}
|
||||
found {print}
|
||||
' CHANGELOG.md > release_notes.md
|
||||
|
||||
if [ ! -s release_notes.md ]; then
|
||||
echo "## v$VERSION" > release_notes.md
|
||||
echo "" >> release_notes.md
|
||||
echo "See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md) for details." >> release_notes.md
|
||||
fi
|
||||
|
||||
echo "Release notes:"
|
||||
cat release_notes.md
|
||||
|
||||
- name: Create GitHub Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
body_path: release_notes.md
|
||||
draft: false
|
||||
prerelease: false
|
||||
generate_release_notes: false
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
publish:
|
||||
needs: release
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build
|
||||
run: npm run build:hooks
|
||||
|
||||
- name: Publish to npm
|
||||
run: npm publish
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
Reference in New Issue
Block a user