The configuration used by goreleaser (which we previously used to build the release binaries) had set CGO_ENABLED=0. Since we don't specifically need this to be on, revert to that configuration. Also add a few more go build flags to reduce the size of the produced binaries Ref: - https://github.com/wangyoucao577/go-release-action/issues/33 - https://github.com/wangyoucao577/go-release-action - https://github.com/ente-io/cli/blob/main/.goreleaser.yaml#L18 Related: - https://github.com/ente-io/ente/issues/727
55 lines
1.7 KiB
YAML
55 lines
1.7 KiB
YAML
name: "Release (cli)"
|
|
|
|
on:
|
|
push:
|
|
# Run when a tag matching the pattern "cli-v*"" is pushed
|
|
#
|
|
# Tip: to test this workflow, push at tag with a pre-release version,
|
|
# e.g. `cli-v1.2.3-test`, where 1.2.3 is the expected version number of
|
|
# the next release that'll go out.
|
|
#
|
|
# See: [Note: Testing release workflows that are triggered by tags]
|
|
tags:
|
|
- "cli-v*"
|
|
|
|
jobs:
|
|
draft-release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Create a draft GitHub release
|
|
uses: ncipollo/release-action@v1
|
|
with:
|
|
draft: true
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
needs: draft-release
|
|
|
|
strategy:
|
|
matrix:
|
|
goos: [linux, windows, darwin]
|
|
goarch: ["386", amd64, arm64]
|
|
exclude:
|
|
- goarch: "386"
|
|
goos: darwin
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build binaries and add to the release
|
|
uses: wangyoucao577/go-release-action@v1
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
goos: ${{ matrix.goos }}
|
|
goarch: ${{ matrix.goarch }}
|
|
asset_name: ente-${{ github.ref_name }}-${{ matrix.goos }}-${{ matrix.goarch }}
|
|
release_name: ${{ github.ref_name }}
|
|
goversion: "1.20"
|
|
project_path: "./cli"
|
|
pre_command: export CGO_ENABLED=0
|
|
build_flags: "-trimpath"
|
|
ldflags: "-s -w"
|
|
md5sum: false
|
|
sha256sum: true
|