Skip to content

Commit

Permalink
1.2.0: Remote config feature, interactive support
Browse files Browse the repository at this point in the history
Signed-off-by: Valentin Kiselev <mrexox@evilmartians.com>
  • Loading branch information
mrexox committed Nov 5, 2022
1 parent 0ea6304 commit 617c1fb
Show file tree
Hide file tree
Showing 15 changed files with 76 additions and 70 deletions.
24 changes: 7 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,31 +49,21 @@ jobs:
formula: lefthook
token: ${{secrets.HOMEBREW_TOKEN}}

- name: Publish to Rubygems
- name: Publish to NPM and Rubygems
env:
NPM_API_KEY: ${{ secrets.NPM_API_KEY }}
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
run: |
cat << EOF > ~/.npmrc
//registry.npmjs.org/:_authToken=${NPM_API_KEY}
EOF
chmod 0600 ~/.npmrc
mkdir -p ~/.gem/
cat << EOF > ~/.gem/credentials
---
:rubygems_api_key: ${RUBYGEMS_API_KEY}
EOF
chmod 0600 ~/.gem/credentials
git clean -fdX packaging/rubygems/libexec/
cd dist
find . -maxdepth 2 -executable -type f -exec cp --parents \{\} ../packaging/rubygems/libexec/ \;
cd ../packaging/rubygems
rake build
gem push pkg/*.gem
cd ../..
- name: Publish to NPM
env:
NPM_API_KEY: ${{ secrets.NPM_API_KEY }}
run: |
cat << EOF > ~/.npmrc
//registry.npmjs.org/:_authToken=${NPM_API_KEY}
EOF
cd packaging/npm/
cd packaging/
make prepare
make publish
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## master (unreleased)

## 1.2.0 (2022-11-7)

- fix: Full support for interactive commands and scripts ([PR #352](https://github.com/evilmartians/lefthook/pull/352) by @mrexox)
- chore: Remove deprecated config options ([PR #351](https://github.com/evilmartians/lefthook/pull/351) by @mrexox)
- feature: Add remote config support ([PR #343](https://github.com/evilmartians/lefthook/pull/343) by @oatovar and @mrexox)
Expand Down
2 changes: 1 addition & 1 deletion internal/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strconv"
)

const version = "1.1.4"
const version = "1.2.0"

var (
// Is set via -X github.com/evilmartians/lefthook/internal/version.commit={commit}.
Expand Down
50 changes: 50 additions & 0 deletions packaging/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Packages version to release
VERSION := 1.2.0

DIST_DIR := ../dist

LINUX_AMD64_BIN=$(DIST_DIR)/lefthook_linux_amd64_v1/lefthook
LINUX_ARM64_BIN=$(DIST_DIR)/lefthook_linux_arm64/lefthook
WINDOWS_AMD64_BIN=$(DIST_DIR)/lefthook_windows_amd64_v1/lefthook.exe
WINDOWS_ARM64_BIN=$(DIST_DIR)/lefthook_windows_arm64/lefthook.exe
DARWIN_AMD64_BIN=$(DIST_DIR)/lefthook_darwin_amd64_v1/lefthook
DARWIN_ARM64_BIN=$(DIST_DIR)/lefthook_darwin_arm64/lefthook

prepare: clean set-version put-readme put-binaries

publish:
find npm -type d -name 'lefthook*' -exec npm publish --access public \{} \;
npm publish --access public npm-bundled
npm publish --access public npm-installer
cd rubygems; rake build; gem push pkg/*.gem

# Update versions of all packages
set-version:
find npm -name 'package.json' -type f -print0 | xargs -0 sed -E -i "s/\"version\": \".+\"/\"version\": \"$(VERSION)\"/"
sed -E -i "s/\"(lefthook-.+)\": \".+\"/\"\1\": \"$(VERSION)\"/g" npm/lefthook/package.json
sed -E -i "0,/version/{s/\"version\": \".+\"/\"version\": \"$(VERSION)\"/}" npm-bundled/package.json
sed -E -i "0,/version/{s/\"version\": \".+\"/\"version\": \"$(VERSION)\"/}" npm-installer/package.json
sed -E -i "s/(spec\.version\s+= ).*/\1\"$(VERSION)\"/" rubygems/lefthook.gemspec

put-binaries:
install -D $(LINUX_AMD64_BIN) npm/lefthook-linux-x64/bin/lefthook
install -D $(LINUX_ARM64_BIN) npm/lefthook-linux-arm64/bin/lefthook
install -D $(WINDOWS_AMD64_BIN) npm/lefthook-windows-x64/bin/lefthook.exe
install -D $(WINDOWS_ARM64_BIN) npm/lefthook-windows-arm64/bin/lefthook.exe
install -D $(DARWIN_AMD64_BIN) npm/lefthook-darwin-x64/bin/lefthook
install -D $(DARWIN_ARM64_BIN) npm/lefthook-darwin-arm64/bin/lefthook
cd npm-bundled; npm version $(VERSION) --allow-same-version; cd -
cd ../dist; find . -maxdepth 2 -executable -type f -exec cp --parents \{\} ../packaging/rubygems/libexec/ \;

put-readme:
find npm/ -type d -name 'lefthook*' -exec cp -f ../README.md \{} \;
cp ../README.md npm-bundled/
cp ../README.md npm-installer/

clean:
find npm/ -name 'README.md' -exec rm \{} \;
find npm/ -type f -name 'lefthook*' -executable -exec rm \{} \;
rm npm-bundled/README.md
git clean -fdX npm-bundled/bin/
rm npm-installer/README.md
git clean -fdX rubygems/libexec/ rubygems/pkg/
2 changes: 1 addition & 1 deletion packaging/npm-bundled/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@evilmartians/lefthook",
"version": "1.1.4",
"version": "1.2.0",
"description": "Simple git hooks manager",
"main": "index.js",
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion packaging/npm-installer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@evilmartians/lefthook-installer",
"version": "1.1.4",
"version": "1.2.0",
"description": "Simple git hooks manager",
"main": "index.js",
"bin": {
Expand Down
36 changes: 0 additions & 36 deletions packaging/npm/Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion packaging/npm/lefthook-darwin-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lefthook-darwin-arm64",
"version": "1.1.4",
"version": "1.2.0",
"description": "The macOS ARM 64-bit binary for lefthook, git hooks manager.",
"preferUnplugged": false,
"repository": "https://github.com/evilmartians/lefthook",
Expand Down
2 changes: 1 addition & 1 deletion packaging/npm/lefthook-darwin-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lefthook-darwin-x64",
"version": "1.1.4",
"version": "1.2.0",
"description": "The macOS 64-bit binary for lefthook, git hooks manager.",
"preferUnplugged": false,
"repository": "https://github.com/evilmartians/lefthook",
Expand Down
2 changes: 1 addition & 1 deletion packaging/npm/lefthook-linux-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lefthook-linux-arm64",
"version": "1.1.4",
"version": "1.2.0",
"description": "The Linux ARM 64-bit binary for lefthook, git hooks manager.",
"preferUnplugged": false,
"repository": "https://github.com/evilmartians/lefthook",
Expand Down
2 changes: 1 addition & 1 deletion packaging/npm/lefthook-linux-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lefthook-linux-x64",
"version": "1.1.4",
"version": "1.2.0",
"description": "The Linux 64-bit binary for lefthook, git hooks manager.",
"preferUnplugged": false,
"repository": "https://github.com/evilmartians/lefthook",
Expand Down
2 changes: 1 addition & 1 deletion packaging/npm/lefthook-windows-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lefthook-windows-arm64",
"version": "1.1.4",
"version": "1.2.0",
"description": "The Windows ARM 64-bit binary for lefthook, git hooks manager.",
"preferUnplugged": false,
"repository": "https://github.com/evilmartians/lefthook",
Expand Down
2 changes: 1 addition & 1 deletion packaging/npm/lefthook-windows-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lefthook-windows-x64",
"version": "1.1.4",
"version": "1.2.0",
"description": "The Windows 64-bit binary for lefthook, git hooks manager.",
"preferUnplugged": false,
"repository": "https://github.com/evilmartians/lefthook",
Expand Down
14 changes: 7 additions & 7 deletions packaging/npm/lefthook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lefthook",
"version": "1.1.4",
"version": "1.2.0",
"description": "Simple git hooks manager",
"main": "index.js",
"repository": "https://github.com/evilmartians/lefthook",
Expand All @@ -20,12 +20,12 @@
},
"homepage": "https://github.com/evilmartians/lefthook#readme",
"optionalDependencies": {
"lefthook-darwin-arm64": "1.1.4",
"lefthook-darwin-x64": "1.1.4",
"lefthook-linux-arm64": "1.1.4",
"lefthook-linux-x64": "1.1.4",
"lefthook-windows-arm64": "1.1.4",
"lefthook-windows-x64": "1.1.4"
"lefthook-darwin-arm64": "1.2.0",
"lefthook-darwin-x64": "1.2.0",
"lefthook-linux-arm64": "1.2.0",
"lefthook-linux-x64": "1.2.0",
"lefthook-windows-arm64": "1.2.0",
"lefthook-windows-x64": "1.2.0"
},
"scripts": {
"postinstall": "node postinstall.js"
Expand Down
2 changes: 1 addition & 1 deletion packaging/rubygems/lefthook.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |spec|
spec.name = "lefthook"
spec.version = "1.1.4"
spec.version = "1.2.0"
spec.authors = ["A.A.Abroskin", "Evil Martians"]
spec.email = ["lefthook@evilmartians.com"]

Expand Down

0 comments on commit 617c1fb

Please sign in to comment.