From df5330773f80f69f1a091e32748704dae4c4f0f1 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Thu, 15 May 2025 20:50:54 +0200 Subject: [PATCH] also generate zip files for windows --- .goreleaser.yml | 47 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index f9d70aa..679be27 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -21,28 +21,27 @@ before: # build a single binary builds: - - # make sure everything is statically linked by disabling cgo altogether - env: + - id: default + # make sure everything is statically linked by disabling cgo altogether + env: &build_env - CGO_ENABLED=0 # set the package for the main binary main: ./cmd/rest-server flags: - # don't include any paths to source files in the resulting binary + &build_flags # don't include any paths to source files in the resulting binary - -trimpath mod_timestamp: "{{ .CommitTimestamp }}" - ldflags: - # set the version variable in the main package + ldflags: &build_ldflags # set the version variable in the main package - "-s -w -X main.version={{ .Version }}" # list all operating systems and architectures we build binaries for goos: - linux - darwin - - windows - freebsd - netbsd - openbsd @@ -51,7 +50,7 @@ builds: goarch: - amd64 - - 386 + - "386" - arm - arm64 - mips @@ -60,12 +59,29 @@ builds: - ppc64 - ppc64le goarm: - - 6 - - 7 + - "6" + - "7" + + - id: windows-only + env: *build_env + main: ./cmd/rest-server + flags: *build_flags + mod_timestamp: "{{ .CommitTimestamp }}" + ldflags: *build_ldflags + goos: + - windows + goarch: + - amd64 + - "386" + - arm + - arm64 # configure the resulting archives to create archives: - - # package a directory which contains the source file + - id: default + builds: [default, windows-only] + format: tar.gz + # package a directory which contains the source file wrap_in_directory: true builds_info: &archive_file_info @@ -75,7 +91,7 @@ archives: mode: 0644 # add these files to all archives - files: + files: &archive_files - src: LICENSE dst: LICENSE info: *archive_file_info @@ -86,6 +102,13 @@ archives: dst: CHANGELOG.md info: *archive_file_info + - id: windows-only + builds: [windows-only] + formats: [zip] + wrap_in_directory: true + builds_info: *archive_file_info + files: *archive_files + # also build an archive of the source code source: enabled: true @@ -126,7 +149,7 @@ dockers: - docker/entrypoint.sh - image_templates: - restic/rest-server:{{ .Version }}-i386 - goarch: 386 + goarch: "386" build_flag_templates: - "--platform=linux/386" - "--pull"