feat(admin): 增加关于页与发布版本信息

- 在系统设置中新增“关于”标签页,提供版本、仓库、Issues、文档和开源协议入口。
- 通过 Docker 构建参数注入版本号与发布链接,并在前端展示当前发布版本。
- 调整 GitHub Actions 与镜像构建流程,仅在 tag 发布时构建并发布带版本标识的镜像。
This commit is contained in:
LanQin
2026-06-21 02:23:40 +08:00
parent 99fe3cc57c
commit c872ed559d
5 changed files with 132 additions and 9 deletions
+33 -5
View File
@@ -68,11 +68,33 @@ jobs:
working-directory: apps/api
run: go test ./...
release:
name: Resolve release tag
runs-on: ubuntu-latest
needs: checks
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
outputs:
tag: ${{ steps.release.outputs.tag }}
version: ${{ steps.release.outputs.version }}
release_url: ${{ steps.release.outputs.release_url }}
steps:
- name: Resolve tag version
id: release
shell: bash
run: |
tag="${GITHUB_REF_NAME}"
version="${tag#v}"
release_url="https://github.com/${GITHUB_REPOSITORY}/releases/tag/${tag}"
echo "tag=${tag}" >> "$GITHUB_OUTPUT"
echo "version=${version}" >> "$GITHUB_OUTPUT"
echo "release_url=${release_url}" >> "$GITHUB_OUTPUT"
echo "::notice::Docker release tag: ${tag}"
docker:
name: Build and publish ${{ matrix.name }}
runs-on: ubuntu-latest
needs: checks
if: github.event_name != 'pull_request'
needs: release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
strategy:
fail-fast: false
matrix:
@@ -124,6 +146,8 @@ jobs:
run: |
image="${REGISTRY}/${GITHUB_REPOSITORY}${{ matrix.suffix }}"
echo "name=${image,,}" >> "$GITHUB_OUTPUT"
echo "tag=${{ needs.release.outputs.tag }}" >> "$GITHUB_OUTPUT"
echo "version=${{ needs.release.outputs.version }}" >> "$GITHUB_OUTPUT"
- name: Docker metadata
id: meta
@@ -131,12 +155,13 @@ jobs:
with:
images: ${{ steps.image.outputs.name }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=branch
type=ref,event=tag
type=raw,value=${{ steps.image.outputs.tag }}
type=raw,value=${{ steps.image.outputs.version }}
type=raw,value=latest
type=sha,prefix=sha-
labels: |
org.opencontainers.image.title=LanQin Email ${{ matrix.name }}
org.opencontainers.image.version=${{ steps.image.outputs.tag }}
- name: Build and push
uses: docker/build-push-action@v6
@@ -145,5 +170,8 @@ jobs:
file: ${{ matrix.file }}
platforms: ${{ env.PLATFORMS }}
push: true
build-args: |
VITE_APP_VERSION=${{ needs.release.outputs.tag }}
VITE_RELEASE_URL=${{ needs.release.outputs.release_url }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}