53f56ce086
- deploy.yml: tag 触发(v*.*.*),四阶段调脚本(compile/test/release/deploy) - manual.yml: workflow_dispatch 支持手动回滚,checkout 指定 tag - scripts/ci/compile.sh: 构建 Go 二进制 + Flutter Web,打包 dist/ - scripts/ci/test.sh: go test + flutter analyze - scripts/ci/release.sh: 解析 CHANGELOG.md → 更新 version.yaml → 创建 Forgejo Release - scripts/ci/deploy.sh: 从 Release 下载产物(自动/手动均可)→ 部署到 EC2 - CHANGELOG.md: Keep a Changelog 格式,初始 v1.0.0 条目 - backend: GetRelease 改读 version.yaml,移除 ENV 变量依赖 - backend/config/version.yaml: 重置为 v1.0.0 - web/download.html: 动态拉取 /api/v1/public/release 展示版本号和更新内容 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
41 lines
1.1 KiB
YAML
41 lines
1.1 KiB
YAML
name: Deploy
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v[0-9]*.[0-9]*.[0-9]*'
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: mac
|
|
env:
|
|
GOPROXY: https://goproxy.cn,direct
|
|
PUB_HOSTED_URL: https://pub.flutter-io.cn
|
|
FLUTTER_STORAGE_BASE_URL: https://storage.flutter-io.cn
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Compile
|
|
run: sh scripts/ci/compile.sh "${{ gitea.ref_name }}"
|
|
|
|
- name: Test
|
|
run: sh scripts/ci/test.sh
|
|
|
|
- name: Release
|
|
env:
|
|
FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
|
|
FORGEJO_URL: ${{ secrets.FORGEJO_URL }}
|
|
GITEA_REPOSITORY: ${{ gitea.repository }}
|
|
run: sh scripts/ci/release.sh "${{ gitea.ref_name }}"
|
|
|
|
- name: Deploy
|
|
env:
|
|
FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
|
|
FORGEJO_URL: ${{ secrets.FORGEJO_URL }}
|
|
GITEA_REPOSITORY: ${{ gitea.repository }}
|
|
EC2_SSH_KEY: ${{ secrets.EC2_SSH_KEY }}
|
|
EC2_HOST: ${{ secrets.EC2_HOST }}
|
|
EC2_USER: ${{ secrets.EC2_USER }}
|
|
run: sh scripts/ci/deploy.sh "${{ gitea.ref_name }}"
|