Skip to content

Commit 8f71bb5

Browse files
committed
Create workflow
1 parent f9b3f2d commit 8f71bb5

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Build and Release Go Binaries
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
name: Build and Release Go Binaries
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
17+
- name: Set up Go
18+
uses: actions/setup-go@v4
19+
with:
20+
go-version: 1.23
21+
22+
- name: Build Go Binary
23+
run: |
24+
mkdir -p dist
25+
GOOS=linux GOARCH=amd64 go build -o json-dup-keys-linux-amd64
26+
27+
- name: Release
28+
uses: softprops/action-gh-release@v2
29+
with:
30+
files: |
31+
json-dup-keys-linux-amd64

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,13 @@
22

33
CLI tool to detect duplicate keys in JSON files. Uses tree-sitter to parse JSON as text and checks that in AST trees.
44
Doesn't attempt to deserialize the whole JSON into some structure in memory, so it's reasonably fast for larger files.
5+
6+
## Installation
7+
8+
There's a pre-built binary for linux amd64 in the releases section, but the preferred way is to install it with Go.
9+
10+
If you have Go on you machine, you can install the tool with the following command:
11+
12+
```sh
13+
go install github.com/andriusm/json-dup-keys@latest
14+
```

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func main() {
3838
os.Exit(1)
3939
}
4040

41-
fmt.Println("No duplicate keys detected.")
41+
fmt.Println("No duplicate keys detected!")
4242
}
4343

4444
func findDuplicateKeys(node *tree_sitter.Node, content []byte) []string {

0 commit comments

Comments
 (0)