Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Commit

Permalink
chore: Update goreleaser config (#28)
Browse files Browse the repository at this point in the history
* Remove server binary build
* Publish zip archives for brew
* Build and publish docker images for the server
  • Loading branch information
amalshaji authored Feb 24, 2023
1 parent 3162245 commit 0baa26b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 18 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@ jobs:
npm i -g pnpm
pnpm install --dir internal/server/web --frozen-lockfile && pnpm run --dir internal/server/web build
# More assembly might be required: Docker logins, GPG, etc. It all depends
# on your needs.
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: amalshaji
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Publish packages
uses: goreleaser/goreleaser-action@v4
with:
Expand Down
51 changes: 35 additions & 16 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,8 @@ builds:
ldflags:
- -s -w -X main.build={{.Version}}

- id: "beaver_server"
main: ./cmd/beaver_server
binary: "beaver_server"
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
ldflags:
- -s -w -X main.build={{.Version}}

archives:
- format: binary
# this name template makes the OS and Arch compatible with the results of uname.
name_template: >-
{{ .Binary }}_
{{- .Version }}_
Expand All @@ -40,19 +24,34 @@ archives:
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
- format: zip
name_template: >-
{{ .Binary }}_
{{- .Version }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
checksum:
name_template: "checksums.txt"

snapshot:
name_template: "{{ incpatch .Version }}-next"

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"

release:
name_template: "v{{ .Version }}"
draft: true

brews:
- name: beaver
ids:
Expand All @@ -64,3 +63,23 @@ brews:
commit_author:
name: Amal Shaji
email: [email protected]

dockers:
- image_templates:
- "amalshaji/beaver:{{ .Version }}-amd64"
use: buildx
dockerfile: deployments/Dockerfile
build_flag_templates:
- "--platform=linux/amd64"
- image_templates:
- "amalshaji/beaver:{{ .Version }}-arm64"
use: buildx
goarch: arm64
dockerfile: deployments/Dockerfile
build_flag_templates:
- "--platform=linux/arm64"
docker_manifests:
- name_template: "amalshaji/beaver:{{ .Version }}"
image_templates:
- "amalshaji/beaver:{{ .Version }}-amd64"
- "amalshaji/beaver:{{ .Version }}-arm64"

0 comments on commit 0baa26b

Please sign in to comment.