first package
This commit is contained in:
parent
b4c6e15b9d
commit
dd3c571572
@ -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
2
.npmrc
Normal 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
|
||||
@ -0,0 +1,7 @@
|
||||
export function greet(name: string): string {
|
||||
return `Hello, ${name}!`;
|
||||
}
|
||||
|
||||
export function add(a: number, b: number): number {
|
||||
return a + b;
|
||||
}
|
||||
@ -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"]
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user