Skip to content

Commit c276029

Browse files
committed
feat: 更新构建和发布流程,添加 GitHub Actions 工作流和 CNB 配置
1 parent a42ec16 commit c276029

File tree

2 files changed

+71
-1
lines changed

2 files changed

+71
-1
lines changed

.cnb.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,30 @@ $:
1010
- docker
1111
stages:
1212
- name: go deps
13-
script: go mod tidy
13+
script: go mod tidy
14+
15+
v1.0.*:
16+
tag_push:
17+
- docker:
18+
build: .ide/Dockerfile
19+
stages:
20+
- name: changelog
21+
image: cnbcool/changelog
22+
exports:
23+
latestChangeLog: LATEST_CHANGE_LOG
24+
- name: create release
25+
type: git:release
26+
options:
27+
title: release
28+
description: ${LATEST_CHANGE_LOG}
29+
- name: build
30+
script:
31+
- chmod +x build.sh
32+
- ./build.sh
33+
- name: release 上传附件
34+
image: cnbcool/attachments:latest
35+
settings:
36+
attachments:
37+
- build/*.exe
38+
- build/mcp-alapi-cn-*-linux-*
39+
- build/mcp-alapi-cn-*-darwin-*

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Release Build and Upload
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # 匹配以 v 开头的 tag,例如 v1.0.0
7+
8+
jobs:
9+
build-and-release:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v4
20+
with:
21+
go-version: '1.24.1'
22+
cache: true
23+
24+
- name: Make build.sh executable
25+
run: chmod +x build.sh
26+
27+
- name: Build
28+
run: ./build.sh
29+
env:
30+
GO111MODULE: on
31+
32+
- name: Create Release
33+
id: create_release
34+
uses: softprops/action-gh-release@v2
35+
with:
36+
files: |
37+
build/*.exe
38+
build/mcp-alapi-cn-*-linux-*
39+
build/mcp-alapi-cn-*-darwin-*
40+
generate_release_notes: true
41+
draft: false
42+
prerelease: false
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)