diff --git a/.gitignore b/.gitignore index f1f10f4..521b5a4 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,7 @@ /c.out /data/* /delta/applied/* -/dist/* +/dist/ /domainify /go.work /node_modules/* diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..fbb0458 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,46 @@ +version: 1 + +before: + hooks: + - go mod tidy + +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + +archives: + - format: tar.gz + # this name template makes the OS and Arch compatible with the results of `uname`. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + # use zip for windows archives + format_overrides: + - goos: windows + format: zip + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" + +release: + github: + owner: ProfoundNetworks + name: domainify + +env_files: + github_token: ~/.gh_goreleaser + +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj diff --git a/README.md b/README.md index a9b61f8..8ddae3f 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,11 @@ used by browsers for restricting the scope of cookies across hostnames. Usage ----- -domainify takes hostnames as arguments, and outputs entity domains to -standard output, one entity domain per line. A bad hostname or an error -mapping to an entity domain will result in a blank line being output for -that input. - -Arguments can be givin either as command line arguments, or via standard -input, one hostname per line, with the `--stdin` option. +`domainify` takes hostnames as command line arguments or from stdin (with +the `--stdin` option, and outputs entity domains to standard output, one +domain per line. A bad hostname or an error mapping a hostname to an entity +domain will result in a blank line being output for that input (and sometimes +an error message to standard error). For example: @@ -33,7 +31,7 @@ profound.net wikipedia.org -$ echo -e "hosted.l.google.com\ncom\n31.pool85-61-184.dynamic.orange.es" | +$ echo -e "hosted.l.google.com\ncom\npool85-61.dynamic.orange.es" | domainify --stdin google.com diff --git a/go.mod b/go.mod index 6e1b17f..ca9dd85 100644 --- a/go.mod +++ b/go.mod @@ -3,12 +3,12 @@ module github.com/ProfoundNetworks/domainify go 1.22.1 require ( + github.com/ProfoundNetworks/gpntest v0.0.0-20230919053257-5438c4e72e65 github.com/ProfoundNetworks/gpnutil v0.20240405.1 github.com/jessevdk/go-flags v1.5.0 ) require ( - github.com/ProfoundNetworks/gpntest v0.0.0-20230919053257-5438c4e72e65 // indirect github.com/ProfoundNetworks/net v0.0.0-20240405052550-5a324bbc9278 // indirect github.com/adrg/strutil v0.3.1 // indirect github.com/google/go-cmp v0.5.9 // indirect