diff --git a/.github/workflows/linux-release.yml b/.github/workflows/linux-release.yml index d9375795..d93c70ca 100644 --- a/.github/workflows/linux-release.yml +++ b/.github/workflows/linux-release.yml @@ -7,6 +7,11 @@ on: tags: - '*' - '!*-alpha*' + workflow_dispatch: + inputs: + name: + description: 'reason' + required: false jobs: release: runs-on: ubuntu-latest @@ -22,10 +27,10 @@ jobs: env: CI: "" run: | - cd web/default - npm install - REACT_APP_VERSION=$(git describe --tags) npm run build - cd ../.. + cd web + git describe --tags > VERSION + REACT_APP_VERSION=$(git describe --tags) chmod u+x ./build.sh && ./build.sh + cd .. - name: Set up Go uses: actions/setup-go@v3 with: diff --git a/.github/workflows/macos-release.yml b/.github/workflows/macos-release.yml index 69bb93f5..ce9d1f11 100644 --- a/.github/workflows/macos-release.yml +++ b/.github/workflows/macos-release.yml @@ -7,6 +7,11 @@ on: tags: - '*' - '!*-alpha*' + workflow_dispatch: + inputs: + name: + description: 'reason' + required: false jobs: release: runs-on: macos-latest @@ -22,10 +27,10 @@ jobs: env: CI: "" run: | - cd web/default - npm install - REACT_APP_VERSION=$(git describe --tags) npm run build - cd ../.. + cd web + git describe --tags > VERSION + REACT_APP_VERSION=$(git describe --tags) chmod u+x ./build.sh && ./build.sh + cd .. - name: Set up Go uses: actions/setup-go@v3 with: diff --git a/.github/workflows/windows-release.yml b/.github/workflows/windows-release.yml index c08e95d2..9b1f16ba 100644 --- a/.github/workflows/windows-release.yml +++ b/.github/workflows/windows-release.yml @@ -7,6 +7,11 @@ on: tags: - '*' - '!*-alpha*' + workflow_dispatch: + inputs: + name: + description: 'reason' + required: false jobs: release: runs-on: windows-latest diff --git a/Dockerfile b/Dockerfile index 56648168..b21a7b3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,16 +3,7 @@ FROM node:16 as builder WORKDIR /build COPY ./web . COPY ./VERSION . -RUN themes=$(cat THEMES) \ - && IFS=$'\n' \ - && for theme in $themes; do \ - theme_path="web/$theme" \ - && echo "Building theme: $theme" \ - && cd $theme_path \ - && npm install \ - && DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat VERSION) npm run build \ - && cd /app \ - done +RUN chmod u+x ./build.sh && ./build.sh FROM golang AS builder2 diff --git a/README.md b/README.md index b53936c4..28f4e5e6 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,7 @@ _✨ 通过标准的 OpenAI API 格式访问所有的大模型,开箱即用 + 邮箱登录注册(支持注册邮箱白名单)以及通过邮箱进行密码重置。 + [GitHub 开放授权](https://github.com/settings/applications/new)。 + 微信公众号授权(需要额外部署 [WeChat Server](https://github.com/songquanpeng/wechat-server))。 +23. 支持主题切换,设置环境变量 `THEME` 即可,默认为 `default`,欢迎 PR 更多主题,具体参考[此处](./web/README.md)。 ## 部署 ### 基于 Docker 进行部署 diff --git a/web/build.sh b/web/build.sh new file mode 100644 index 00000000..b3751ff4 --- /dev/null +++ b/web/build.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +version=$(cat VERSION) +themes=$(cat THEMES) +IFS=$'\n' + +for theme in $themes; do + echo "Building theme: $theme" + cd $theme + npm install + DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$version npm run build + cd .. +done