Skip to content

Commit

Permalink
ci(goreleaser): configure goreleaser for automated releases
Browse files Browse the repository at this point in the history
  • Loading branch information
fyvri committed Dec 28, 2024
1 parent 3cde438 commit caa5d23
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.git
vendor
10 changes: 10 additions & 0 deletions deployments/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM alpine:latest

# Set the working directory
WORKDIR /app

# Copy compiled binary into the container
COPY fresh-proxy-list /app/fresh-proxy-list

# Set default command to run application
ENTRYPOINT ["/app/fresh-proxy-list"]
73 changes: 73 additions & 0 deletions deployments/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
version: 2
project_name: fresh-proxy-list
env:
- GO111MODULE=on

builds:
- env:
- CGO_ENABLED=0

main: ./cmd/main.go
flags: -trimpath
ldflags:
- -s -w
- -extldflags=-static
mod_timestamp: "{{ .CommitTimestamp }}"
goos:
- linux
- windows
- darwin
goarch:
- arm
- arm64
- amd64

checksum:
name_template: "{{ .ProjectName }}_checksums.txt"

archives:
- name_template: "{{ .ProjectName }}-{{ .Env.TAG_VERSION }}-{{ .Os }}-{{ .Arch }}"
format_overrides:
- goos: windows
format: zip
files:
- README*.md
- LICENSE

dockers:
- image_templates:
- "ghcr.io/{{ .Env.DOCKER_USERNAME }}/{{ .Env.DOCKER_REPOSITORY }}:{{ .Env.TAG_VERSION }}-amd64"
use: buildx
dockerfile: ./deployments/Dockerfile
build_flag_templates:
- "--platform=linux/amd64"
- image_templates:
- "ghcr.io/{{ .Env.DOCKER_USERNAME }}/{{ .Env.DOCKER_REPOSITORY }}:{{ .Env.TAG_VERSION }}-arm64"
- "ghcr.io/{{ .Env.DOCKER_USERNAME }}/{{ .Env.DOCKER_REPOSITORY }}:latest"
use: buildx
dockerfile: ./deployments/Dockerfile
goarch: arm64
build_flag_templates:
- --platform=linux/arm64/v8

docker_manifests:
- name_template: "ghcr.io/{{ .Env.DOCKER_USERNAME }}/{{ .Env.DOCKER_REPOSITORY }}:{{ .Env.TAG_VERSION }}"
image_templates:
- "ghcr.io/{{ .Env.DOCKER_USERNAME }}/{{ .Env.DOCKER_REPOSITORY }}:{{ .Env.TAG_VERSION }}-amd64"
- "ghcr.io/{{ .Env.DOCKER_USERNAME }}/{{ .Env.DOCKER_REPOSITORY }}:{{ .Env.TAG_VERSION }}-arm64"
- name_template: "ghcr.io/{{ .Env.DOCKER_USERNAME }}/{{ .Env.DOCKER_REPOSITORY }}:latest"
image_templates:
- "ghcr.io/{{ .Env.DOCKER_USERNAME }}/{{ .Env.DOCKER_REPOSITORY }}:{{ .Env.TAG_VERSION }}-amd64"
- "ghcr.io/{{ .Env.DOCKER_USERNAME }}/{{ .Env.DOCKER_REPOSITORY }}:{{ .Env.TAG_VERSION }}-arm64"

changelog:
sort: asc
filters:
exclude:
- "^docs"
- "^test"
- "^ci"
- "^README"
- "^Update"
- Merge pull request
- Merge branch

0 comments on commit caa5d23

Please sign in to comment.