Skip to content

Commit

Permalink
chore: update ci to not build container images with goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
rayanebel committed Jan 8, 2025
1 parent ec783fe commit 57781a1
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 59 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:
contents: read

jobs:
golangci:
codebase:
name: lint
runs-on: ubuntu-latest
steps:
Expand All @@ -24,7 +24,8 @@ jobs:
uses: golangci/golangci-lint-action@v6
with:
version: v1.60
helm-lint:
helm-chart:
if: false
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
45 changes: 34 additions & 11 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,14 @@ env:
REGISTRY: oci://ghcr.io/kilnfi/charts

jobs:
goreleaser:
binaries:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Go
uses: actions/setup-go@v5
with:
Expand All @@ -44,9 +36,40 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

helm-release:
images:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v6
name: Build & Push Container Images
with:
context: .
file: Dockerfile
labels: |-
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.name=cardano-validator-watcher"
org.opencontainers.image.version=${{ github.ref_name }}"
[email protected]"
platforms: linux/amd64,linux/arm64
push: true
tags: |-
ghcr.io/${{ github.repository_owner }}/cardano-validator-watcher:${{ github.ref_name }}
ghcr.io/${{ github.repository_owner }}/cardano-validator-watcher:latest
helm-chart:
if: false
needs: images
runs-on: ubuntu-latest
needs: goreleaser
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ testbin/
# Others
**/.DS_Store
*.db*

.codegpt
45 changes: 0 additions & 45 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ project_name: cardano-validator-watcher
before:
hooks:
- go mod tidy

builds:
- id: cardano-validator-watcher
main: cmd/watcher/main.go
Expand All @@ -12,54 +11,10 @@ builds:
goos:
- linux
- darwin

archives:
- format: tar.gz
name_template: '{{ .Binary }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}'
files:
- none*

dockers:
- image_templates:
- 'ghcr.io/kilnfi/cardano-validator-watcher:{{ .Tag }}-amd64'
dockerfile: Dockerfile
use: buildx
goos: linux
goarch: amd64
build_flag_templates:
- "--pull"
- "--build-arg=ARCH=linux/amd64"
- "--platform=linux/amd64"
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.name={{ .ProjectName }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.version={{ .Version }}"
- "--label=org.opencontainers.image.source={{ .GitURL }}"
- "[email protected]"
- image_templates:
- 'ghcr.io/kilnfi/cardano-validator-watcher:{{ .Tag }}-arm64'
dockerfile: Dockerfile
use: buildx
goos: linux
goarch: arm64
build_flag_templates:
- "--pull"
- "--build-arg=ARCH=linux/arm64"
- "--platform=linux/arm64"
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.name={{ .ProjectName }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.version={{ .Version }}"
- "--label=org.opencontainers.image.source={{ .GitURL }}"
- "[email protected]"
docker_manifests:
- name_template: 'ghcr.io/kilnfi/cardano-validator-watcher:{{ .Tag }}'
image_templates:
- 'ghcr.io/kilnfi/cardano-validator-watcher:{{ .Tag }}-amd64'
- 'ghcr.io/kilnfi/cardano-validator-watcher:{{ .Tag }}-arm64'
- name_template: 'ghcr.io/kilnfi/cardano-validator-watcher:latest'
image_templates:
- 'ghcr.io/kilnfi/cardano-validator-watcher:{{ .Tag }}-amd64'
- 'ghcr.io/kilnfi/cardano-validator-watcher:{{ .Tag }}-arm64'
changelog:
disable: true
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ RUN apk --no-cache add ca-certificates curl sqlite \
COPY --from=builder /usr/local/bin/cardano-validator-watcher .
COPY --from=builder /workspace/bin /usr/local/bin

ENTRYPOINT ["/home/cardano/cardano-validator-watcher"]
ENTRYPOINT ["./cardano-validator-watcher"]

0 comments on commit 57781a1

Please sign in to comment.