mirror of
https://github.com/Kyren223/eko.git
synced 2025-09-05 13:08:20 +00:00
46 lines
1.3 KiB
YAML
46 lines
1.3 KiB
YAML
name: Build Go binaries on github release
|
|
|
|
on:
|
|
release:
|
|
types: [created] # only runs when you manually click "Create release" matching a tag
|
|
|
|
permissions:
|
|
contents: write
|
|
packages: write
|
|
|
|
jobs:
|
|
publish-binaries:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
goos: [linux, darwin, windows]
|
|
goarch: ["386", amd64, arm64]
|
|
exclude:
|
|
- goarch: "386" # darwin/386 not supported
|
|
goos: darwin
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set COMMIT env
|
|
run: echo COMMIT=$(git rev-parse --short=7 HEAD) >> ${GITHUB_ENV}
|
|
|
|
- name: Set BUILD_DATE env
|
|
run: echo BUILD_DATE=$(date +%s) >> ${GITHUB_ENV}
|
|
|
|
- uses: wangyoucao577/go-release-action@v1
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
goos: ${{ matrix.goos }}
|
|
goarch: ${{ matrix.goarch }}
|
|
binary_name: eko
|
|
ldflags: >
|
|
-X "github.com/kyren223/eko/embeds.Commit=${{ env.COMMIT }}"
|
|
-X "github.com/kyren223/eko/embeds.BuildDate=${{ env.BUILD_DATE }}"
|
|
project_path: ./cmd/client
|
|
asset_name: 'eko-${{ matrix.goos }}-${{ matrix.goarch }}'
|
|
extra_files: LICENSE README.md
|
|
sha256sum: true
|
|
md5sum: false
|
|
overwrite: true
|