40 lines
979 B
YAML
40 lines
979 B
YAML
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 |