Skip to content

Commit

Permalink
split sidecar to have it's own goreleaser.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
pjuarezd committed Jun 8, 2024
1 parent c6737b7 commit 4779948
Show file tree
Hide file tree
Showing 9 changed files with 22,338 additions and 122 deletions.
25 changes: 24 additions & 1 deletion .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- 'master'

jobs:
goreleaser:
goreleaser-operator:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
Expand All @@ -32,3 +32,26 @@ jobs:
with:
version: latest
args: release --skip=publish --clean --snapshot
goreleaser-operator-sidecar:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21.x
workdir: sidecar
- # Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
workdir: sidecar
args: release --skip=publish --clean --snapshot
2 changes: 1 addition & 1 deletion .github/workflows/kubernetes-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,11 @@ jobs:
- uses: actions/cache@v3
name: Operator Sidecar Binary Cache
with:
working-directory: ./sidecar
path: |
./minio-operator-sidecar
key: ${{ runner.os }}-sidecar-binary-${{ github.run_id }}
- name: Operator Binary
working-directory: ./sidecar
run: |
make sidecar
test-tenant:
Expand Down
117 changes: 0 additions & 117 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,6 @@ builds:
- -s -w -X github.com/minio/operator/pkg.ReleaseTag={{.Tag}} -X github.com/minio/operator/pkg.CommitID={{.FullCommit}} -X github.com/minio/operator/pkg.Version={{.Version}} -X github.com/minio/operator/pkg.ShortCommitID={{.ShortCommit}} -X github.com/minio/operator/pkg.ReleaseTime={{.Date}}
flags:
- -trimpath
- goos:
- linux
goarch:
- arm64
- amd64
- ppc64le
- s390x
env:
- CGO_ENABLED=0
id: minio-operator-sidecar
dir: sidecar/
binary: minio-operator-sidecar
main: ./cmd/sidecar/
ldflags:
- -s -w -X github.com/minio/operator/pkg.ReleaseTag={{.Tag}} -X github.com/minio/operator/pkg.CommitID={{.FullCommit}} -X github.com/minio/operator/sidecar/pkg.Version={{.Version}} -X github.com/minio/operator/sidecar/pkg.ShortCommitID={{.ShortCommit}} -X github.com/minio/operator/pkg.ReleaseTime={{.Date}}
flags:
- -trimpath

archives:
- allow_different_binary_count: true
Expand Down Expand Up @@ -146,94 +129,6 @@ dockers:
build_flag_templates:
- "--platform=linux/arm64"
- "--build-arg=TAG={{ .Tag }}"
- image_templates:
- "minio/operator-sidecar:{{ .Tag }}-amd64"
use: buildx
goarch: amd64
dockerfile: sidecar/Dockerfile
extra_files:
- LICENSE
- CREDITS
build_flag_templates:
- "--platform=linux/amd64"
- "--build-arg=TAG={{ .Tag }}"
- image_templates:
- "minio/operator-sidecar:{{ .Tag }}-ppc64le"
use: buildx
dockerfile: sidecar/Dockerfile
goarch: ppc64le
extra_files:
- LICENSE
- CREDITS
build_flag_templates:
- "--platform=linux/ppc64le"
- "--build-arg=TAG={{ .Tag }}"
- image_templates:
- "minio/operator-sidecar:{{ .Tag }}-s390x"
use: buildx
goarch: s390x
dockerfile: sidecar/Dockerfile
extra_files:
- LICENSE
- CREDITS
build_flag_templates:
- "--platform=linux/s390x"
- "--build-arg=TAG={{ .Tag }}"
- image_templates:
- "minio/operator-sidecar:{{ .Tag }}-arm64"
use: buildx
goarch: arm64
dockerfile: sidecar/Dockerfile
extra_files:
- LICENSE
- CREDITS
build_flag_templates:
- "--platform=linux/arm64"
- "--build-arg=TAG={{ .Tag }}"
- image_templates:
- "quay.io/minio/operator-sidecar:{{ .Tag }}-amd64"
use: buildx
goarch: amd64
dockerfile: sidecar/Dockerfile
extra_files:
- LICENSE
- CREDITS
build_flag_templates:
- "--platform=linux/amd64"
- "--build-arg=TAG={{ .Tag }}"
- image_templates:
- "quay.io/minio/operator-sidecar:{{ .Tag }}-ppc64le"
use: buildx
dockerfile: sidecar/Dockerfile
goarch: ppc64le
extra_files:
- LICENSE
- CREDITS
build_flag_templates:
- "--platform=linux/ppc64le"
- "--build-arg=TAG={{ .Tag }}"
- image_templates:
- "quay.io/minio/operator-sidecar:{{ .Tag }}-s390x"
use: buildx
goarch: s390x
dockerfile: sidecar/Dockerfile
extra_files:
- LICENSE
- CREDITS
build_flag_templates:
- "--platform=linux/s390x"
- "--build-arg=TAG={{ .Tag }}"
- image_templates:
- "quay.io/minio/operator-sidecar:{{ .Tag }}-arm64"
use: buildx
goarch: arm64
dockerfile: sidecar/Dockerfile
extra_files:
- LICENSE
- CREDITS
build_flag_templates:
- "--platform=linux/arm64"
- "--build-arg=TAG={{ .Tag }}"
docker_manifests:
- name_template: minio/operator:{{ .Tag }}
image_templates:
Expand All @@ -247,15 +142,3 @@ docker_manifests:
- quay.io/minio/operator:{{ .Tag }}-arm64
- quay.io/minio/operator:{{ .Tag }}-ppc64le
- quay.io/minio/operator:{{ .Tag }}-s390x
- name_template: minio/operator-sidecar:{{ .Tag }}
image_templates:
- minio/operator-sidecar:{{ .Tag }}-amd64
- minio/operator-sidecar:{{ .Tag }}-arm64
- minio/operator-sidecar:{{ .Tag }}-ppc64le
- minio/operator-sidecar:{{ .Tag }}-s390x
- name_template: quay.io/minio/operator-sidecar:{{ .Tag }}
image_templates:
- quay.io/minio/operator-sidecar:{{ .Tag }}-amd64
- quay.io/minio/operator-sidecar:{{ .Tag }}-arm64
- quay.io/minio/operator-sidecar:{{ .Tag }}-ppc64le
- quay.io/minio/operator-sidecar:{{ .Tag }}-s390x
143 changes: 143 additions & 0 deletions sidecar/.goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
project_name: operator-sidecar

release:
name_template: "Version {{.Version}}"
github:
owner: minio
name: operator
extra_files:
- glob: "*.minisig"
- glob: "*.zip"

before:
hooks:
- make clean
- go mod tidy -compat=1.21.8
- go mod download

builds:
- id: minio-operator-sidecar
goos:
- linux
goarch:
- arm64
- amd64
- ppc64le
- s390x
env:
- CGO_ENABLED=0
binary: minio-operator-sidecar
main: ./cmd/sidecar/
ldflags:
- -s -w -X github.com/minio/operator/pkg.ReleaseTag={{.Tag}} -X github.com/minio/operator/pkg.CommitID={{.FullCommit}} -X github.com/minio/operator/sidecar/pkg.Version={{.Version}} -X github.com/minio/operator/sidecar/pkg.ShortCommitID={{.ShortCommit}} -X github.com/minio/operator/pkg.ReleaseTime={{.Date}}
flags:
- -trimpath

archives:
- allow_different_binary_count: true
format: binary

dockers:
- image_templates:
- "minio/operator-sidecar:{{ .Tag }}-amd64"
use: buildx
goarch: amd64
dockerfile: Dockerfile
extra_files:
- LICENSE
- CREDITS
build_flag_templates:
- "--platform=linux/amd64"
- "--build-arg=TAG={{ .Tag }}"
- image_templates:
- "minio/operator-sidecar:{{ .Tag }}-ppc64le"
use: buildx
dockerfile: Dockerfile
goarch: ppc64le
extra_files:
- LICENSE
- CREDITS
build_flag_templates:
- "--platform=linux/ppc64le"
- "--build-arg=TAG={{ .Tag }}"
- image_templates:
- "minio/operator-sidecar:{{ .Tag }}-s390x"
use: buildx
goarch: s390x
dockerfile: Dockerfile
extra_files:
- LICENSE
- CREDITS
build_flag_templates:
- "--platform=linux/s390x"
- "--build-arg=TAG={{ .Tag }}"
- image_templates:
- "minio/operator-sidecar:{{ .Tag }}-arm64"
use: buildx
goarch: arm64
dockerfile: Dockerfile
extra_files:
- LICENSE
- CREDITS
build_flag_templates:
- "--platform=linux/arm64"
- "--build-arg=TAG={{ .Tag }}"
- image_templates:
- "quay.io/minio/operator-sidecar:{{ .Tag }}-amd64"
use: buildx
goarch: amd64
dockerfile: Dockerfile
extra_files:
- LICENSE
- CREDITS
build_flag_templates:
- "--platform=linux/amd64"
- "--build-arg=TAG={{ .Tag }}"
- image_templates:
- "quay.io/minio/operator-sidecar:{{ .Tag }}-ppc64le"
use: buildx
dockerfile: Dockerfile
goarch: ppc64le
extra_files:
- LICENSE
- CREDITS
build_flag_templates:
- "--platform=linux/ppc64le"
- "--build-arg=TAG={{ .Tag }}"
- image_templates:
- "quay.io/minio/operator-sidecar:{{ .Tag }}-s390x"
use: buildx
goarch: s390x
dockerfile: Dockerfile
extra_files:
- LICENSE
- CREDITS
build_flag_templates:
- "--platform=linux/s390x"
- "--build-arg=TAG={{ .Tag }}"
- image_templates:
- "quay.io/minio/operator-sidecar:{{ .Tag }}-arm64"
use: buildx
goarch: arm64
dockerfile: Dockerfile
extra_files:
- LICENSE
- CREDITS
build_flag_templates:
- "--platform=linux/arm64"
- "--build-arg=TAG={{ .Tag }}"
docker_manifests:
- name_template: minio/operator-sidecar:{{ .Tag }}
image_templates:
- minio/operator-sidecar:{{ .Tag }}-amd64
- minio/operator-sidecar:{{ .Tag }}-arm64
- minio/operator-sidecar:{{ .Tag }}-ppc64le
- minio/operator-sidecar:{{ .Tag }}-s390x
- name_template: quay.io/minio/operator-sidecar:{{ .Tag }}
image_templates:
- quay.io/minio/operator-sidecar:{{ .Tag }}-amd64
- quay.io/minio/operator-sidecar:{{ .Tag }}-arm64
- quay.io/minio/operator-sidecar:{{ .Tag }}-ppc64le
- quay.io/minio/operator-sidecar:{{ .Tag }}-s390x
Loading

0 comments on commit 4779948

Please sign in to comment.