From 064fd61b6fac62d4f044e70f261328adeac8de52 Mon Sep 17 00:00:00 2001 From: Taishi Kasuga Date: Thu, 14 Dec 2023 16:44:13 +0900 Subject: [PATCH 1/6] ci: add goreleaser settings --- .github/workflows/release.yaml | 39 ++++++++++++++++++++++++++++++++++ .goreleaser.yaml | 31 +++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 .github/workflows/release.yaml create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..a2a6cdd --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,39 @@ +--- +# @see https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions +# @see https://github.com/actions/virtual-environments +name: Release +on: + push: + tags: + - "v*" +concurrency: ${{ github.workflow }} +jobs: + release: + name: Release + if: github.repository == 'livesense-inc/fanlin' + timeout-minutes: 10 + runs-on: ubuntu-latest + permissions: + contents: write + defaults: + run: + shell: bash + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + check-latest: true + cache: true + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + with: + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..a59950b --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,31 @@ +project_name: scram-sha-256 + +# https://goreleaser.com/customization/build/ +# https://go.dev/doc/install/source#environment +builds: + - env: + - CGO_ENABLED=0 + flags: + - -trimpath + ldflags: + - -s -w + goos: + - linux + - darwin + - windows + goarch: + - amd64 + - arm + - arm64 + # https://github.com/golang/go/wiki/GoArm + # https://www.cs.umd.edu/~meesh/cmsc411/website/proj01/arm/armchip.html + goarm: + - 6 + - 7 + +# https://goreleaser.com/customization/archive/ +archives: + - name_template: '{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}{{ with .Arm }}-v{{ . }}{{ end }}' + format: binary + replacements: + amd64: x86_64 From 8d461780e5c21ee071f196f074001b98633760d4 Mon Sep 17 00:00:00 2001 From: Taishi Kasuga Date: Thu, 14 Dec 2023 16:53:00 +0900 Subject: [PATCH 2/6] fix --- .goreleaser.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index a59950b..0f4d12e 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,4 +1,4 @@ -project_name: scram-sha-256 +project_name: fanlin # https://goreleaser.com/customization/build/ # https://go.dev/doc/install/source#environment From b0dddf0220796d3dd3751afa4c96f838428be8d4 Mon Sep 17 00:00:00 2001 From: Taishi Kasuga Date: Thu, 14 Dec 2023 18:18:47 +0900 Subject: [PATCH 3/6] Remove win, mac, and arm architectures --- .goreleaser.yaml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 0f4d12e..1fd8a0b 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -11,17 +11,8 @@ builds: - -s -w goos: - linux - - darwin - - windows goarch: - amd64 - - arm - - arm64 - # https://github.com/golang/go/wiki/GoArm - # https://www.cs.umd.edu/~meesh/cmsc411/website/proj01/arm/armchip.html - goarm: - - 6 - - 7 # https://goreleaser.com/customization/archive/ archives: From b31faafe3700e37f0a489c98a3587d25707dae5c Mon Sep 17 00:00:00 2001 From: Taishi Kasuga Date: Thu, 14 Dec 2023 20:31:35 +0900 Subject: [PATCH 4/6] Update .goreleaser.yaml --- .goreleaser.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 1fd8a0b..24d1b5f 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -4,7 +4,7 @@ project_name: fanlin # https://go.dev/doc/install/source#environment builds: - env: - - CGO_ENABLED=0 + - CGO_ENABLED=1 flags: - -trimpath ldflags: From 3aef0a9e48ec90ac7c1fa5f3a2d57004f8aa1fe4 Mon Sep 17 00:00:00 2001 From: Taishi Kasuga Date: Sat, 16 Dec 2023 09:57:52 +0900 Subject: [PATCH 5/6] Update .goreleaser.yaml --- .goreleaser.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 24d1b5f..04acf73 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -7,6 +7,7 @@ builds: - CGO_ENABLED=1 flags: - -trimpath + - -tags=timetzdata ldflags: - -s -w goos: From a8ae07676c9754fffac4b2bfb17c75e5165a842f Mon Sep 17 00:00:00 2001 From: Taishi Kasuga Date: Sat, 16 Dec 2023 10:00:06 +0900 Subject: [PATCH 6/6] Update .github/workflows/release.yaml --- .github/workflows/release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a2a6cdd..0d17575 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -8,8 +8,8 @@ on: - "v*" concurrency: ${{ github.workflow }} jobs: - release: - name: Release + executable-files: + name: Executable Files if: github.repository == 'livesense-inc/fanlin' timeout-minutes: 10 runs-on: ubuntu-latest