Skip to content

Commit

Permalink
fix(ci): fix goreleaser config
Browse files Browse the repository at this point in the history
  • Loading branch information
moleus committed Aug 30, 2024
1 parent a0456d7 commit c6fefa0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
1 change: 0 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ jobs:
push_dockerhub:
name: Push to DockerHub
runs-on: ubuntu-latest
needs: build_image
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
tag:
name: Tag
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag_version.outputs.tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -51,5 +53,22 @@ jobs:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish_dockerhub:
name: Publish DockerHub
runs-on: ubuntu-latest
needs: tag
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1

- uses: ko-build/setup-ko@v0.6
env:
KO_DOCKER_REPO: ${{ secrets.DOCKERHUB_USERNAME }}/domru

- env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
run: |
echo ${DOCKERHUB_TOKEN} | ko login --username=${DOCKERHUB_USERNAME} --password-stdin index.docker.io
ko build --bare -t ${{ needs.tag.outputs.tag }}
14 changes: 4 additions & 10 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ before:

builds:
- binary: domru
id: main-build
goos:
- linux
- darwin
Expand All @@ -13,17 +14,10 @@ builds:

kos:
- repository: ghcr.io/moleus/domru
id: "github"
build: "main-build"
main: .
tags:
- '{{.Version}}'
bare: true
preserve_import_paths: false
platforms:
- "linux/amd64"
- "linux/arm64"
- "linux/arm/v7"
- repository: moleus/domru
main: .
base_image: "gcr.io/distroless/static-debian12"
tags:
- '{{.Version}}'
bare: true
Expand Down

0 comments on commit c6fefa0

Please sign in to comment.