From 82a5c3a214c05decaaadf6909f7c53352d7b5f88 Mon Sep 17 00:00:00 2001 From: sapcc-bot Date: Wed, 11 Oct 2023 14:23:47 +0000 Subject: [PATCH] Run go-makefile-maker --- .github/workflows/goreleaser.yaml | 38 +++++++++++++++++++++++++++++ .goreleaser.yml => .goreleaser.yaml | 24 ++++++++++++------ 2 files changed, 54 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/goreleaser.yaml rename .goreleaser.yml => .goreleaser.yaml (78%) diff --git a/.github/workflows/goreleaser.yaml b/.github/workflows/goreleaser.yaml new file mode 100644 index 00000000..8fd39d39 --- /dev/null +++ b/.github/workflows/goreleaser.yaml @@ -0,0 +1,38 @@ +################################################################################ +# This file is AUTOGENERATED with # +# Edit Makefile.maker.yaml instead. # +################################################################################ + +name: goreleaser +"on": + push: + tags: + - v[0-9]+.[0-9]+.[0-9]+ +permissions: + contents: read + packages: write +jobs: + release: + name: goreleaser + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v4 + with: + check-latest: true + go-version: "1.21" + - name: Generate release info + run: | + go install github.com/sapcc/go-bits/tools/release-info@latest + release-info CHANGELOG.md $(shell git describe --tags --abbrev=0) > build/release-info + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + with: + args: release --clean --release-notes=./build/release-info + version: latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yaml similarity index 78% rename from .goreleaser.yml rename to .goreleaser.yaml index 48bacc6b..c80a7119 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yaml @@ -1,3 +1,7 @@ +before: + hooks: + - go mod tidy + builds: - env: - CGO_ENABLED=0 @@ -7,24 +11,28 @@ builds: - darwin goarch: - amd64 + - arm64 ldflags: - -s -w - -X github.com/sapcc/go-api-declarations/bininfo.binName=ntp_exporter - -X github.com/sapcc/go-api-declarations/bininfo.version={{ .Version }} - -X github.com/sapcc/go-api-declarations/bininfo.commit={{ .FullCommit }} - # Use CommitDate instead of Date for reproducibility. - - -X github.com/sapcc/go-api-declarations/bininfo.buildDate={{ .CommitDate }} + - -X github.com/sapcc/go-api-declarations/bininfo.buildDate={{ .CommitDate }} # use CommitDate instead of Date for reproducibility # Set the modified timestamp on the output binary to ensure that builds are reproducible. mod_timestamp: "{{ .CommitTimestamp }}" +snapshot: + name_template: "{{ .Tag }}-next" + +checksum: + name_template: "checksums.txt" + archives: - name_template: '{{ .ProjectName }}-{{ replace .Version "v" "" }}-{{ .Os }}-{{ .Arch }}' format_overrides: - goos: windows format: zip - -checksum: - name_template: 'checksums.txt' - -snapshot: - name_template: "{{ .Tag }}-next" + files: + - CHANGELOG.md + - LICENSE + - README.md