Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# SPDX-FileCopyrightText: 2026 SAP SE or an SAP affiliate company
#
# SPDX-License-Identifier: Apache-2.0

name: Release
"on":
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch: {}
permissions:
contents: write
jobs:
goreleaser:
name: GoReleaser
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
with:
check-latest: true
go-version: 1.26.2
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35 changes: 15 additions & 20 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,29 @@
version: 2

archives:
- name_template: '{{ .ProjectName }}-{{ replace .Version "v" "" }}-{{ .Os }}-{{ .Arch }}'
format_overrides:
- goos: windows
format: zip
files:
- CHANGELOG.md
- LICENSE
- README.md
- formats:
- binary
name_template: '{{ if eq .Os "darwin" }}hermescli_darwin{{ else }}hermescli{{ end }}'

checksum:
name_template: "checksums.txt"
disable: true

builds:
- binary: 'hermescli'
- id: hermescli
# Keep internal build artifact names distinct from the uploaded legacy names
# below, otherwise GoReleaser records duplicate artifact names.
binary: 'hermescli_{{ .Target }}'
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
ignore:
- goos: windows
goarch: arm64
targets:
- linux_amd64_v1
- windows_amd64_v1
- darwin_amd64_v1
flags:
- -mod=vendor
ldflags:
- -s -w
- -X github.com/sapcc/hermescli/client.Version={{ .Version }}
- -X github.com/sapcc/go-api-declarations/bininfo.binName=hermescli
- -X github.com/sapcc/go-api-declarations/bininfo.version={{ .Version }}
- -X github.com/sapcc/go-api-declarations/bininfo.commit={{ .FullCommit }}
Expand Down
Loading