Skip to content

Commit

Permalink
chore: release using goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
Demonsthere committed Oct 25, 2024
1 parent aea074d commit a3a1488
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 14 deletions.
1 change: 0 additions & 1 deletion .github/actions/build-and-scan/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ runs:
tags: ${{ inputs.tags }}
labels: ${{ inputs.labels }}
load: true
platforms: linux/amd64,linux/arm64,darwin

- name: Anchore Scanner
uses: anchore/scan-action@v5
Expand Down
30 changes: 17 additions & 13 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,24 @@ jobs:
with:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Login to DockerHub
if: github.event_name != 'pull_request'
release:
if: github.ref_type == 'tag'
needs:
- docker
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: arekkas
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKER_SECRET_AREKKAS }}

- name: Push
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v5
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
context: ./docker
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64,darwin
distribution: goreleaser
version: latest
args: release --clean
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
46 changes: 46 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
project_name: k8s-toolbox
version: 2

snapshot:
version_template: "{{ .Tag }}-next"

# changelog:
# sort: asc
# use: github-native

builds:
- skip: true

dockers:
- image_templates:
- "oryd/{{ .ProjectName }}:{{ .Tag }}-amd64"
- "oryd/{{ .ProjectName }}:{{ .ShortCommit }}-amd64"
goarch: amd64
build_flag_templates:
- "--platform=linux/amd64"
dockerfile: "docker/Dockerfile"
- image_templates:
- "oryd/{{ .ProjectName }}:{{ .Tag }}-arm64"
- "oryd/{{ .ProjectName }}:{{ .ShortCommit }}-arm64"
goarch: arm64
build_flag_templates:
- "--platform=linux/arm64"
dockerfile: "docker/Dockerfile"

docker_manifests:
- name_template: "oryd/{{ .ProjectName }}:{{ .Tag }}"
id: "tag"
image_templates:
- "oryd/{{ .ProjectName }}:{{ .Tag }}-amd64"
- "oryd/{{ .ProjectName }}:{{ .Tag }}-arm64"
- name_template: "oryd/{{ .ProjectName }}:latest"
id: "latest"
image_templates:
- "oryd/{{ .ProjectName }}:{{ .Tag }}-amd64"
- "oryd/{{ .ProjectName }}:{{ .Tag }}-arm64"

release:
prerelease: auto
name_template: "{{ .Tag }}"

0 comments on commit a3a1488

Please sign in to comment.