Skip to content

Commit 90bef67

Browse files
chore: Improve release (#9)
1 parent 604b45f commit 90bef67

File tree

4 files changed

+76
-16
lines changed

4 files changed

+76
-16
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
permissions:
1010
contents: write
11-
# packages: write
11+
packages: write
1212
# issues: write
1313

1414
jobs:

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Added by GoReleaser
2+
dist/
3+
4+
# JetBrains
15
.idea
2-
/build
3-
/bin

.goreleaser.yaml

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,55 @@
1+
before:
2+
hooks:
3+
- go mod tidy
14
builds:
2-
- skip: true
5+
- env:
6+
- CGO_ENABLED=0
7+
goos:
8+
- linux
9+
- windows
10+
- darwin
11+
binary: graphql-schema-picker
12+
main: ./cmd/graphql-schema-picker
13+
14+
kos:
15+
- repository: ghcr.io/kevinmichaelchen/graphql-schema-picker
16+
tags:
17+
- '{{.Version}}'
18+
- latest
19+
bare: true
20+
preserve_import_paths: false
21+
platforms:
22+
- linux/amd64
23+
- linux/arm64
24+
docker_signs:
25+
- artifacts: manifests
26+
27+
archives:
28+
- format: tar.gz
29+
# this name template makes the OS and Arch compatible with the results of uname.
30+
name_template: >-
31+
{{ .ProjectName }}_
32+
{{- title .Os }}_
33+
{{- if eq .Arch "amd64" }}x86_64
34+
{{- else if eq .Arch "386" }}i386
35+
{{- else }}{{ .Arch }}{{ end }}
36+
{{- if .Arm }}v{{ .Arm }}{{ end }}
37+
# use zip for windows archives
38+
format_overrides:
39+
- goos: windows
40+
format: zip
41+
checksum:
42+
name_template: 'checksums.txt'
43+
snapshot:
44+
name_template: "{{ incpatch .Version }}-next"
45+
changelog:
46+
sort: asc
47+
filters:
48+
exclude:
49+
- '^docs:'
50+
- '^test:'
51+
52+
# The lines beneath this are called `modelines`. See `:help modeline`
53+
# Feel free to remove those if you don't want/use them.
54+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
55+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

README.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,28 @@ our example [**SDL file**][sdl-file] (Schema Definition Language).
3232
Eventually, I may package this up in Tea and maybe even Homebrew (via
3333
[Goreleaser][goreleaser-brew]).
3434

35-
For the time being, it should be installable with Go:
35+
[goreleaser-brew]: https://goreleaser.com/customization/homebrew/
36+
37+
#### With `go install`
3638

3739
```shell
3840
go install github.com/kevinmichaelchen/graphql-schema-picker@latest
3941
```
4042

41-
[goreleaser-brew]: https://goreleaser.com/customization/homebrew/
42-
43-
### Usage
43+
#### With Docker
4444

4545
```shell
46-
graphql-schema-picker \
47-
--debug \
48-
pick \
49-
--output output.sdl.graphqls \
50-
--sdl-file examples/hasura.sdl.graphqls \
51-
--definitions Aircrafts
46+
docker pull ghcr.io/kevinmichaelchen/graphql-schema-picker
47+
docker run --rm ghcr.io/kevinmichaelchen/graphql-schema-picker --help
48+
49+
docker run --rm \
50+
-v $(pwd)/examples:/examples \
51+
ghcr.io/kevinmichaelchen/graphql-schema-picker \
52+
--debug \
53+
pick \
54+
--output /examples/pruned.sdl.graphqls \
55+
--sdl-file /examples/hasura.sdl.graphqls \
56+
--definitions Aircrafts
5257
```
5358

5459
## Similar Tools
@@ -67,7 +72,7 @@ graphql-schema-picker \
6772
go run cmd/graphql-schema-picker/main.go \
6873
--debug \
6974
pick \
70-
--output output.sdl.graphqls \
75+
--output examples/pruned.sdl.graphqls \
7176
--sdl-file examples/hasura.sdl.graphqls \
7277
--definitions Aircrafts
7378
```
@@ -83,7 +88,7 @@ Create tags with `xc tag` and push them with `git push --tags`.
8388
Builds the Go program into a local binary.
8489

8590
```shell
86-
go build -v -trimpath -ldflags="-s -w" -o ./bin/graphql-schema-picker ./cmd/graphql-schema-picker
91+
goreleaser build --clean --single-target
8792
```
8893

8994
### tag

0 commit comments

Comments
 (0)