Skip to content

Commit

Permalink
Merge branch 'master' into dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexox committed Jul 29, 2024
2 parents 32f1734 + 19b7a72 commit e403f61
Show file tree
Hide file tree
Showing 56 changed files with 1,493 additions and 354 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
- uses: actions/checkout@v4
go-version-file: go.mod
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: goreleaser
name: release

on:
push:
Expand All @@ -23,22 +23,22 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
go-version-file: go.mod

- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v1
uses: samuelmeuli/action-snapcraft@v2

- name: Prevent from snapcraft fail
run: |
mkdir -p $HOME/.cache/snapcraft/download
mkdir -p $HOME/.cache/snapcraft/stage-packages
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --clean
version: '~> v2'
args: release --clean --verbose
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
Expand All @@ -59,8 +59,8 @@ jobs:
EOF
chmod 0600 ~/.gem/credentials
cd packaging/
make prepare
make publish
ruby pack.rb prepare
ruby pack.rb publish
- name: Update Homebrew formula
uses: dawidd6/action-homebrew-bump-formula@v3
Expand Down
34 changes: 18 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,15 @@ jobs:
test:
strategy:
matrix:
go-version: [1.22.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v4
go-version-file: go.mod
- name: Test
run: go test ./... -coverprofile coverage.out
- name: Report coverage
Expand All @@ -31,24 +30,27 @@ jobs:
test-integrity:
strategy:
matrix:
go-version: [1.22.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
env:
GOCOVERDIR: ${{ github.workspace }}/_icoverdir_
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v4
go-version-file: go.mod
- name: Prepare lefthook
run: |
mkdir _icoverdir_
go install -cover
- name: Run integrity tests
run: go test integrity_test.go -tags=integrity
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 3
command: go test integrity_test.go -tags=integrity
- name: Collect coverage
run: |
go tool covdata textfmt -i _icoverdir_ -o coverage.out
Expand All @@ -63,18 +65,18 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
- name: Checkout code
uses: actions/checkout@v4
go-version-file: go.mod
- name: Build binaries
uses: goreleaser/goreleaser-action@v5
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: build --snapshot --skip-validate --clean
version: '~> v2'
args: release --snapshot --skip=publish --skip=snapcraft --skip=validate --clean --verbose
- name: Tar binaries to preserve executable bit
run: 'tar -cvf lefthook-binaries.tar --directory dist/ $(find dist/ -executable -type f -printf "%P\0" | xargs --null)'
- name: Upload binaries as artifacts
Expand All @@ -91,5 +93,5 @@ jobs:
steps:
- uses: coverallsapp/github-action@v2
with:
carryforward: "integration-1.22.x ubuntu-latest,integration-1.22.x macos-latest,integration-1.22.x windows-latest,1.22.x ubuntu-latest,1.22.x macos-latest,1.22.x windows-latest"
carryforward: "integration-ubuntu-latest,integration-macos-latest,integration-windows-latest,ubuntu-latest,macos-latest,windows-latest"
parallel-finished: true
10 changes: 4 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
.vscode/
.idea/
/lefthook-local.yml
/lefthook
/lefthook-local.yml

tmp/
dist/

# Packages
packaging/rubygems/pkg/
packaging/rubygems/libexec/
packaging/npm-bundled/bin/
packaging/npm-*/README.md
packaging/npm/*/bin/
!packaging/npm/lefthook/bin/index.js
packaging/npm/*/README.md
package.json
!packaging/npm/*/package.json
node_modules/
yarn.lock
package-lock.json
!packaging/npm/lefthook/bin/index.js
99 changes: 71 additions & 28 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,66 @@
version: 2
project_name: lefthook
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_self_update
tags:
- no_self_update
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
flags:
- -trimpath
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
flags:
- -trimpath
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 +71,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 +86,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 @@ -64,25 +105,27 @@ changelog:
- '^\d+\.\d+\.\d+:'

snapcrafts:
-
summary: Fast and powerful Git hooks manager for any type of projects.
- summary: Fast and powerful Git hooks manager for any type of projects.
description: |
Lefthook is a single dependency-free binary to manage all your git hooks. It works with any language in any environment, and in all common team workflows.
grade: stable
confinement: classic
publish: true
license: MIT
builds:
- no_self_update

nfpms:
-
file_name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
- 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
builds:
- no_self_update
formats:
- deb
- rpm
- deb
- rpm
dependencies:
- git
- git
72 changes: 72 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,78 @@

## master (unreleased)

## 1.7.9 (2024-07-26)

- fix: typo CGO_ENABLED instead of GCO_ENABLED ([#791](https://github.com/evilmartians/lefthook/pull/791)) by @mrexox

## 1.7.8 (2024-07-26)

- fix: npm fix packages ([#789](https://github.com/evilmartians/lefthook/pull/789)) by @mrexox
- fix: explicitly pass static flag to linker ([#788](https://github.com/evilmartians/lefthook/pull/788)) by @mrexox
- ci: update workflow files ([#787](https://github.com/evilmartians/lefthook/pull/787)) by @mrexox
- ci: use latest goreleaser ([#784](https://github.com/evilmartians/lefthook/pull/784)) by @mrexox

## 1.7.7 (2024-07-24)

- fix: multiple excludes ([#782](https://github.com/evilmartians/lefthook/pull/782)) by @mrexox

## 1.7.6 (2024-07-24)

- feat: add self-update command ([#778](https://github.com/evilmartians/lefthook/pull/778)) by @mrexox

## 1.7.5 (2024-07-22)

- feat: use glob in exclude array ([#777](https://github.com/evilmartians/lefthook/pull/777)) by @mrexox

## 1.7.4 (2024-07-19)

- fix: rollback packaging changes ([#776](https://github.com/evilmartians/lefthook/pull/776)) by @mrexox

## 1.7.3 (2024-07-18)

- feat: allow list of files in exclude option ([#772](https://github.com/evilmartians/lefthook/pull/772)) by @mrexox
- docs: add docs for LEFTHOOK_OUTPUT var ([#771](https://github.com/evilmartians/lefthook/pull/771)) by @manbearwiz
- fix: use direct lefthook package ([#774](https://github.com/evilmartians/lefthook/pull/774)) by @mrexox

## 1.7.2 (2024-07-11)

- fix: add missing sub directory in hook template ([#768](https://github.com/evilmartians/lefthook/pull/768)) by @nikeee

## 1.7.1 (2024-07-08)

- fix: use correct extension in hook.tmpl ([#767](https://github.com/evilmartians/lefthook/pull/767)) by @apfohl

## 1.7.0 (2024-07-08)

- fix: publishing ([#765](https://github.com/evilmartians/lefthook/pull/765)) by @mrexox
- perf: startup time reduce ([#705](https://github.com/evilmartians/lefthook/pull/705)) by @dalisoft
- docs: add a note about pnpm package installation ([#761](https://github.com/evilmartians/lefthook/pull/761)) by @mrexox
- ci: retriable integrity tests ([#758](https://github.com/evilmartians/lefthook/pull/758)) by @mrexox
- ci: universal publisher with Ruby script ([#756](https://github.com/evilmartians/lefthook/pull/756)) by @mrexox

## 1.6.18 (2024-06-21)

- fix: allow multiple levels of extends ([#755](https://github.com/evilmartians/lefthook/pull/755)) by @mrexox

## 1.6.17 (2024-06-20)

- fix: apply local extends only if they are present ([#754](https://github.com/evilmartians/lefthook/pull/754)) by @mrexox
- chore: setting proper error message for missing lefthook file ([#748](https://github.com/evilmartians/lefthook/pull/748)) by @Cadienvan

## 1.6.16 (2024-06-13)

- fix: skip overwriting hooks when fetching data from remotes ([#745](https://github.com/evilmartians/lefthook/pull/745)) by @mrexox
- fix: fetch remotes only for non ghost hooks ([#744](https://github.com/evilmartians/lefthook/pull/744)) by @mrexox

## 1.6.15 (2024-06-03)

- feat: add refetch option to remotes config ([#739](https://github.com/evilmartians/lefthook/pull/739)) by @mrexox
- deps: June, 3, lipgloss (0.11.0) and viper (1.19.0) ([#742](https://github.com/evilmartians/lefthook/pull/742)) by @mrexox
- chore: enable copyloopvar, intrange, and prealloc ([#740](https://github.com/evilmartians/lefthook/pull/740)) by @scop
- perf: delay git and uname commands in hook scripts until needed ([#737](https://github.com/evilmartians/lefthook/pull/737)) by @scop
- chore: refactor commands interfaces ([#735](https://github.com/evilmartians/lefthook/pull/735)) by @mrexox
- chore: upgrade to 1.59.0 ([#738](https://github.com/evilmartians/lefthook/pull/738)) by @scop

## 1.6.14 (2024-05-30)

- fix: share STDIN across different commands on pre-push hook ([#732](https://github.com/evilmartians/lefthook/pull/732)) by @tdesveaux and @mrexox
Expand Down
Loading

0 comments on commit e403f61

Please sign in to comment.