Skip to content

Commit

Permalink
Add target_commitish to goreleaser spec
Browse files Browse the repository at this point in the history
This prevents an issue during release that causes github to create a tag
on master instead of on the branch from which the release was created by
goreleaser.

Also update goreleaser action to v6
  • Loading branch information
donatello committed Sep 14, 2024
1 parent 35920ae commit 8fb83c9
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 65 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Build

on:
push:
branches: [ master, devel ]
branches: [master, v4.0]

pull_request:
branches: [ master, devel ]
branches: [master, v4.0]

# This ensures that previous jobs for the PR are canceled when the PR is
# updated.
Expand Down Expand Up @@ -35,7 +35,6 @@ jobs:
go test -v ./...
- uses: docker/setup-qemu-action@v3
- name: Check Goreleaser
uses: goreleaser/goreleaser-action@v5
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --skip-publish --skip-sign --clean --snapshot
args: release --skip=publish,sign --clean --snapshot
121 changes: 61 additions & 60 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
---
version: 2
project_name: directpv

release:
name_template: "Release version {{.Version}}"
name_template: "Release version {{.Version}}"

github:
target_commitish: "{{ .Commit }}"

github:
owner: minio
name: directpv

extra_files:
- glob: "*.minisig"
- glob: "*.zip"
extra_files:
- glob: "*.minisig"
- glob: "*.zip"

before:
hooks:
- go mod tidy -compat=1.22
- go mod download

builds:
-
main: ./cmd/directpv
- main: ./cmd/directpv
id: directpv
binary: directpv
goos:
Expand All @@ -35,8 +38,7 @@ builds:
ldflags:
- -s -w -X main.Version={{ .Tag }}

-
main: ./cmd/kubectl-directpv
- main: ./cmd/kubectl-directpv
id: kubectl-directpv
binary: kubectl-directpv
goos:
Expand All @@ -61,61 +63,60 @@ builds:
post: ./package.sh {{ .Path }}

archives:
-
allow_different_binary_count: true
- allow_different_binary_count: true
format: binary

changelog:
sort: asc

dockers:
- image_templates:
- "quay.io/minio/directpv:{{ .Tag }}-amd64"
use: buildx
goarch: amd64
ids:
- directpv
dockerfile: Dockerfile
extra_files:
- LICENSE
- CREDITS
- AlmaLinux.repo
build_flag_templates:
- "--platform=linux/amd64"
- image_templates:
- "quay.io/minio/directpv:{{ .Tag }}-ppc64le"
use: buildx
goarch: ppc64le
ids:
- directpv
dockerfile: Dockerfile
extra_files:
- LICENSE
- CREDITS
- AlmaLinux.repo
build_flag_templates:
- "--platform=linux/ppc64le"
- image_templates:
- "quay.io/minio/directpv:{{ .Tag }}-arm64"
use: buildx
goarch: arm64
ids:
- directpv
dockerfile: Dockerfile
extra_files:
- LICENSE
- CREDITS
- AlmaLinux.repo
build_flag_templates:
- "--platform=linux/arm64"
- image_templates:
- "quay.io/minio/directpv:{{ .Tag }}-amd64"
use: buildx
goarch: amd64
ids:
- directpv
dockerfile: Dockerfile
extra_files:
- LICENSE
- CREDITS
- AlmaLinux.repo
build_flag_templates:
- "--platform=linux/amd64"
- image_templates:
- "quay.io/minio/directpv:{{ .Tag }}-ppc64le"
use: buildx
goarch: ppc64le
ids:
- directpv
dockerfile: Dockerfile
extra_files:
- LICENSE
- CREDITS
- AlmaLinux.repo
build_flag_templates:
- "--platform=linux/ppc64le"
- image_templates:
- "quay.io/minio/directpv:{{ .Tag }}-arm64"
use: buildx
goarch: arm64
ids:
- directpv
dockerfile: Dockerfile
extra_files:
- LICENSE
- CREDITS
- AlmaLinux.repo
build_flag_templates:
- "--platform=linux/arm64"
docker_manifests:
- name_template: quay.io/minio/directpv:{{ .Tag }}
image_templates:
- quay.io/minio/directpv:{{ .Tag }}-amd64
- quay.io/minio/directpv:{{ .Tag }}-arm64
- quay.io/minio/directpv:{{ .Tag }}-ppc64le
- name_template: quay.io/minio/directpv:latest
image_templates:
- quay.io/minio/directpv:{{ .Tag }}-amd64
- quay.io/minio/directpv:{{ .Tag }}-arm64
- quay.io/minio/directpv:{{ .Tag }}-ppc64le
- name_template: quay.io/minio/directpv:{{ .Tag }}
image_templates:
- quay.io/minio/directpv:{{ .Tag }}-amd64
- quay.io/minio/directpv:{{ .Tag }}-arm64
- quay.io/minio/directpv:{{ .Tag }}-ppc64le
- name_template: quay.io/minio/directpv:latest
image_templates:
- quay.io/minio/directpv:{{ .Tag }}-amd64
- quay.io/minio/directpv:{{ .Tag }}-arm64
- quay.io/minio/directpv:{{ .Tag }}-ppc64le

0 comments on commit 8fb83c9

Please sign in to comment.