Files
eko/.github/workflows/release.yml
Kyren223 3feffc0f77 Directly embedding version inside the app instead of injecting it at
build time, so there is always only one source of truth
2025-08-03 15:41:16 +03:00

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