From 5462887d6bf16c967c39555716ad453bdcab446c Mon Sep 17 00:00:00 2001 From: Victor Conner Date: Fri, 28 Jun 2024 07:39:00 +0200 Subject: [PATCH] Add goreleaser --- .gitignore | 1 + .goreleaser.yaml | 38 ++++++++++++++++++++++++++++++-------- README.md | 2 +- 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 472c13c..8b4421c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ *.so *.dylib bin +dist # environment variables .envrc diff --git a/.goreleaser.yaml b/.goreleaser.yaml index aec19f0..e041276 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,8 +1,10 @@ before: hooks: - go mod tidy + builds: - - main: ./cmd/server + - id: server + main: ./cmd/server binary: server env: - CGO_ENABLED=0 @@ -13,10 +15,9 @@ builds: - arm64 - amd64 - 386 - output: - dir: dist/{{ .Os }}/{{ .Arch }} - - main: ./cmd/client + - id: client + main: ./cmd/client binary: client env: - CGO_ENABLED=0 @@ -24,24 +25,45 @@ builds: - linux - darwin goarch: + - arm64 - amd64 - 386 - output: - dir: dist/{{ .Os }}/{{ .Arch }} archives: - - format: tar.gz + - id: server_archive + builds: + - server + format: tar.gz + name_template: >- + server_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + files: + - server + + - id: client_archive + builds: + - client + format: tar.gz name_template: >- - {{ .ProjectName }}_ + client_ {{- title .Os }}_ {{- if eq .Arch "amd64" }}x86_64 {{- else if eq .Arch "386" }}i386 {{- else }}{{ .Arch }}{{ end }} {{- if .Arm }}v{{ .Arm }}{{ end }} + files: + - client + checksum: name_template: 'checksums.txt' + snapshot: name_template: "{{ incpatch .Version }}-next" + changelog: sort: asc filters: diff --git a/README.md b/README.md index e3b7efa..e9d8e37 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ first. # Running this project ## 1. Download the binaries -Download and unpack the server and client binaries from the [releases](https://github.com/creativecreature/sturdyc/releases). +Download and unpack the server **and** client binaries from the [releases](https://github.com/creativecreature/sturdyc/releases). Next, you'll want to make sure that they are reachable from your `$PATH`. ## 2. Create a configuration file