Compare commits
24 Commits
7ba416694d
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
21d4c4cb71
|
|||
|
ac99f62600
|
|||
|
f2c7fd0c84
|
|||
|
8faa6dc174
|
|||
|
c5a58dc272
|
|||
|
616db3d06a
|
|||
|
bd30e2655f
|
|||
|
0c31a6b0c0
|
|||
|
2ead714719
|
|||
|
691dd0de92
|
|||
|
9e46d74a19
|
|||
|
57e5be38e6
|
|||
|
dd9235c265
|
|||
|
cccf91dfc7
|
|||
|
7ddb71d747
|
|||
|
330fd88ecc
|
|||
|
938060cd3f
|
|||
|
bdc7499fc1
|
|||
|
b606d5f463
|
|||
|
e3e5a10ec2
|
|||
|
d0b31f0147
|
|||
|
6bd3a0174d
|
|||
|
1649b25f05
|
|||
|
cd08e70750
|
@@ -1,35 +0,0 @@
|
||||
name: Build and Deploy to CDN
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
run: |
|
||||
git clone "$GITEA_REPO_URL" repo
|
||||
cd repo
|
||||
git checkout $GITEA_COMMIT_SHA
|
||||
env:
|
||||
GITEA_REPO_URL: ${{ gitea.repository.url }}
|
||||
GITEA_COMMIT_SHA: ${{ gitea.sha }}
|
||||
|
||||
- name: Install Node.js
|
||||
run: |
|
||||
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
|
||||
sudo apt-get install -y nodejs
|
||||
|
||||
- name: Verify Node and npm
|
||||
run: node --version && npm --version
|
||||
|
||||
- name: Install dependencies and build
|
||||
run: |
|
||||
cd repo
|
||||
npm ci
|
||||
npm run build
|
||||
npm test
|
||||
|
||||
- name: Deploy via rsync
|
||||
run: rsync -avz --delete repo/dist ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:${{ secrets.DEPLOY_PATH }}/
|
||||
69
.github/workflows/ci.yml
vendored
Normal file
69
.github/workflows/ci.yml
vendored
Normal 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
|
||||
3
LICENSE
3
LICENSE
@@ -1,5 +1,7 @@
|
||||
Copyright (c) 2026 db
|
||||
|
||||
Licensed under CC-BY-NC-SA 4.0 with the text below:
|
||||
|
||||
Attribution-NonCommercial-ShareAlike 4.0 International
|
||||
|
||||
=======================================================================
|
||||
@@ -439,3 +441,4 @@ the avoidance of doubt, this paragraph does not form part of the
|
||||
public licenses.
|
||||
|
||||
Creative Commons may be contacted at creativecommons.org.
|
||||
|
||||
|
||||
20
package.json
20
package.json
@@ -1,10 +1,16 @@
|
||||
{
|
||||
"name": "@db/VP",
|
||||
"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",
|
||||
"main": "./dist/video-player.cjs.js",
|
||||
"module": "./dist/video-player.es.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"sideEffects": [
|
||||
"*.css"
|
||||
],
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./dist/video-player.es.js",
|
||||
@@ -20,7 +26,6 @@
|
||||
"scripts": {
|
||||
"dev": "vite build --watch",
|
||||
"build": "tsc --emitDeclarationOnly && vite build",
|
||||
"build:raw": "tsc",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest",
|
||||
"lint": "eslint . --ext .ts",
|
||||
@@ -29,7 +34,11 @@
|
||||
"preview": "vite preview",
|
||||
"prepublishOnly": "npm run lint && npm run format && npm run test && npm run build"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"hls.js": "^1.6.16"
|
||||
},
|
||||
"devDependencies": {
|
||||
"hls.js": "^1.6.16",
|
||||
"@eslint/js": "^9.39.4",
|
||||
"@types/eslint": "^9.6.1",
|
||||
"@types/node": "^25.6.0",
|
||||
@@ -41,8 +50,5 @@
|
||||
"typescript-eslint": "^8.59.0",
|
||||
"vite": "^8.0.9",
|
||||
"vitest": "^4.1.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"hls.js": "^1.6.16"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user