Skip to content

Commit 67f0fc1

Browse files
serslonclaude
andcommitted
feat: add CI/CD deployment configuration for NPM publishing
- Add GitHub Actions workflows (CI, Release, Manual Release) - Configure semantic-release for automatic versioning - Add commitlint with conventional commits validation - Set up husky for pre-commit hooks - Create CHANGELOG.md and DEPLOYMENT.md documentation - Update package.json with author and repository info - Add CI/NPM badges to README 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 97ec775 commit 67f0fc1

File tree

12 files changed

+9531
-1955
lines changed

12 files changed

+9531
-1955
lines changed

.github/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Configuration for GitHub's automatically generated release notes
2+
changelog:
3+
exclude:
4+
labels:
5+
- ignore-for-release
6+
authors:
7+
- github-actions[bot]
8+
- dependabot[bot]
9+
categories:
10+
- title: 🚀 Features
11+
labels:
12+
- feature
13+
- enhancement
14+
- title: 🐛 Bug Fixes
15+
labels:
16+
- bug
17+
- fix
18+
- title: 📚 Documentation
19+
labels:
20+
- documentation
21+
- docs
22+
- title: 🧪 Tests
23+
labels:
24+
- test
25+
- testing
26+
- title: 🔧 Maintenance
27+
labels:
28+
- chore
29+
- maintenance
30+
- dependencies
31+
- title: 🔒 Security
32+
labels:
33+
- security
34+
- title: ⚡ Performance
35+
labels:
36+
- performance
37+
- title: Other Changes
38+
labels:
39+
- '*'

.github/workflows/ci.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [18, 20, 22]
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
cache: 'npm'
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Run linting
31+
run: npm run lint
32+
33+
- name: Run tests with coverage
34+
run: npm run test:coverage
35+
36+
- name: Build package
37+
run: npm run build
38+
39+
- name: Upload coverage reports
40+
if: matrix.node-version == 20
41+
uses: codecov/codecov-action@v4
42+
with:
43+
token: ${{ secrets.CODECOV_TOKEN }}
44+
fail_ci_if_error: false
45+
46+
commitlint:
47+
runs-on: ubuntu-latest
48+
if: github.event_name == 'pull_request'
49+
50+
steps:
51+
- name: Checkout repository
52+
uses: actions/checkout@v4
53+
with:
54+
fetch-depth: 0
55+
56+
- name: Setup Node.js
57+
uses: actions/setup-node@v4
58+
with:
59+
node-version: 20
60+
cache: 'npm'
61+
62+
- name: Install dependencies
63+
run: npm ci
64+
65+
- name: Validate PR commits
66+
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Manual Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release_type:
7+
description: 'Release type'
8+
required: true
9+
type: choice
10+
options:
11+
- patch
12+
- minor
13+
- major
14+
dry_run:
15+
description: 'Dry run (no actual release)'
16+
required: false
17+
type: boolean
18+
default: false
19+
20+
permissions:
21+
contents: write
22+
issues: write
23+
pull-requests: write
24+
id-token: write
25+
26+
jobs:
27+
manual-release:
28+
runs-on: ubuntu-latest
29+
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0
35+
token: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Setup Node.js
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: 20
41+
cache: 'npm'
42+
43+
- name: Install dependencies
44+
run: npm ci
45+
46+
- name: Run tests
47+
run: npm run test:coverage
48+
49+
- name: Build package
50+
run: npm run build
51+
52+
- name: Configure Git
53+
run: |
54+
git config user.name "github-actions[bot]"
55+
git config user.email "github-actions[bot]@users.noreply.github.com"
56+
57+
- name: Bump version
58+
id: version
59+
run: |
60+
npm version ${{ inputs.release_type }} --no-git-tag-version
61+
NEW_VERSION=$(node -p "require('./package.json').version")
62+
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
63+
64+
- name: Commit and push version bump
65+
if: ${{ !inputs.dry_run }}
66+
run: |
67+
git add package.json package-lock.json
68+
git commit -m "chore(release): v${{ steps.version.outputs.new_version }}"
69+
git tag "v${{ steps.version.outputs.new_version }}"
70+
git push origin master --tags
71+
72+
- name: Publish to NPM
73+
if: ${{ !inputs.dry_run }}
74+
run: npm publish --access public
75+
env:
76+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
77+
78+
- name: Create GitHub Release
79+
if: ${{ !inputs.dry_run }}
80+
uses: softprops/action-gh-release@v2
81+
with:
82+
tag_name: v${{ steps.version.outputs.new_version }}
83+
name: Release v${{ steps.version.outputs.new_version }}
84+
generate_release_notes: true
85+
env:
86+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87+
88+
- name: Dry run summary
89+
if: ${{ inputs.dry_run }}
90+
run: |
91+
echo "🧪 Dry run completed!"
92+
echo "Would have released version: ${{ steps.version.outputs.new_version }}"

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [master]
6+
7+
permissions:
8+
contents: write
9+
issues: write
10+
pull-requests: write
11+
id-token: write
12+
13+
jobs:
14+
release:
15+
runs-on: ubuntu-latest
16+
if: github.repository == 'procoders/astrology-typescript'
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
persist-credentials: false
24+
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: 20
29+
cache: 'npm'
30+
31+
- name: Install dependencies
32+
run: npm ci
33+
34+
- name: Build package
35+
run: npm run build
36+
37+
- name: Run tests
38+
run: npm run test:coverage
39+
40+
- name: Semantic Release
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
44+
run: npx semantic-release

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no -- commitlint --edit $1

.releaserc.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"branches": ["master"],
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
[
7+
"@semantic-release/changelog",
8+
{
9+
"changelogFile": "CHANGELOG.md"
10+
}
11+
],
12+
"@semantic-release/npm",
13+
[
14+
"@semantic-release/git",
15+
{
16+
"assets": ["package.json", "package-lock.json", "CHANGELOG.md"],
17+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
18+
}
19+
],
20+
"@semantic-release/github"
21+
]
22+
}

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [0.1.0] - 2024-01-01
9+
10+
### Added
11+
12+
- Initial release of `@procoders/astrology-api-client`
13+
- Core API client with configurable base URL and authentication
14+
- Support for natal chart calculations
15+
- Support for transit calculations
16+
- Support for synastry analysis
17+
- Full TypeScript support with comprehensive type definitions
18+
- ESM and CommonJS module support
19+
- Comprehensive test coverage

0 commit comments

Comments
 (0)