Skip to content

v0.1.6 2024-11-23 🌈 #8

v0.1.6 2024-11-23 🌈

v0.1.6 2024-11-23 🌈 #8

name: build
on:
release:
types: [created,published] # 表示在创建新的 Release 时触发
jobs:
build-go-binary:
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, darwin] # 需要打包的系统
goarch: [amd64, arm64] # 需要打包的架构
steps:
- uses: actions/checkout@v3
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
- uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.ACCESS_TOKEN }} # 一个默认的变量,用来实现往 Release 中添加文件
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
retry: 10
overwrite: true
build_command: "make"
build_flags: "build VERSION=${{ env.GITHUB_REF_NAME }}"
goversion: 1.22 # 可以指定编译使用的 Golang 版本
binary_name: "cloud_dns_exporter" # 可以指定二进制文件的名称
extra_files: config.example.yaml LICENSE README.md # 需要包含的额外文件