From 1a0b26c058470a91dc4dcbc3dc34d94757f99842 Mon Sep 17 00:00:00 2001 From: Igor Sirotin Date: Mon, 13 May 2024 20:06:50 +0300 Subject: [PATCH] goreleaser linux --- .github/workflows/release.yml | 36 +++++++++++++++++------------------ .goreleaser-darwin.yml | 1 - .goreleaser-linux.yml | 25 ++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 19 deletions(-) create mode 100644 .goreleaser-linux.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8a9b13e..aaa7920 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,23 +26,23 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# linux: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# -# - name: Set up Go -# uses: actions/setup-go@v5 -# with: -# go-version: '1.20' -# -# - name: Run GoReleaser -# uses: goreleaser/goreleaser-action@v5 -# with: -# distribution: goreleaser -# args: build --clean --config=.goreleaser-linux.yml -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# + linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.20' + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + with: + distribution: goreleaser + args: build --clean --config=.goreleaser-linux.yml + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # windows: # runs-on: windows-latest \ No newline at end of file diff --git a/.goreleaser-darwin.yml b/.goreleaser-darwin.yml index 5ce9b33..60f7545 100644 --- a/.goreleaser-darwin.yml +++ b/.goreleaser-darwin.yml @@ -6,7 +6,6 @@ before: builds: - goos: -# - linux # - windows - darwin goarch: diff --git a/.goreleaser-linux.yml b/.goreleaser-linux.yml new file mode 100644 index 0000000..1355c2f --- /dev/null +++ b/.goreleaser-linux.yml @@ -0,0 +1,25 @@ +version: 1 + +before: + hooks: +# - go mod tidy + +builds: + - goos: + - linux + goarch: + - amd64 + - arm64 + env: + - CGO_ENABLED=1 + +archives: + - format: tar.gz + # this name template makes the OS and Arch compatible with the results of `uname`. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} \ No newline at end of file