Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dong-dong6 authored Nov 17, 2024
1 parent 2f4b149 commit 402f8dc
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Build and Release

on:
workflow_dispatch: # 手动触发工作流
push:
tags:
- 'v*' # 监听以 'v' 开头的标签,例如 v1.0.0, v2.1.0

jobs:
build:
Expand All @@ -16,20 +18,20 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.23.2' # 根据部署脚本中的 Go 版本调整
go-version: '1.23.2'

# 安装 Go 依赖(切换到 rclone-go 目录)
# 安装 Go 依赖
- name: Install Go dependencies
run: |
cd rclone-go
go mod tidy # 确保在 rclone-go 目录下执行
go mod vendor # 如果需要,还可以运行 vendor 命令
go mod tidy
go mod vendor
# 设置 Node.js 环境
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20.15.0' # 根据部署脚本中的 Node.js 版本调整
node-version: '20.15.0'

# 安装 Node.js 依赖
- name: Install Node.js dependencies
Expand Down Expand Up @@ -57,7 +59,7 @@ jobs:
cp rclone-go/app release/myapp/
tar -czvf release/myapp.tar.gz -C release myapp
# 上传构建产物(Go 二进制文件和前端静态文件)
# 上传构建产物
- name: Upload release assets
uses: actions/upload-artifact@v3
with:
Expand All @@ -78,3 +80,5 @@ jobs:
uses: softprops/action-gh-release@v1
with:
files: release/myapp.tar.gz
tag: ${{ github.ref }} # 使用触发事件的标签作为 release 标签
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 402f8dc

Please sign in to comment.