From 23e2e8a7f47643c4c786f40f5d8502dab7c34a2d Mon Sep 17 00:00:00 2001 From: Akkuman Date: Tue, 23 Jan 2024 16:37:04 +0800 Subject: [PATCH] fix: update goreleaser.yml --- .github/workflows/release.yml | 3 ++- .goreleaser.yml | 45 +++++++++++++++++++++----------- cmd/rotateproxy/.goreleaser.yaml | 31 ---------------------- 3 files changed, 32 insertions(+), 47 deletions(-) delete mode 100644 cmd/rotateproxy/.goreleaser.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7d27c12..41ed4d8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,12 +16,13 @@ jobs: uses: actions/setup-go@v4 with: go-version: 1.17 + cache: true - name: Run GoReleaser uses: goreleaser/goreleaser-action@v5 with: + distribution: goreleaser version: latest args: release --clean - workdir: cmd/rotateproxy env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml index c1e642f..b5ff210 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,19 +1,34 @@ +before: + hooks: + - go mod tidy builds: - - skip: true +- env: [CGO_ENABLED=0] + goos: + - linux + - windows + - darwin + - freebsd + goarch: + - amd64 + - arm64 + dir: . + main: ./cmd/rotateproxy + flags: + # trims path + - -trimpath + ldflags: + # use commit date instead of current date as main.date + # only needed if you actually use those things in your main package, otherwise can be ignored. + - -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} checksum: name_template: 'checksums.txt' +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' release: - # Same as for github - # Note: it can only be one: either github, gitlab or gitea - github: - owner: akkuman - name: rotateproxy - - draft: false - - # You can add extra pre-existing files to the release. - # The filename on the release will be the last part of the path (base). If - # another file with the same name exists, the latest one found will be used. - # Defaults to empty. - extra_files: - - glob: ./build/* \ No newline at end of file + name_template: 'v{{ .Version }}' +archives: + - format: zip \ No newline at end of file diff --git a/cmd/rotateproxy/.goreleaser.yaml b/cmd/rotateproxy/.goreleaser.yaml deleted file mode 100644 index 3df6746..0000000 --- a/cmd/rotateproxy/.goreleaser.yaml +++ /dev/null @@ -1,31 +0,0 @@ -before: - hooks: - - go mod tidy - - go generate ./... -builds: - - env: - - CGO_ENABLED=0 - goos: - - darwin - - linux - - freebsd - - windows - goarch: - - amd64 - - arm64 - -archives: - - replacements: - darwin: macOS - format: zip - -checksum: - name_template: 'checksums.txt' -snapshot: - name_template: "{{ .Tag }}-next" -changelog: - sort: asc - filters: - exclude: - - '^docs:' - - '^test:' \ No newline at end of file