Files
naxos-api/.gitea/workflows/ci.yaml
T
2026-09-04 07:30:38 +02:00

49 lines
1.3 KiB
YAML

name: CI & Test NaxOS Management API
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: write
packages: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install Dependencies
run: npm ci || npm install
- name: Typecheck
run: npx tsc --noEmit
- name: Run Unit Tests
run: npm test
- name: Build Management Daemon
run: npm run build
- name: Publish Package to Gitea Packages
run: |
npm pack
TGZ_FILE=$(ls naxos-api-*.tgz | head -n 1)
echo "Packaging $TGZ_FILE to Gitea Packages registry..."
curl -s --fail-with-body -X PUT \
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
--upload-file "$TGZ_FILE" \
"${{ github.server_url }}/api/packages/naxos/generic/naxos-api/1.0.0/$TGZ_FILE" || echo "Generic package uploaded or exists"
echo "//git.lholz.de/api/packages/naxos/npm/:_authToken=${{ secrets.GITEA_TOKEN }}" >> ~/.npmrc
npm publish || echo "NPM package published or exists"