-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.yml.bak
More file actions
47 lines (38 loc) · 1.07 KB
/
Copy pathbuild.yml.bak
File metadata and controls
47 lines (38 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Build and Package
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23.2' # 使用 Go 1.23.2 版本
- name: Build
run: go build -o tcpmk_node -ldflags "-w" main.go # 编译命令
- name: Create package directory
run: mkdir -p package
- name: Copy files to package directory
run: |
cp tcpmk_node package/ # 复制二进制文件
cp default.toml package/ # 复制配置文件
cp -r data package/ # 复制 data 目录
- name: Package files
run: |
tar -czvf tcpmk_node-release.tar.gz -C package . # 打包成 tar.gz
zip -r tcpmk_node-release.zip package/* # 打包成 zip
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: release-package
path: |
tcpmk_node-release.tar.gz
tcpmk_node-release.zip