Skip to content

Commit

Permalink
ci: adjust CI to not include upgrader in npm and rubygems packages
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexox committed Jul 22, 2024
1 parent 3985e5f commit a8589a1
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 45 deletions.
78 changes: 57 additions & 21 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: >-
Expand All @@ -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: >-
Expand All @@ -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:
Expand All @@ -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 <arkweid@evilmartians.com>
maintainer: Evil Martians <lefthook@evilmartians.com>
license: MIT
vendor: Evil Martians
formats:
Expand Down
48 changes: 24 additions & 24 deletions packaging/pack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a8589a1

Please sign in to comment.