Skip to content

Commit 1760a2d

Browse files
authored
build: unify release tags across Go and Rust (#45)
Use a shared v* tag for both release workflows, require explicit tags for manual dispatches, and document gitserver support in the README.
1 parent 93641dc commit 1760a2d

3 files changed

Lines changed: 50 additions & 10 deletions

File tree

.github/workflows/release-go.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@ name: Release Go
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
release_tag:
7+
description: Release tag to publish (for example v1.0.6)
8+
required: true
9+
type: string
510
push:
611
tags:
7-
- "go/v*"
12+
- "v*"
813

914
permissions:
1015
contents: write
@@ -22,11 +27,18 @@ jobs:
2227
steps:
2328
- name: Checkout
2429
uses: actions/checkout@v4
30+
with:
31+
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag || github.ref }}
2532

2633
- name: Derive release metadata
34+
env:
35+
INPUT_TAG: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag || '' }}
2736
run: |
28-
TAG="${GITHUB_REF_NAME}"
29-
VERSION="${TAG#go/}"
37+
TAG="${INPUT_TAG}"
38+
if [ -z "$TAG" ]; then
39+
TAG="${GITHUB_REF_NAME}"
40+
fi
41+
VERSION="$TAG"
3042
echo "TAG=$TAG" >> "$GITHUB_ENV"
3143
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
3244
@@ -72,11 +84,18 @@ jobs:
7284
steps:
7385
- name: Checkout
7486
uses: actions/checkout@v4
87+
with:
88+
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag || github.ref }}
7589

7690
- name: Derive release metadata
91+
env:
92+
INPUT_TAG: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag || '' }}
7793
run: |
78-
TAG="${GITHUB_REF_NAME}"
79-
VERSION="${TAG#go/}"
94+
TAG="${INPUT_TAG}"
95+
if [ -z "$TAG" ]; then
96+
TAG="${GITHUB_REF_NAME}"
97+
fi
98+
VERSION="$TAG"
8099
echo "TAG=$TAG" >> "$GITHUB_ENV"
81100
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
82101

.github/workflows/release-rust.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@ name: Release Rust
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
release_tag:
7+
description: Release tag to publish (for example v1.0.6)
8+
required: true
9+
type: string
510
push:
611
tags:
7-
- "rust/v*"
12+
- "v*"
813

914
permissions:
1015
contents: write
@@ -20,11 +25,18 @@ jobs:
2025
steps:
2126
- name: Checkout
2227
uses: actions/checkout@v4
28+
with:
29+
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag || github.ref }}
2330

2431
- name: Derive release metadata
32+
env:
33+
INPUT_TAG: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag || '' }}
2534
run: |
26-
TAG="${GITHUB_REF_NAME}"
27-
VERSION="${TAG#rust/}"
35+
TAG="${INPUT_TAG}"
36+
if [ -z "$TAG" ]; then
37+
TAG="${GITHUB_REF_NAME}"
38+
fi
39+
VERSION="$TAG"
2840
echo "TAG=$TAG" >> "$GITHUB_ENV"
2941
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
3042
@@ -66,11 +78,18 @@ jobs:
6678
steps:
6779
- name: Checkout
6880
uses: actions/checkout@v4
81+
with:
82+
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag || github.ref }}
6983

7084
- name: Derive release metadata
85+
env:
86+
INPUT_TAG: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag || '' }}
7187
run: |
72-
TAG="${GITHUB_REF_NAME}"
73-
VERSION="${TAG#rust/}"
88+
TAG="${INPUT_TAG}"
89+
if [ -z "$TAG" ]; then
90+
TAG="${GITHUB_REF_NAME}"
91+
fi
92+
VERSION="$TAG"
7493
echo "TAG=$TAG" >> "$GITHUB_ENV"
7594
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
7695

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Smart-Git 是一个高性能的 Git Smart HTTP 转发与缓存服务,旨在加
1212
- **轻量存储**: 使用 [BoltDB](https://go.etcd.io/bbolt) 管理元数据,单文件数据库,部署简便。
1313

1414
### Rust 版本 (`smart-git-rs`)
15+
- **Git 协议与 HTTP 基础能力**: 基于 [gitserver](https://github.com/WJQSERVER/gitserver) 提供 Rust 版本的 Git 协议处理与 HTTP 层支持。
1516
- **现代异步**: 基于 [Axum](https://github.com/tokio-rs/axum)[Tokio](https://github.com/tokio-rs/tokio) 栈,资源占用低且并发性强。
1617
- **稳健的 Git 引擎**: 采用 [Gix](https://github.com/Byron/gitoxide) (Gitoxide) 引擎,提供更快的克隆与同步速度。
1718
- **自动刷新**: 引入后台扫描任务,根据 TTL 自动更新过期仓库。
@@ -52,5 +53,6 @@ Go 与 Rust 两个实现的示例配置、TOML/WANF 对照和字段说明见 [do
5253
- [Touka](https://github.com/infinite-iroha/touka)
5354
- [Go-Git](https://github.com/go-git/go-git)
5455
- [Gix (Gitoxide)](https://github.com/Byron/gitoxide)
56+
- [gitserver](https://github.com/WJQSERVER/gitserver) (Rust 版本的 Git 协议与 HTTP 层能力支持)
5557
- [WANF](https://github.com/WJQSERVER/wanf)
5658
- [erred/gitreposerver](https://github.com/erred/gitreposerver) (Smart HTTP 实现参考)

0 commit comments

Comments
 (0)