From 6074b386390e89c9d00fceb49aaa2965ae597ba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E4=B8=AB=E8=AE=B2=E6=A2=B5?= Date: Wed, 22 Mar 2023 09:59:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E4=BA=8C=E8=BF=9B?= =?UTF-8?q?=E5=88=B6=E6=9E=84=E5=BB=BA=E7=9A=84=20action=20(#177)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/go-binary-release.yml | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/go-binary-release.yml diff --git a/.github/workflows/go-binary-release.yml b/.github/workflows/go-binary-release.yml new file mode 100644 index 0000000..555dc1e --- /dev/null +++ b/.github/workflows/go-binary-release.yml @@ -0,0 +1,26 @@ +name: build + +on: + release: + types: [created,published] # 表示在创建新的 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 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} # 一个默认的变量,用来实现往 Release 中添加文件 + goos: ${{ matrix.goos }} + goarch: ${{ matrix.goarch }} + goversion: 1.18 # 可以指定编译使用的 Golang 版本 + binary_name: "go-ldap-admin" # 可以指定二进制文件的名称 + extra_files: LICENSE config.yml go-ldap-admin-priv.pem go-ldap-admin-pub.pem rbac_model.conf README.md # 需要包含的额外文件 \ No newline at end of file