This commit is contained in:
2026-04-25 16:36:34 +08:00
commit db90e7579b
1876 changed files with 189777 additions and 0 deletions

38
.github/workflows/admin.yaml vendored Normal file
View File

@@ -0,0 +1,38 @@
name: "Server Admin CI"
on:
push:
branches:
- master
paths:
- "server/admin/**"
workflow_dispatch:
jobs:
ci:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: checkout
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/action-setup@v2.0.1
with:
version: 8.15.8
run_install: false
- name: Install packages
run: pnpm install --frozen-lockfile
- name: Check Build
run: pnpm build:admin

48
.github/workflows/ci.yaml vendored Normal file
View File

@@ -0,0 +1,48 @@
name: "CI"
on:
push:
branches:
- master
paths:
- "client/web/**"
- "client/shared/**"
- "client/packages/design/**"
workflow_dispatch:
jobs:
ci:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: checkout
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/action-setup@v2.0.1
with:
version: 8.15.8
run_install: false
- name: Install packages
run: pnpm install --frozen-lockfile
- name: Check Type
run: cd client/web && pnpm check:type
- name: Test
run: cd client/web && pnpm test
env:
TZ: Asia/Shanghai
- name: Check Build
run: cd client/web && pnpm build:ci
env:
PERFSEE_TOKEN: ${{ secrets.PERFSEE_TOKEN }}

64
.github/workflows/deploy-deno.yml vendored Normal file
View File

@@ -0,0 +1,64 @@
name: Deploy into deno deploy
on:
push:
branches:
- master
paths:
- "client/web/**"
- "client/shared/**"
- "client/packages/design/**"
workflow_dispatch:
jobs:
deploy:
name: Deploy deno
runs-on: ubuntu-latest
permissions:
id-token: write # Needed for auth with Deno Deploy
contents: read # Needed to clone the repository
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Install Deno
uses: denoland/setup-deno@main
with:
deno-version: 1.18.2
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/action-setup@v2.0.1
with:
version: latest
run_install: false
- name: Install packages
run: pnpm install --frozen-lockfile
- name: Build step
run: cd client/web && pnpm build
env:
SERVICE_URL: https://tailchat-nightly.moonrailgun.com
- name: Copy Deno Entry
run: cd client/web && cp ./scripts/deno-static-entry.ts ./dist/deno-static-entry.ts
- name: Upload to Deno Deploy
uses: denoland/deployctl@v1
with:
project: "tailchat-nightly"
# entrypoint: https://deno.land/std@0.202.0/http/file_server.ts
entrypoint: deno-static-entry.ts
root: "./client/web/dist"

28
.github/workflows/deploy-github-app.yml vendored Normal file
View File

@@ -0,0 +1,28 @@
name: "Deployment Tailchat Github App"
on:
push:
branches:
- master
paths:
- "apps/github-app/**"
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v1
- name: Deploy to Vercel
uses: amondnet/vercel-action@master
env:
VERSION: ${{ env.GITHUB_SHA }}
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.ORG_ID}}
vercel-project-id: prj_KwCzbuSaEj3XmP0sYvvnqqiK7nCW
working-directory: ./apps/github-app
vercel-args: '--prod'

62
.github/workflows/deploy-laf.yml vendored Normal file
View File

@@ -0,0 +1,62 @@
name: Deploy into laf
on:
push:
branches:
- master
paths:
- ".github/workflows/deploy-laf.yml"
- "client/web/**"
- "client/shared/**"
- "client/packages/design/**"
workflow_dispatch:
jobs:
deploy:
name: Deploy Laf
runs-on: ubuntu-latest
permissions:
id-token: write # Needed for auth with Deno Deploy
contents: read # Needed to clone the repository
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/action-setup@v2.0.1
with:
version: latest
run_install: false
- name: Install packages
run: pnpm install --frozen-lockfile
- name: Inject Analytics
run: node ./client/web/build/inject-analytics.js
- name: Build step
run: cd client/web && pnpm build
env:
SERVICE_URL: https://tailchat-nightly.moonrailgun.com
- name: Deploy to laf storage
uses: moonrailgun/laf-storage-deploy-action@v1.1
with:
laf-server: https://laf.dev
laf-pat: ${{ secrets.LAF_PAT }}
laf-appid: yyejoq
laf-bucket-name: yyejoq-tailchat-nightly
dist-path: client/web/dist

55
.github/workflows/deploy-website.yml vendored Normal file
View File

@@ -0,0 +1,55 @@
name: "Deployment Website"
on:
push:
branches:
- master
paths:
- "website/**"
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
defaults:
run:
working-directory: website
steps:
- uses: actions/checkout@v1
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v1
# with:
# node-version: ${{ matrix.node-version }}
# - name: Cache pnpm modules
# uses: actions/cache@v2
# with:
# path: ~/.pnpm-store
# key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
# restore-keys: |
# ${{ runner.os }}-
# - uses: pnpm/action-setup@v2.0.1
# with:
# version: 7.1.9
# run_install: true
# - name: Install Packages
# run: pnpm install
# - name: Build page
# run: pnpm build
# - name: Deploy to gh-pages
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./website/build
- name: Deploy to Vercel
uses: amondnet/vercel-action@master
env:
VERSION: ${{ env.GITHUB_SHA }}
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.ORG_ID}}
vercel-project-id: prj_mqIp5rfpiL3xObjBj5zMyI1y3x9r
working-directory: ./
vercel-args: '--prod'

57
.github/workflows/desktop-build.yml vendored Normal file
View File

@@ -0,0 +1,57 @@
name: "Desktop Build"
on:
push:
branches:
- master
paths:
- "client/desktop/release/app/package.json" # build when version upgrade
workflow_dispatch:
jobs:
build-desktop:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-latest
# - ubuntu-latest
- windows-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v1
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 16
- name: Install global dependencies
uses: pnpm/action-setup@v2.0.1
with:
version: latest
run_install: true
- name: Install npm dependencies
run: yarn
working-directory: ./client/desktop
- name: Build/release Electron app
uses: paneron/action-electron-builder@v1.8.1
with:
package_root: ./client/desktop
# GitHub token, automatically provided to the action
# (No need to define this secret in the repo settings)
github_token: ${{ secrets.github_token }}
release: false
# # If the commit is tagged with a version (e.g. "v1.0.0"),
# # release the app after building
# release: ${{ startsWith(github.ref, 'refs/tags/v') }}
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: desktop-client-artifacts
path: ./client/desktop/release/build/*

View File

@@ -0,0 +1,40 @@
# Reference: https://github.com/docker/build-push-action/blob/master/docs/advanced/tags-labels.md
name: "Docker Publish Canary"
on:
workflow_dispatch:
jobs:
dockerize:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: moonrailgun/tailchat
# generate Docker tags based on the following events/attributes
tags: |
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: VERSION=canary-${{ steps.meta.outputs.tags }}

54
.github/workflows/docker-publish.yml vendored Normal file
View File

@@ -0,0 +1,54 @@
# Reference: https://github.com/docker/build-push-action/blob/master/docs/advanced/tags-labels.md
name: "Docker Publish"
on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
jobs:
dockerize:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: moonrailgun/tailchat
# generate Docker tags based on the following events/attributes
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: VERSION=docker-${{ steps.meta.outputs.tags }}
- name: Notify to Service
continue-on-error: true
uses: muinmomin/webhook-action@v1.0.0
with:
url: https://tailchat-nightly.moonrailgun.com/api/plugin:com.msgbyte.simplenotify/webhook/callback
data: '{"text": "The new docker images has been push, visit https://hub.docker.com/r/moonrailgun/tailchat/tags to learn more", "subscribeId": "${{ secrets.NOTIFY_SUB_ID}}"}'

40
.github/workflows/rn-build-apk.yml vendored Normal file
View File

@@ -0,0 +1,40 @@
name: "RN Android Build Apk"
on:
# push:
# branches:
# - master
# paths:
# - "client/mobile/**"
workflow_dispatch:
jobs:
install-dependencies:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./client/mobile
steps:
- uses: actions/checkout@v3
- name: Install npm dependencies
run: |
yarn
build-android:
needs: install-dependencies
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./client/mobile
steps:
- uses: actions/checkout@v3
- name: Install npm dependencies
run: |
yarn
- name: Build Android Release
run: |
cd android && ./gradlew assembleRelease
- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
name: app-release.apk
path: android/app/build/outputs/apk/release/

30
.github/workflows/translator.yaml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: 'translator'
on:
issues:
types: [opened, edited]
issue_comment:
types: [created, edited]
discussion:
types: [created, edited]
discussion_comment:
types: [created, edited]
pull_request_target:
types: [opened, edited]
pull_request_review_comment:
types: [created, edited]
jobs:
translate:
permissions:
issues: write
discussions: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: lizheming/github-translate-action@1.1.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
IS_MODIFY_TITLE: true
APPEND_TRANSLATION: true

View File

@@ -0,0 +1,20 @@
name: "deploy nightly test"
on:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: Deploy Prod
uses: amondnet/vercel-action@master
env:
VERSION: ${{ env.GITHUB_SHA }}
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.ORG_ID}}
vercel-project-id: ${{ secrets.PROJECT_ID}}
working-directory: ./

36
.github/workflows/vercel-nightly.yml vendored Normal file
View File

@@ -0,0 +1,36 @@
name: "deploy nightly"
on:
push:
branches:
- master
paths:
- "client/web/**"
- "client/shared/**"
- "client/packages/design/**"
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: Inject Analytics
run: node ./client/web/build/inject-analytics.js
- name: Deploy Prod
uses: amondnet/vercel-action@master
env:
VERSION: ${{ env.GITHUB_SHA }}
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.ORG_ID}}
vercel-project-id: ${{ secrets.PROJECT_ID}}
working-directory: ./
vercel-args: '--prod'
- name: Notify to Service
continue-on-error: true
uses: muinmomin/webhook-action@v1.0.0
with:
url: https://paw-server-nightly.moonrailgun.com/api/plugin:com.msgbyte.simplenotify/webhook/callback
data: '{"text": "The new version of the frontend code is deployed", "subscribeId": "${{ secrets.NOTIFY_SUB_ID}}"}'