mirror of
https://github.com/dstotijn/hetty
synced 2025-02-16 12:18:28 +00:00
Update GoReleaser config
This commit is contained in:
parent
d84d2d0905
commit
1489cb16bf
6 changed files with 79 additions and 75 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,7 +1,6 @@
|
|||
/.release-env
|
||||
/.vscode
|
||||
/dist
|
||||
/hetty
|
||||
/cmd/hetty/admin
|
||||
*.pem
|
||||
*.test
|
||||
*.test
|
|
@ -1,60 +1,44 @@
|
|||
env:
|
||||
- GO111MODULE=on
|
||||
- CGO_ENABLED=1
|
||||
before:
|
||||
hooks:
|
||||
- make clean
|
||||
- make build-admin
|
||||
- go mod tidy
|
||||
|
||||
builds:
|
||||
- id: hetty-darwin-amd64
|
||||
- env:
|
||||
- CGO_ENABLED=0
|
||||
main: ./cmd/hetty
|
||||
goarch:
|
||||
- amd64
|
||||
goos:
|
||||
- darwin
|
||||
env:
|
||||
- CC=o64-clang
|
||||
- CXX=o64-clang++
|
||||
flags:
|
||||
- -mod=readonly
|
||||
|
||||
- id: hetty-linux-amd64
|
||||
main: ./cmd/hetty
|
||||
goarch:
|
||||
- amd64
|
||||
ldflags:
|
||||
- -s -w -X main.version=v{{.Version}}
|
||||
goos:
|
||||
- linux
|
||||
flags:
|
||||
- -mod=readonly
|
||||
|
||||
- id: hetty-windows-amd64
|
||||
main: ./cmd/hetty
|
||||
- windows
|
||||
- darwin
|
||||
goarch:
|
||||
- amd64
|
||||
goos:
|
||||
- windows
|
||||
env:
|
||||
- CC=x86_64-w64-mingw32-gcc
|
||||
- CXX=x86_64-w64-mingw32-g++
|
||||
flags:
|
||||
- -mod=readonly
|
||||
ldflags:
|
||||
- -buildmode=exe
|
||||
- arm64
|
||||
|
||||
archives:
|
||||
-
|
||||
replacements:
|
||||
darwin: macOS
|
||||
linux: Linux
|
||||
windows: Windows
|
||||
386: i386
|
||||
amd64: x86_64
|
||||
- replacements:
|
||||
darwin: macOS
|
||||
linux: Linux
|
||||
windows: Windows
|
||||
amd64: x86_64
|
||||
format_overrides:
|
||||
- goos: windows
|
||||
format: zip
|
||||
- goos: windows
|
||||
format: zip
|
||||
|
||||
gomod:
|
||||
proxy: true
|
||||
env:
|
||||
- GOPROXY=https://proxy.golang.org,direct
|
||||
- GOSUMDB=sum.golang.org
|
||||
|
||||
checksum:
|
||||
name_template: "checksums.txt"
|
||||
|
||||
snapshot:
|
||||
name_template: "{{ .Tag }}-next"
|
||||
name_template: "{{ incpatch .Version }}-next"
|
||||
|
||||
changelog:
|
||||
sort: asc
|
||||
|
|
42
Makefile
42
Makefile
|
@ -1,33 +1,21 @@
|
|||
PACKAGE_NAME := github.com/dstotijn/hetty
|
||||
GOLANG_CROSS_VERSION ?= v1.16.3
|
||||
export CGO_ENABLED = 0
|
||||
export NEXT_TELEMETRY_DISABLED = 1
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f hetty
|
||||
rm -rf ./cmd/hetty/admin
|
||||
rm -rf ./admin/node_modules
|
||||
rm -rf ./admin/dist
|
||||
rm -rf ./admin/.next
|
||||
|
||||
.PHONY: build-admin
|
||||
build-admin:
|
||||
NEXT_TELEMETRY_DISABLED=1 cd admin && yarn install && yarn run export
|
||||
cd admin && \
|
||||
yarn install --frozen-lockfile && \
|
||||
yarn run export && \
|
||||
mv dist ../cmd/hetty/admin
|
||||
|
||||
.PHONY: build
|
||||
build: build-admin
|
||||
CGO_ENABLED=0 mv admin/dist cmd/hetty/admin && go build ./cmd/hetty
|
||||
|
||||
.PHONY: release-dry-run
|
||||
release-dry-run: build-admin
|
||||
@docker run \
|
||||
--rm \
|
||||
-v `pwd`:/go/src/$(PACKAGE_NAME) \
|
||||
-w /go/src/$(PACKAGE_NAME) \
|
||||
troian/golang-cross:${GOLANG_CROSS_VERSION} \
|
||||
--rm-dist --skip-validate --skip-publish
|
||||
|
||||
.PHONY: release
|
||||
release: build-admin
|
||||
@if [ ! -f ".release-env" ]; then \
|
||||
echo "\033[91mFile \`.release-env\` is missing.\033[0m";\
|
||||
exit 1;\
|
||||
fi
|
||||
@docker run \
|
||||
--rm \
|
||||
-v `pwd`:/go/src/$(PACKAGE_NAME) \
|
||||
-w /go/src/$(PACKAGE_NAME) \
|
||||
--env-file .release-env \
|
||||
troian/golang-cross:${GOLANG_CROSS_VERSION} \
|
||||
release --rm-dist
|
||||
go build ./cmd/hetty
|
|
@ -6,7 +6,7 @@
|
|||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"export": "rm -rf .next && next build && next export -o dist"
|
||||
"export": "next build && next export -o dist"
|
||||
},
|
||||
"dependencies": {
|
||||
"@apollo/client": "^3.2.0",
|
||||
|
|
|
@ -27,6 +27,9 @@ import (
|
|||
"github.com/dstotijn/hetty/pkg/scope"
|
||||
)
|
||||
|
||||
var version = "v0.0.0"
|
||||
|
||||
// Flag variables.
|
||||
var (
|
||||
caCertFile string
|
||||
caKeyFile string
|
||||
|
@ -141,7 +144,7 @@ func run() error {
|
|||
TLSNextProto: map[string]func(*http.Server, *tls.Conn, http.Handler){}, // Disable HTTP/2
|
||||
}
|
||||
|
||||
log.Printf("[INFO] Running server on %v ...", addr)
|
||||
log.Printf("[INFO] Hetty (%v) is running on %v ...", version, addr)
|
||||
|
||||
err = s.ListenAndServe()
|
||||
if err != nil && errors.Is(err, http.ErrServerClosed) {
|
||||
|
|
34
go.mod
34
go.mod
|
@ -1,15 +1,45 @@
|
|||
module github.com/dstotijn/hetty
|
||||
|
||||
go 1.16
|
||||
go 1.17
|
||||
|
||||
require (
|
||||
github.com/99designs/gqlgen v0.14.0
|
||||
github.com/dgraph-io/badger/v3 v3.2103.2
|
||||
github.com/google/go-cmp v0.5.6
|
||||
github.com/gorilla/mux v1.7.4
|
||||
github.com/hashicorp/golang-lru v0.5.1 // indirect
|
||||
github.com/matryer/moq v0.0.0-20200106131100-75d0ddfc0007
|
||||
github.com/mitchellh/go-homedir v1.1.0
|
||||
github.com/oklog/ulid v1.3.1
|
||||
github.com/vektah/gqlparser/v2 v2.2.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/agnivade/levenshtein v1.1.0 // indirect
|
||||
github.com/cespare/xxhash v1.1.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.1.1 // indirect
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d // indirect
|
||||
github.com/dgraph-io/ristretto v0.1.0 // indirect
|
||||
github.com/dustin/go-humanize v1.0.0 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
|
||||
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect
|
||||
github.com/golang/protobuf v1.3.1 // indirect
|
||||
github.com/golang/snappy v0.0.3 // indirect
|
||||
github.com/google/flatbuffers v1.12.1 // indirect
|
||||
github.com/gorilla/websocket v1.4.2 // indirect
|
||||
github.com/hashicorp/golang-lru v0.5.1 // indirect
|
||||
github.com/klauspost/compress v1.12.3 // indirect
|
||||
github.com/mitchellh/mapstructure v1.1.2 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/russross/blackfriday/v2 v2.0.1 // indirect
|
||||
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
|
||||
github.com/urfave/cli/v2 v2.1.1 // indirect
|
||||
github.com/vektah/dataloaden v0.2.1-0.20190515034641-a19b9a6e7c9e // indirect
|
||||
go.opencensus.io v0.22.5 // indirect
|
||||
golang.org/x/mod v0.3.0 // indirect
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974 // indirect
|
||||
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c // indirect
|
||||
golang.org/x/tools v0.0.0-20210106214847-113979e3529a // indirect
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
|
||||
gopkg.in/yaml.v2 v2.2.4 // indirect
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue