From bb665746833cd136ba6f78db1405fe4ffbc2100f Mon Sep 17 00:00:00 2001 From: CoderCore <35726402+CoderCore@users.noreply.github.com> Date: Mon, 30 Sep 2024 13:26:43 +0800 Subject: [PATCH] Create build-go-binary --- .github/workflows/build-go-binary | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/build-go-binary diff --git a/.github/workflows/build-go-binary b/.github/workflows/build-go-binary new file mode 100644 index 0000000..d55ff1a --- /dev/null +++ b/.github/workflows/build-go-binary @@ -0,0 +1,26 @@ +name: build-go-binary + +on: + release: + types: [created] # 表示在创建新的 Release 时触发 + +jobs: + build-go-binary: + runs-on: ubuntu-latest + strategy: + matrix: + goos: [linux, windows, darwin] # 需要打包的系统 + goarch: [amd64, arm64] # 需要打包的架构 + exclude: # 排除某些平台和架构 + - goarch: arm64 + goos: windows + steps: + - uses: actions/checkout@v3 + - uses: wangyoucao577/go-release-action@v1.30 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} # 一个默认的变量,用来实现往 Release 中添加文件 + goos: ${{ matrix.goos }} + goarch: ${{ matrix.goarch }} + goversion: 1.18 # 可以指定编译使用的 Golang 版本 + binary_name: "chatgpt-dingtalk" # 可以指定二进制文件的名称 + extra_files: README.md config.dev.json # 需要包含的额外文件