first package

This commit is contained in:
Strife 2025-10-16 22:04:44 +05:00
parent b4c6e15b9d
commit dd3c571572
4 changed files with 63 additions and 0 deletions

View File

@ -0,0 +1,40 @@
name: Publish npm Package
on:
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Build package
run: npm run build
- name: Configure npm for Gitea
run: |
echo "@strife:registry=http://192.168.0.10:3002/api/packages/strife/npm/" >> .npmrc
echo "//192.168.0.10:3002/api/packages/strife/npm/:_authToken=648650b17c953af5dd69c4600d4a3b976646b538" >> .npmrc
- name: Publish to Gitea Package Registry
run: npm publish
env:
GITEA_TOKEN: 648650b17c953af5dd69c4600d4a3b976646b538
GITEA_SERVER_URL: http://192.168.0.10:3002
GITEA_ACTOR: Strife

2
.npmrc Normal file
View File

@ -0,0 +1,2 @@
@strife:registry=http://192.168.0.10:3002/api/packages/strife/npm/
//192.168.0.10:3002/api/packages/strife/npm/:_authToken=648650b17c953af5dd69c4600d4a3b976646b538

View File

@ -0,0 +1,7 @@
export function greet(name: string): string {
return `Hello, ${name}!`;
}
export function add(a: number, b: number): number {
return a + b;
}

View File

@ -0,0 +1,14 @@
{
"compilerOptions": {
"target": "ES2018",
"module": "CommonJS",
"declaration": true,
"outDir": "./dist",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist", "tests"]
}