Skip to content

Commit 2b828e8

Browse files
asachs01claude
andcommitted
feat: Add semantic-release for GitHub Packages publishing
- Configure @asachs01 scoped package for GitHub Packages - Add semantic-release with commit-analyzer and changelog plugins - Add CI workflow for testing across Node 18/20/22 - Add release workflow for automatic versioning and publishing Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 5024b65 commit 2b828e8

File tree

4 files changed

+100
-2
lines changed

4 files changed

+100
-2
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
name: Test
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
node-version: [18, 20, 22]
16+
17+
steps:
18+
- name: Checkout
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+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Run linter
30+
run: npm run lint
31+
32+
- name: Run type check
33+
run: npm run typecheck
34+
35+
- name: Build
36+
run: npm run build
37+
38+
- name: Run tests
39+
run: npm test

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: write
9+
packages: write
10+
11+
jobs:
12+
release:
13+
name: Release
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
persist-credentials: false
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 20
26+
registry-url: 'https://npm.pkg.github.com'
27+
scope: '@asachs01'
28+
29+
- name: Install dependencies
30+
run: npm ci
31+
32+
- name: Build
33+
run: npm run build
34+
35+
- name: Run tests
36+
run: npm test
37+
38+
- name: Release
39+
run: npx semantic-release
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.releaserc.json

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

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
2-
"name": "node-syncro",
3-
"version": "0.1.0",
2+
"name": "@asachs01/node-syncro",
3+
"version": "0.0.0-development",
4+
"publishConfig": {
5+
"registry": "https://npm.pkg.github.com"
6+
},
47
"description": "Comprehensive, fully-typed Node.js/TypeScript library for the Syncro MSP API",
58
"main": "./dist/index.cjs",
69
"module": "./dist/index.js",

0 commit comments

Comments
 (0)