Skip to content

Commit

Permalink
Merge pull request #4 from cubxxw/feat/design-ws
Browse files Browse the repository at this point in the history
feat: add system design ws"
  • Loading branch information
cubxxw authored Nov 1, 2024
2 parents b1d8a60 + cbb52e4 commit bf1df31
Show file tree
Hide file tree
Showing 56 changed files with 3,488 additions and 531 deletions.
29 changes: 20 additions & 9 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
# MinIO 配置
MINIO_ENDPOINT=play.min.io
MINIO_ACCESS_KEY=youraccesskey
MINIO_SECRET_KEY=yoursecretkey
MINIO_USE_SSL=false
VOICEFLOW_MINIO_ENDPOINT='localhost:9000' # MinIO 服务地址
VOICEFLOW_MINIO_ACCESS_KEY='minioadmin' # MinIO 访问密钥
VOICEFLOW_MINIO_SECRET_KEY='minioadmin' # MinIO 密钥

# Azure 配置
AZURE_STT_KEY=yourazuresttkey
AZURE_TTS_KEY=yourazurettskey
VOICEFLOW_AZURE_STT_KEY='your_azure_stt_key' # Azure 语音转文本密钥
VOICEFLOW_AZURE_TTS_KEY='your_azure_tts_key' # Azure 文本转语音密钥
VOICEFLOW_AZURE_REGION='eastus' # Azure 服务区域

# Google 配置
GOOGLE_STT_KEY=yourgooglesttkey
GOOGLE_TTS_KEY=yourgooglettskey
VOICEFLOW_GOOGLE_STT_KEY='your_google_stt_key' # Google 语音转文本密钥
VOICEFLOW_GOOGLE_TTS_KEY='your_google_tts_key' # Google 文本转语音密钥

# OpenAI 配置
OPENAI_API_KEY=youropenaiapikey
VOICEFLOW_OPENAI_API_KEY='your_openai_api_key' # OpenAI API 密钥

# AssemblyAI 配置
VOICEFLOW_ASSEMBLYAI_API_KEY='your_assemblyai_api_key' # AssemblyAI API 密钥

# 语音服务端口配置
VOICEFLOW_SERVER_PORT=18080 # VoiceFlow 服务端口

# VOLCENGINE 配置
VOICEFLOW_VOLCENGINE_ACCESS_KEY=''
VOICEFLOW_VOLCENGINE_APP_KEY=''
VOICEFLOW_VOLCENGINE_WS_URL='wss://openspeech.bytedance.com/api/v3/sauc/bigmode
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CONTIRIBUTING
# CONTRIBUTING

We expect as many developers as possible to contribute, which is the motivation for our efforts to maintain the community

Expand Down
91 changes: 0 additions & 91 deletions .github/sync.yml

This file was deleted.

101 changes: 101 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Docker Build and Push

on:
schedule:
- cron: '30 2 * * *'
push:
branches:
- main
- release-*
tags:
- 'v*.*.*' # 例如 v1.0.0, v2.1.3
- 'v*.*.*-*' # 例如 v1.0.0-beta.1
workflow_dispatch:

jobs:
steps:
# 1. 检出代码
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # 确保获取所有标签

# 2. 设置 Docker Buildx
- name: Set up Docker Buildx
uses: docker/[email protected]

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
# 3. 登录 Docker Hub
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

# 4. 登录阿里云容器注册表
- name: Log in to AliYun Docker Hub
uses: docker/login-action@v3
with:
registry: registry.cn-hangzhou.aliyuncs.com
username: ${{ secrets.ALIREGISTRY_USERNAME }}
password: ${{ secrets.ALIREGISTRY_TOKEN }}

# 5. 登录 GitHub Container Registry
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

# 6. 获取 Docker Metadata
- name: Get Docker metadata
id: metadata
uses: docker/[email protected]
with:
images: |
docker.io/telepace/voiceflow
registry.cn-hangzhou.aliyuncs.com/telepace/voiceflow
ghcr.io/telepace/voiceflow
tags: |
type=ref,event=tag
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern=v{{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
# 7. 构建并推送 Docker 镜像
- name: Build and push Docker image for voiceflow
uses: docker/build-push-action@v5
with:
context: .
file: ./build/images/voiceflow/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta1.outputs.tags }}
labels: ${{ steps.meta1.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache

# 8. 可选:安全扫描(例如 Trivy)
- name: Scan Docker image for vulnerabilities
uses: aquasecurity/[email protected]
with:
image-ref: telepace/voiceflow:${{ steps.metadata.outputs.version }}
format: 'table'
exit-code: '0'

# 9. 清理未使用的 Docker 镜像
- name: Clean up Docker
run: docker system prune -f
13 changes: 13 additions & 0 deletions .github/workflows/go-typecheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Go Typecheck Workflow Test

on: [push, pull_request]

jobs:
comment-language-detector:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Code Typecheck Detector
uses: kubecub/typecheck@main
27 changes: 0 additions & 27 deletions .github/workflows/gpt-translate.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/spell-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ on:
jobs:
run:
name: Spell Check with Typos
runs-on: ubuntu-latest
runs-on: ubuntu-latest e
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Check spelling of md
uses: crate-ci/typos@master
with:
files:
./CONTIRIBUTING.md
./CONTRIBUTING.md
./README.md

- name: Use custom config file
Expand Down
43 changes: 0 additions & 43 deletions .github/workflows/sync.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jobs:

- name: Test build artifacts
run: |
# Add your tests here to check the build artifacts
make test
5 changes: 3 additions & 2 deletions .github/workflows/typos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Check for typos
uses: codespell-project/actions-codespell@master
uses: codespell-project/actions-codespell@v2
with:
check_filenames: true
skip: .git,*.png,*.jpg
ignore_words_file: .github/workflows/codespell_ignore_words.txt
exclude_file: docs/CODEOWNERS
paths: ./CONTRIBUTING.md ./README.md

Loading

0 comments on commit bf1df31

Please sign in to comment.