Skip to content

Commit f89d238

Browse files
committed
ci: add GitHub Actions for tests and tagged releases
1 parent b327474 commit f89d238

4 files changed

Lines changed: 70 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
node-version: ["18.x", "20.x", "22.x"]
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: ${{ matrix.node-version }}
19+
- name: Run tests
20+
run: node --test authforge.test.mjs

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
7+
jobs:
8+
build-and-publish:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
id-token: write
12+
contents: read
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: "20.x"
18+
registry-url: "https://registry.npmjs.org"
19+
- name: Install latest npm (required for OIDC)
20+
run: npm install -g npm@latest
21+
- name: Verify tag matches package version
22+
run: |
23+
TAG="${GITHUB_REF#refs/tags/v}"
24+
PKG=$(node -p "require('./package.json').version")
25+
if [ "$TAG" != "$PKG" ]; then
26+
echo "Tag v$TAG does not match package.json version $PKG"
27+
exit 1
28+
fi
29+
- name: Run tests
30+
run: node --test authforge.test.mjs
31+
- name: Publish to npm
32+
run: npm publish --provenance --access public

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
11
node_modules/
2+
3+
# Logs and local env (never publish secrets)
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
.env
9+
.env.*
10+
11+
# Optional tooling output
12+
coverage/
13+
.nyc_output/
14+
*.tgz

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "authforge",
2+
"name": "@authforgecc/sdk",
33
"version": "1.0.0",
44
"description": "Official AuthForge SDK for Node.js — credit-based license key authentication with Ed25519-verified responses",
55
"type": "module",
@@ -17,7 +17,10 @@
1717
"license": "MIT",
1818
"repository": {
1919
"type": "git",
20-
"url": "https://github.com/AuthForgeCC/authforge-node"
20+
"url": "git+https://github.com/AuthForgeCC/authforge-node.git"
21+
},
22+
"publishConfig": {
23+
"access": "public"
2124
},
2225
"keywords": [
2326
"authforge",

0 commit comments

Comments
 (0)