Skip to content

Commit

Permalink
ci: update CI
Browse files Browse the repository at this point in the history
Signed-off-by: Ardika Bagus <[email protected]>
  • Loading branch information
ardikabs committed Nov 3, 2023
1 parent 7e9f8f6 commit 7e7535d
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 35 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:

release:
runs-on: ubuntu-latest
needs:
- test
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -34,10 +36,6 @@ jobs:

- uses: docker/setup-qemu-action@v2

- uses: docker/setup-buildx-action@v2
with:
endpoint: builders

- name: Log in to the GitHub Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
Expand All @@ -53,4 +51,3 @@ jobs:
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_VERSION: ${{ steps.tag.outputs.tag }}
3 changes: 3 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches:
- main
paths:
- "**/*.go"

pull_request:
branches:
- main
Expand Down
74 changes: 44 additions & 30 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ before:
- go mod tidy

builds:
- binary: helmize
- binary: "{{ .ProjectName }}"
env:
- CGO_ENABLED=0
goos:
Expand All @@ -18,8 +18,8 @@ builds:
- "6"
- "7"
ldflags:
- -X github.com/ardikabs/helmize/cmd.Version={{.Version}}
- -X github.com/ardikabs/helmize/cmd.GitCommit={{.Commit}}
- -X github.com/ardikabs/{{ .ProjectName }}/cmd.Version={{.Version}}
- -X github.com/ardikabs/{{ .ProjectName }}/cmd.GitCommit={{.Commit}}
ignore:
- goos: windows
goarch: arm64
Expand All @@ -39,50 +39,64 @@ checksum:
release:
github:
owner: ardikabs
name: helmize
name: "{{ .ProjectName }}"
name_template: "Version {{.Version}}"

dockers:
- goos: linux
goarch: amd64
use: buildx
dockerfile: .goreleaser.Dockerfile
dockerfile: Dockerfile.goreleaser
image_templates:
- "ghcr.io/ardikabs/helmize:latest-amd64"
- "ghcr.io/ardikabs/helmize:{{ .Major }}-amd64"
- "ghcr.io/ardikabs/helmize:{{ .Major }}.{{ .Minor }}-amd64"
- "ghcr.io/ardikabs/helmize:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-amd64"
- "ghcr.io/ardikabs/{{ .ProjectName }}:latest-amd64"
- "ghcr.io/ardikabs/{{ .ProjectName }}:{{ .Major }}-amd64"
- "ghcr.io/ardikabs/{{ .ProjectName }}:{{ .Major }}.{{ .Minor }}-amd64"
- "ghcr.io/ardikabs/{{ .ProjectName }}:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-amd64"
build_flag_templates:
- "--builder=builders"
- "--platform=linux/amd64"
- --platform=linux/amd64
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.url=https://github.com/ardikabs/{{ .ProjectName }}
- --label=org.opencontainers.image.source=https://github.com/ardikabs/{{ .ProjectName }}
- --label=org.opencontainers.image.version={{ .Version }}
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.licenses=MIT

- goos: linux
goarch: arm64
use: buildx
dockerfile: .goreleaser.Dockerfile
dockerfile: Dockerfile.goreleaser
image_templates:
- "ghcr.io/ardikabs/helmize:latest-amd64"
- "ghcr.io/ardikabs/helmize:{{ .Major }}-amd64"
- "ghcr.io/ardikabs/helmize:{{ .Major }}.{{ .Minor }}-amd64"
- "ghcr.io/ardikabs/helmize:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-amd64"
- "ghcr.io/ardikabs/{{ .ProjectName }}:latest-amd64"
- "ghcr.io/ardikabs/{{ .ProjectName }}:{{ .Major }}-amd64"
- "ghcr.io/ardikabs/{{ .ProjectName }}:{{ .Major }}.{{ .Minor }}-amd64"
- "ghcr.io/ardikabs/{{ .ProjectName }}:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-amd64"
build_flag_templates:
- "--builder=builders"
- "--platform=linux/arm64"
- --platform=linux/arm64
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.url=https://github.com/ardikabs/{{ .ProjectName }}
- --label=org.opencontainers.image.source=https://github.com/ardikabs/{{ .ProjectName }}
- --label=org.opencontainers.image.version={{ .Version }}
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.licenses=MIT

docker_manifests:
- name_template: ghcr.io/ardikabs/helmize:latest
- name_template: ghcr.io/ardikabs/{{ .ProjectName }}:latest
image_templates:
- ghcr.io/ardikabs/helmize:latest-amd64
- ghcr.io/ardikabs/helmize:latest-arm64
- name_template: ghcr.io/ardikabs/helmize:v{{ .Major }}
- ghcr.io/ardikabs/{{ .ProjectName }}:latest-amd64
- ghcr.io/ardikabs/{{ .ProjectName }}:latest-arm64
- name_template: ghcr.io/ardikabs/{{ .ProjectName }}:v{{ .Major }}
image_templates:
- ghcr.io/ardikabs/helmize:{{ .Major }}-amd64
- ghcr.io/ardikabs/helmize:{{ .Major }}-arm64
- name_template: ghcr.io/ardikabs/helmize:v{{ .Major }}.{{ .Minor }}
- ghcr.io/ardikabs/{{ .ProjectName }}:{{ .Major }}-amd64
- ghcr.io/ardikabs/{{ .ProjectName }}:{{ .Major }}-arm64
- name_template: ghcr.io/ardikabs/{{ .ProjectName }}:v{{ .Major }}.{{ .Minor }}
image_templates:
- ghcr.io/ardikabs/helmize:{{ .Major }}.{{ .Minor }}-amd64
- ghcr.io/ardikabs/helmize:{{ .Major }}.{{ .Minor }}-arm64
- name_template: ghcr.io/ardikabs/helmize:v{{ .Major }}.{{ .Minor }}.{{ .Patch }}
- ghcr.io/ardikabs/{{ .ProjectName }}:{{ .Major }}.{{ .Minor }}-amd64
- ghcr.io/ardikabs/{{ .ProjectName }}:{{ .Major }}.{{ .Minor }}-arm64
- name_template: ghcr.io/ardikabs/{{ .ProjectName }}:v{{ .Major }}.{{ .Minor }}.{{ .Patch }}
image_templates:
- ghcr.io/ardikabs/helmize:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-amd64
- ghcr.io/ardikabs/helmize:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-arm64
- ghcr.io/ardikabs/{{ .ProjectName }}:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-amd64
- ghcr.io/ardikabs/{{ .ProjectName }}:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-arm64

0 comments on commit 7e7535d

Please sign in to comment.