From c06ac9b8413666daa71fb3e8d7c3b2e729a62f69 Mon Sep 17 00:00:00 2001 From: eryajf Date: Sun, 11 Dec 2022 21:52:22 +0800 Subject: [PATCH] add create release --- .github/workflows/docker-image.yml | 22 +-------------------- .github/workflows/go-binary-release.yml | 26 +++++++++++++++++++++++++ README.md | 4 ++-- 3 files changed, 29 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/go-binary-release.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index d1fb545..f2ad9c8 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -58,24 +58,4 @@ jobs: # 给清单打上多个标签 tags: | ${{ secrets.DOCKERHUB_USERNAME }}/chatgpt-dingtalk:${{ steps.date.outputs.today }} - ${{ secrets.DOCKERHUB_USERNAME }}/chatgpt-dingtalk:latest - - 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: LICENSE README.md # 需要包含的额外文件 \ No newline at end of file + ${{ secrets.DOCKERHUB_USERNAME }}/chatgpt-dingtalk:latest \ No newline at end of file diff --git a/.github/workflows/go-binary-release.yml b/.github/workflows/go-binary-release.yml new file mode 100644 index 0000000..b5c4049 --- /dev/null +++ b/.github/workflows/go-binary-release.yml @@ -0,0 +1,26 @@ +name: build + +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: "hello" # 可以指定二进制文件的名称 + extra_files: LICENSE README.md # 需要包含的额外文件 \ No newline at end of file diff --git a/README.md b/README.md index b334b89..7e151f9 100644 --- a/README.md +++ b/README.md @@ -115,8 +115,8 @@ server { 下载之后,在本地解压,即可看到可执行程序,与配置文件: ``` -$ tar xf chatgpt-dingtalk-v0.0.2-darwin-arm64.tar.gz -$ cd chatgpt-dingtalk-v0.0.2-darwin-arm64 +$ tar xf chatgpt-dingtalk-v0.0.4-darwin-arm64.tar.gz +$ cd chatgpt-dingtalk-v0.0.4-darwin-arm64 $ cp config.dev.json # 根据情况调整配置文件内容 $ ./chatgpt-dingtalk # 直接运行