Compare commits

..

22 Commits

Author SHA1 Message Date
21d4c4cb71 fix(ci): fixed some general issues
Some checks failed
CI / build-and-publish (push) Failing after 40s
2026-05-12 19:01:10 +03:30
ac99f62600 fix(ci): added the missing at sign behind registry
Some checks failed
CI / build-and-publish (push) Failing after 38s
2026-05-12 18:20:59 +03:30
f2c7fd0c84 fix(ci): incorrect double qoutations
Some checks failed
CI / build-and-publish (push) Failing after 18s
2026-05-12 18:18:41 +03:30
8faa6dc174 fix(ci): added a missing colon in npm registry
Some checks failed
CI / build-and-publish (push) Failing after 1m6s
2026-05-12 18:11:22 +03:30
c5a58dc272 fix(ci): corrected the npm config
Some checks failed
CI / build-and-publish (push) Failing after 44s
2026-05-12 18:09:00 +03:30
616db3d06a test(ci): tested using secret var directly
Some checks failed
CI / build-and-publish (push) Failing after 34s
2026-05-12 13:36:37 +03:30
bd30e2655f test(ci): test ptinting gitea token
Some checks failed
CI / build-and-publish (push) Failing after 49s
2026-05-12 11:33:19 +03:30
0c31a6b0c0 fix(ci): corrected variable names and removed test
Some checks failed
CI / build-and-publish (push) Failing after 1m12s
2026-05-12 11:29:46 +03:30
2ead714719 test(ci): debugging why npm publish fails
Some checks failed
CI / build-and-publish (push) Failing after 1m13s
2026-05-12 11:27:19 +03:30
691dd0de92 ci: used token for clone too and corrected npm pub
Some checks failed
CI / build-and-publish (push) Failing after 39s
2026-05-12 11:18:47 +03:30
9e46d74a19 ci: used more relaiable npm config for publish
Some checks failed
CI / build-and-publish (push) Failing after 53s
2026-05-12 11:13:46 +03:30
57e5be38e6 ci: used default env variables available to me
Some checks failed
CI / build-and-publish (push) Failing after 47s
2026-05-12 11:07:35 +03:30
dd9235c265 ci: removed unnecessary cdn raw build
Some checks failed
CI / build-and-publish (push) Failing after 38s
2026-05-12 11:01:49 +03:30
cccf91dfc7 ci: commented tests and removed GITEA_TOKEN var
Some checks failed
CI / build-and-publish (push) Failing after 43s
2026-05-12 10:59:23 +03:30
7ddb71d747 fix(ci): changed the way of setting mirrors of apk
Some checks failed
CI / build-and-publish (push) Failing after 1m6s
2026-05-12 10:56:05 +03:30
330fd88ecc fix: added apk update to read new mirrors
Some checks failed
CI / build-and-publish (push) Failing after 1s
2026-05-12 10:51:02 +03:30
938060cd3f feat: added mirror for alpine apk package manager
Some checks failed
CI / build-and-publish (push) Failing after 1s
2026-05-12 10:47:28 +03:30
bdc7499fc1 ci: added checkout step to workflow
Some checks failed
CI / build-and-publish (push) Has been cancelled
2026-05-12 10:44:44 +03:30
b606d5f463 fix: made default shell sh instead of bash
Some checks failed
CI / build-and-publish (push) Failing after 0s
node:apline doesn't include bash it only has sh so i set the default shell to that
2026-05-12 10:40:31 +03:30
e3e5a10ec2 ci: changed ci name and made it use node base img
Some checks failed
CI / build-and-publish (push) Failing after 0s
it now uses node-latest by default and runs everything as shell commands instead of github actions
2026-05-12 10:36:20 +03:30
d0b31f0147 chore(license): updated the license file header
Some checks failed
Build and Deploy to CDN / build (push) Failing after 5s
2026-05-10 00:22:17 +03:30
6bd3a0174d refactor(npm): more robust yet simple package.json 2026-05-08 22:54:36 +03:30
4 changed files with 85 additions and 54 deletions

69
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,69 @@
name: CI
on:
push:
branches: [main]
jobs:
build-and-publish:
runs-on: node-latest
defaults:
run:
shell: sh
steps:
- name: Checkout repository
env:
ALPINE_MIRROR: ${{ secrets.ALPINE_MIRROR }}
G_TOKEN: ${{ secrets.G_TOKEN }}
run: |
set -e
ALPINE_VERSION=$(cat /etc/alpine-release | cut -d'.' -f1-2) && \
echo "${ALPINE_MIRROR}v${ALPINE_VERSION}/main" > /etc/apk/repositories && \
echo "${ALPINE_MIRROR}v${ALPINE_VERSION}/community" >> /etc/apk/repositories
apk update
apk add --no-cache git
HOST="${GITHUB_SERVER_URL#https://}"
REPO="${{ github.repository }}"
AUTH_URL="https://${G_TOKEN}@${HOST}/${REPO}.git"
git clone --depth 1 --branch "$GITHUB_REF_NAME" "$AUTH_URL" .
if [ "$(git rev-parse HEAD)" != "$GITHUB_SHA" ]; then
echo "Fetching exact commit $GITHUB_SHA..."
git fetch origin "$GITHUB_SHA" --depth 1
git checkout "$GITHUB_SHA"
fi
- name: Install dependencies
run: npm ci --prefer-offline
- name: Lint
run: npm run lint
- name: Check formatting
run: npm run format:check
# - name: Run tests
# run: npm test
- name: Build npm package
run: npm run build
- name: Publish to Gitea npm registry
if: success()
env:
G_TOKEN: ${{ secrets.G_TOKEN }}
run: |
set -e
HOST="${GITHUB_SERVER_URL#https://}"
OWNER="${GITHUB_REPOSITORY_OWNER}"
npm config set "@${OWNER}:registry" "https://${HOST}/api/packages/${OWNER}/npm/"
npm config set "//${HOST}/api/packages/${OWNER}/npm/:_authToken" "${G_TOKEN}"
npm config set "//${HOST}/api/packages/npm/:_authToken" "${G_TOKEN}"
npm publish --ignore-scripts

View File

@@ -1,47 +0,0 @@
name: Build and Deploy to CDN
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run linter
run: npm run lint
- name: Run tests
run: npm test
- name: Build CDN assets
run: npm run build
- name: Build npm package
run: npm run build:raw
- name: Publish to Gitea npm registry
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
run: |
echo "//${{ secrets.GITEA_HOST || 'git.db123.ir' }}/api/packages/${{ github.repository_owner }}/${{ github.event.repository.name }}/npm/:_authToken=${GITEA_TOKEN}" > .npmrc
npm publish --registry https://${{ secrets.GITEA_HOST || 'git.db123.ir' }}/api/packages/${{ github.repository_owner }}/${{ github.event.repository.name }}/npm
- name: Upload CDN build as artifact
uses: actions/upload-artifact@v4
with:
name: cdn-build
path: dist/
retention-days: 7

View File

@@ -1,5 +1,7 @@
Copyright (c) 2026 db Copyright (c) 2026 db
Licensed under CC-BY-NC-SA 4.0 with the text below:
Attribution-NonCommercial-ShareAlike 4.0 International Attribution-NonCommercial-ShareAlike 4.0 International
======================================================================= =======================================================================
@@ -439,3 +441,4 @@ the avoidance of doubt, this paragraph does not form part of the
public licenses. public licenses.
Creative Commons may be contacted at creativecommons.org. Creative Commons may be contacted at creativecommons.org.

View File

@@ -1,10 +1,16 @@
{ {
"name": "@db/VP", "name": "@db/VP",
"version": "0.0.2", "version": "0.0.2",
"description": "Low-latency video player with HLS.js and WebRTC/WHEP support",
"license": "CC-BY-NC-SA-4.0",
"repository": {
"type": "git",
"url": "https://git.db123.ir/db/VP"
},
"type": "module", "type": "module",
"main": "./dist/video-player.cjs.js", "sideEffects": [
"module": "./dist/video-player.es.js", "*.css"
"types": "./dist/index.d.ts", ],
"exports": { "exports": {
".": { ".": {
"import": "./dist/video-player.es.js", "import": "./dist/video-player.es.js",
@@ -20,7 +26,6 @@
"scripts": { "scripts": {
"dev": "vite build --watch", "dev": "vite build --watch",
"build": "tsc --emitDeclarationOnly && vite build", "build": "tsc --emitDeclarationOnly && vite build",
"build:raw": "tsc",
"test": "vitest run", "test": "vitest run",
"test:watch": "vitest", "test:watch": "vitest",
"lint": "eslint . --ext .ts", "lint": "eslint . --ext .ts",
@@ -29,7 +34,11 @@
"preview": "vite preview", "preview": "vite preview",
"prepublishOnly": "npm run lint && npm run format && npm run test && npm run build" "prepublishOnly": "npm run lint && npm run format && npm run test && npm run build"
}, },
"peerDependencies": {
"hls.js": "^1.6.16"
},
"devDependencies": { "devDependencies": {
"hls.js": "^1.6.16",
"@eslint/js": "^9.39.4", "@eslint/js": "^9.39.4",
"@types/eslint": "^9.6.1", "@types/eslint": "^9.6.1",
"@types/node": "^25.6.0", "@types/node": "^25.6.0",
@@ -41,8 +50,5 @@
"typescript-eslint": "^8.59.0", "typescript-eslint": "^8.59.0",
"vite": "^8.0.9", "vite": "^8.0.9",
"vitest": "^4.1.5" "vitest": "^4.1.5"
},
"dependencies": {
"hls.js": "^1.6.16"
} }
} }