Skip to content

Commit

Permalink
ci: goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-karan committed Jul 1, 2024
1 parent b2d58c7 commit cc7cf4f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 10 deletions.
32 changes: 26 additions & 6 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,11 @@ builds:
- linux
goarch:
- amd64
- arm64
goarm:
- 6
- 7
ldflags:
- -s -w -X "main.buildVersion={{ .Tag }} ({{ .ShortCommit }} {{ .Date }})"
main: ./web/
hooks:
pre: sh -c 'cd ./docs/ && yarn build'

archives:
- id: cli
Expand All @@ -67,6 +65,18 @@ archives:
- README.md
- LICENSE

- id: web
builds:
- web
wrap_in_directory: true
files:
- README.md
- LICENSE
- config-api-sample.toml
- src: "docs/dist/*"
dst: "docs"
name_template: "{{ .ProjectName }}_web_{{ .Version }}_{{ .Os }}_{{ .Arch }}"

changelog:
sort: asc
use: github
Expand All @@ -84,7 +94,6 @@ changelog:
- title: Others
order: 999


dockers:
- image_templates:
- "ghcr.io/mr-karan/doggo:{{ .Tag }}"
Expand All @@ -104,7 +113,6 @@ dockers:
- --label=org.opencontainers.image.created={{ .Date }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}


- image_templates:
- "ghcr.io/mr-karan/doggo:{{ .Tag }}-arm64v8"
- "ghcr.io/mr-karan/doggo:latest-arm64v8"
Expand All @@ -121,3 +129,15 @@ dockers:
- --label=org.opencontainers.image.version=v{{ .Version }}
- --label=org.opencontainers.image.created={{ .Date }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}

- image_templates:
- "ghcr.io/mr-karan/doggo-web:{{ .Tag }}"
- "ghcr.io/mr-karan/doggo-web:latest"
ids:
- web
goarch: amd64
dockerfile: web.Dockerfile
use: buildx
extra_files:
- config-api-sample.toml
- docs/dist/
9 changes: 5 additions & 4 deletions web.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Dockerfile
ARG ARCH
FROM ${ARCH}/alpine
FROM ubuntu:24.04
WORKDIR /app
COPY doggo-api.bin .
RUN ls -alht
COPY doggo-web.bin .
COPY config-api-sample.toml config.toml
CMD ["./doggo-api.bin"]
COPY docs/dist /app/dist/
CMD ["./doggo-web.bin"]

0 comments on commit cc7cf4f

Please sign in to comment.