diff --git a/.goreleaser.yml b/.goreleaser.yml index 7136f89e..7804d93d 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -3,29 +3,59 @@ before: hooks: - go generate ./... builds: -- env: - - CGO_ENABLED=0 - goos: - - linux - - darwin - - windows - - freebsd - goarch: - - amd64 - - arm64 - - 386 - ignore: - - goos: darwin - goarch: 386 - - goos: linux - goarch: 386 - - goos: freebsd - goarch: 386 - ldflags: - - -s -w -X github.com/evilmartians/lefthook/internal/version.commit={{.Commit}} + # Builds the binaries without `lefthook upgrade` + - id: no_upgrade + tags: + - no_upgrade + env: + - GCO_ENABLED=0 + goos: + - linux + - darwin + - windows + - freebsd + goarch: + - amd64 + - arm64 + - 386 + ignore: + - goos: darwin + goarch: 386 + - goos: linux + goarch: 386 + - goos: freebsd + goarch: 386 + ldflags: + - -s -w -X github.com/evilmartians/lefthook/internal/version.commit={{.Commit}} + + # Full lefthook binary + - id: lefthook + env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + - windows + - freebsd + goarch: + - amd64 + - arm64 + - 386 + ignore: + - goos: darwin + goarch: 386 + - goos: linux + goarch: 386 + - goos: freebsd + goarch: 386 + ldflags: + - -s -w -X github.com/evilmartians/lefthook/internal/version.commit={{.Commit}} + archives: - id: lefthook format: binary + builds: + - lefthook files: - none* name_template: >- @@ -36,8 +66,11 @@ archives: {{- if eq .Arch "amd64" }}x86_64 {{- else if eq .Arch "386" }}i386 {{- else }}{{ .Arch }}{{ end }} + - id: lefthook-gz format: gz + builds: + - lefthook files: - none* name_template: >- @@ -48,10 +81,13 @@ archives: {{- if eq .Arch "amd64" }}x86_64 {{- else if eq .Arch "386" }}i386 {{- else }}{{ .Arch }}{{ end }} + checksum: name_template: '{{ .ProjectName }}_checksums.txt' + snapshot: name_template: "{{ .Tag }}" + changelog: sort: asc filters: @@ -78,7 +114,7 @@ nfpms: file_name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' homepage: https://github.com/evilmartians/lefthook description: Lefthook a single dependency-free binary to manage all your git hooks that works with any language in any environment, and in all common team workflows - maintainer: Alexander Abroskin + maintainer: Evil Martians license: MIT vendor: Evil Martians formats: diff --git a/packaging/pack.rb b/packaging/pack.rb index 2e20cdb9..69a36a88 100755 --- a/packaging/pack.rb +++ b/packaging/pack.rb @@ -54,42 +54,42 @@ def put_binaries cd(__dir__) puts "Putting binaries to packages..." { - "#{DIST}/lefthook_linux_amd64_v1/lefthook" => "npm/lefthook-linux-x64/bin/lefthook", - "#{DIST}/lefthook_linux_arm64/lefthook" => "npm/lefthook-linux-arm64/bin/lefthook", - "#{DIST}/lefthook_freebsd_amd64_v1/lefthook" => "npm/lefthook-freebsd-x64/bin/lefthook", - "#{DIST}/lefthook_freebsd_arm64/lefthook" => "npm/lefthook-freebsd-arm64/bin/lefthook", - "#{DIST}/lefthook_windows_amd64_v1/lefthook.exe" => "npm/lefthook-windows-x64/bin/lefthook.exe", - "#{DIST}/lefthook_windows_arm64/lefthook.exe" => "npm/lefthook-windows-arm64/bin/lefthook.exe", - "#{DIST}/lefthook_darwin_amd64_v1/lefthook" => "npm/lefthook-darwin-x64/bin/lefthook", - "#{DIST}/lefthook_darwin_arm64/lefthook" => "npm/lefthook-darwin-arm64/bin/lefthook", + "#{DIST}/no_upgrade_linux_amd64_v1/lefthook" => "npm/lefthook-linux-x64/bin/lefthook", + "#{DIST}/no_upgrade_linux_arm64/lefthook" => "npm/lefthook-linux-arm64/bin/lefthook", + "#{DIST}/no_upgrade_freebsd_amd64_v1/lefthook" => "npm/lefthook-freebsd-x64/bin/lefthook", + "#{DIST}/no_upgrade_freebsd_arm64/lefthook" => "npm/lefthook-freebsd-arm64/bin/lefthook", + "#{DIST}/no_upgrade_windows_amd64_v1/lefthook.exe" => "npm/lefthook-windows-x64/bin/lefthook.exe", + "#{DIST}/no_upgrade_windows_arm64/lefthook.exe" => "npm/lefthook-windows-arm64/bin/lefthook.exe", + "#{DIST}/no_upgrade_darwin_amd64_v1/lefthook" => "npm/lefthook-darwin-x64/bin/lefthook", + "#{DIST}/no_upgrade_darwin_arm64/lefthook" => "npm/lefthook-darwin-arm64/bin/lefthook", }.each do |(source, dest)| mkdir_p(File.dirname(dest)) cp(source, dest, verbose: true) end { - "#{DIST}/lefthook_linux_amd64_v1/lefthook" => "npm-bundled/bin/lefthook-linux-x64/lefthook", - "#{DIST}/lefthook_linux_arm64/lefthook" => "npm-bundled/bin/lefthook-linux-arm64/lefthook", - "#{DIST}/lefthook_freebsd_amd64_v1/lefthook" => "npm-bundled/bin/lefthook-freebsd-x64/lefthook", - "#{DIST}/lefthook_freebsd_arm64/lefthook" => "npm-bundled/bin/lefthook-freebsd-arm64/lefthook", - "#{DIST}/lefthook_windows_amd64_v1/lefthook.exe" => "npm-bundled/bin/lefthook-windows-x64/lefthook.exe", - "#{DIST}/lefthook_windows_arm64/lefthook.exe" => "npm-bundled/bin/lefthook-windows-arm64/lefthook.exe", - "#{DIST}/lefthook_darwin_amd64_v1/lefthook" => "npm-bundled/bin/lefthook-darwin-x64/lefthook", - "#{DIST}/lefthook_darwin_arm64/lefthook" => "npm-bundled/bin/lefthook-darwin-arm64/lefthook", + "#{DIST}/no_upgrade_linux_amd64_v1/lefthook" => "npm-bundled/bin/lefthook-linux-x64/lefthook", + "#{DIST}/no_upgrade_linux_arm64/lefthook" => "npm-bundled/bin/lefthook-linux-arm64/lefthook", + "#{DIST}/no_upgrade_freebsd_amd64_v1/lefthook" => "npm-bundled/bin/lefthook-freebsd-x64/lefthook", + "#{DIST}/no_upgrade_freebsd_arm64/lefthook" => "npm-bundled/bin/lefthook-freebsd-arm64/lefthook", + "#{DIST}/no_upgrade_windows_amd64_v1/lefthook.exe" => "npm-bundled/bin/lefthook-windows-x64/lefthook.exe", + "#{DIST}/no_upgrade_windows_arm64/lefthook.exe" => "npm-bundled/bin/lefthook-windows-arm64/lefthook.exe", + "#{DIST}/no_upgrade_darwin_amd64_v1/lefthook" => "npm-bundled/bin/lefthook-darwin-x64/lefthook", + "#{DIST}/no_upgrade_darwin_arm64/lefthook" => "npm-bundled/bin/lefthook-darwin-arm64/lefthook", }.each do |(source, dest)| mkdir_p(File.dirname(dest)) cp(source, dest, verbose: true) end { - "#{DIST}/lefthook_linux_amd64_v1/lefthook" => "rubygems/libexec/lefthook-linux-x64/lefthook", - "#{DIST}/lefthook_linux_arm64/lefthook" => "rubygems/libexec/lefthook-linux-arm64/lefthook", - "#{DIST}/lefthook_freebsd_amd64_v1/lefthook" => "rubygems/libexec/lefthook-freebsd-x64/lefthook", - "#{DIST}/lefthook_freebsd_arm64/lefthook" => "rubygems/libexec/lefthook-freebsd-arm64/lefthook", - "#{DIST}/lefthook_windows_amd64_v1/lefthook.exe" => "rubygems/libexec/lefthook-windows-x64/lefthook.exe", - "#{DIST}/lefthook_windows_arm64/lefthook.exe" => "rubygems/libexec/lefthook-windows-arm64/lefthook.exe", - "#{DIST}/lefthook_darwin_amd64_v1/lefthook" => "rubygems/libexec/lefthook-darwin-x64/lefthook", - "#{DIST}/lefthook_darwin_arm64/lefthook" => "rubygems/libexec/lefthook-darwin-arm64/lefthook", + "#{DIST}/no_upgrade_linux_amd64_v1/lefthook" => "rubygems/libexec/lefthook-linux-x64/lefthook", + "#{DIST}/no_upgrade_linux_arm64/lefthook" => "rubygems/libexec/lefthook-linux-arm64/lefthook", + "#{DIST}/no_upgrade_freebsd_amd64_v1/lefthook" => "rubygems/libexec/lefthook-freebsd-x64/lefthook", + "#{DIST}/no_upgrade_freebsd_arm64/lefthook" => "rubygems/libexec/lefthook-freebsd-arm64/lefthook", + "#{DIST}/no_upgrade_windows_amd64_v1/lefthook.exe" => "rubygems/libexec/lefthook-windows-x64/lefthook.exe", + "#{DIST}/no_upgrade_windows_arm64/lefthook.exe" => "rubygems/libexec/lefthook-windows-arm64/lefthook.exe", + "#{DIST}/no_upgrade_darwin_amd64_v1/lefthook" => "rubygems/libexec/lefthook-darwin-x64/lefthook", + "#{DIST}/no_upgrade_darwin_arm64/lefthook" => "rubygems/libexec/lefthook-darwin-arm64/lefthook", }.each do |(source, dest)| mkdir_p(File.dirname(dest)) cp(source, dest, verbose: true)