Skip to content
This repository was archived by the owner on Jan 25, 2022. It is now read-only.

Commit 3ee079c

Browse files
committed
Now using buildtool.
1 parent c3da1bf commit 3ee079c

File tree

6 files changed

+80
-178
lines changed

6 files changed

+80
-178
lines changed

.goreleaser.yml

Lines changed: 60 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
# This is an example goreleaser.yaml file with some sane defaults.
2-
# Make sure to check the documentation at http://goreleaser.com
1+
################################################################################
2+
project_name: deploywp
3+
4+
5+
################################################################################
36
before:
47
hooks:
5-
# you may remove this if you don't use vgo
68
- go mod download
7-
# you may remove this if you don't need go generate
89
- go generate ./...
9-
# Make sure pkgreflect is installed.
10-
- make pkgreflect
1110

11+
12+
################################################################################
1213
builds:
1314
- env:
1415
- CGO_ENABLED=0
@@ -18,59 +19,74 @@ builds:
1819
goos:
1920
- linux
2021
- darwin
21-
# windows
22+
- windows
2223
goarch:
23-
# 386
24+
- 386
2425
- amd64
25-
# arm
26-
# arm64
26+
- arm
27+
- arm64
28+
2729

30+
################################################################################
2831
archives:
29-
- replacements:
30-
darwin: Darwin
31-
linux: Linux
32-
windows: Windows
33-
386: i386
34-
amd64: x86_64
32+
-
33+
name_template: "{{ .ProjectName }}-{{ .Os }}_{{ .Arch }}"
34+
35+
replacements:
36+
darwin: darwin
37+
linux: linux
38+
windows: windows
39+
386: i386
40+
amd64: x86_64
41+
42+
# Set to true, if you want all files in the archive to be in a single directory.
43+
# If set to true and you extract the archive 'goreleaser_Linux_arm64.tar.gz',
44+
# you get a folder 'goreleaser_Linux_arm64'.
45+
# If set to false, all files are extracted separately.
46+
# You can also set it to a custom folder name (templating is supported).
47+
# Default is false.
48+
wrap_in_directory: false
49+
50+
# Archive format. Valid options are `tar.gz`, `tar.xz`, `gz`, `zip` and `binary`.
51+
# If format is `binary`, no archives are created and the binaries are instead
52+
# uploaded directly.
53+
# Default is `tar.gz`.
54+
format: tar.gz
3555

56+
# Can be used to change the archive formats for specific GOOSs.
57+
# Most common use case is to archive as zip on Windows.
58+
# Default is empty.
59+
#format_overrides:
60+
# - goos: windows
61+
# format: zip
62+
63+
# Additional files/template/globs you want to add to the archive.
64+
# Defaults are any files matching `LICENCE*`, `LICENSE*`,
65+
# `README*` and `CHANGELOG*` (case-insensitive).
66+
#files:
67+
# - LICENSE.txt
68+
# - README_{{.Os}}.md
69+
# - CHANGELOG.md
70+
# - docs/*
71+
# - design/*.png
72+
# - templates/**/*
73+
74+
75+
################################################################################
3676
checksum:
3777
name_template: 'checksums.txt'
3878

79+
80+
################################################################################
3981
snapshot:
4082
name_template: "{{ .Tag }}-next"
4183

84+
85+
################################################################################
4286
changelog:
4387
sort: asc
4488
filters:
4589
exclude:
4690
- '^docs:'
4791
- '^test:'
4892

49-
#release:
50-
# github:
51-
# owner: newclarity
52-
# name: launch
53-
#
54-
# # IDs of the archives to use.
55-
# # Defaults to all.
56-
# ids:
57-
# # foo
58-
# # bar
59-
#
60-
# # You can change the name of the GitLab release.
61-
# # Default is `{{.Tag}}`
62-
# # name_template: "{{.ProjectName}}-v{{.Version}} {{.Env.USER}}"
63-
# name_template: "Release {{.ProjectName}}-v{{.Version}} {{.Env.USER}}"
64-
#
65-
# # You can disable this pipe in order to not upload any artifacts to
66-
# # GitLab.
67-
# # Defaults to false.
68-
# disable: true
69-
#
70-
# # You can add extra pre-existing files to the release.
71-
# # The filename on the release will be the last part of the path (base). If
72-
# # another file with the same name exists, the latest one found will be used.
73-
# # Defaults to empty.
74-
# extra_files:
75-
# - glob: ./bin/*
76-

.idea/workspace.xml

Lines changed: 0 additions & 82 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 19 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,52 @@
1-
PKGREFLECT := $(shell which pkgreflect)
2-
GODOCMD := $(shell which godocdown)
3-
BINARY := $(shell tools/getBinary.sh)
4-
VERSION := $(shell tools/getVersion.sh)
5-
COMMENT := $(shell tools/getComment.sh)
6-
1+
################################################################################
2+
ifeq (, $(shell which buildtool))
3+
$(warning "Installing buildtool...")
4+
$(warning "go get github.com/gearboxworks/buildtool")
5+
$(shell go get github.com/gearboxworks/buildtool)
6+
endif
7+
BUILDTOOL := $(shell which buildtool)
8+
ifeq (, $(BUILDTOOL))
9+
$(error "No buildtool found...")
10+
endif
11+
################################################################################
712

813
all:
9-
@echo "Current launch version is: v$(VERSION)"
10-
@echo "Last commit message is: '$(COMMENT)'"
11-
@echo ""
1214
@echo "build - Build for local testing."
1315
@echo "release - Build for published release."
1416
@echo "push - Push repo to GitHub."
15-
@echo "doc - Build GoLang documentation."
1617
@echo ""
1718
@echo "build-docker - Build Docker cotainer."
1819
@echo "test-run - Run a test using native GoLang."
1920
@echo "test-template - Run a test using GoLang template."
2021
@echo "test-docker - Run a test using native GoLang within container."
21-
@echo "pkgreflect - Install 'pkgreflect' - Used to auto-discover exported functions."
22-
22+
@echo ""
23+
@$(BUILDTOOL) get all
2324

2425
build:
25-
@echo "Current $(BINARY) version is v$(VERSION)"
2626
@make pkgreflect
27-
@goreleaser --snapshot --skip-publish --rm-dist
28-
27+
@$(BUILDTOOL) build
2928

3029
release:
31-
@echo "Current $(BINARY) version is v$(VERSION)"
3230
@make pkgreflect
33-
@make push
34-
@git tag -a v$(VERSION) -m '"Release v$(VERSION)"'
35-
@git push origin v$(VERSION)
36-
@goreleaser --rm-dist
37-
31+
@$(BUILDTOOL) release
3832

3933
push:
40-
@echo "Pushing to: $(shell git branch)"
41-
@git config core.hooksPath .git-hooks
42-
@git add .
43-
@git commit -m '"$(COMMENT)"' .
44-
@git push
45-
34+
@make pkgreflect
35+
@$(BUILDTOOL) push
4636

47-
doc:
48-
ifeq ($(GODOCMD),)
49-
@echo "godocdown - Installing"
50-
@go install github.com/robertkrimen/godocdown/godocdown
51-
else
52-
@echo "godocdown - already installed here $(GODOCMD)"
53-
endif
54-
@$(GODOCMD)
37+
pkgreflect:
38+
@$(BUILDTOOL) pkgreflect jtc/helpers
5539

5640
build-docker:
5741
@make -C docker
5842

59-
6043
test-run:
6144
@./bin/deploywp run --chdir --json tests/deploywp.json prod
6245

63-
6446
test-template:
6547
#@./bin/deploywp load tests/deploywp.json prod
6648
@./tests/deploywp.tmpl prod
6749

68-
6950
test-docker:
7051
@launch -q -p tests -m tests shell deploywp:0.9 deploywp run
7152

72-
73-
pkgreflect:
74-
ifeq ($(PKGREFLECT),)
75-
@echo "pkgreflect - Installing"
76-
@go install github.com/ungerik/pkgreflect
77-
else
78-
@echo "pkgreflect - already installed here $(PKGREFLECT)"
79-
endif
80-
@$(PKGREFLECT) -notests jtc/helpers
81-

go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ github.com/huandu/xstrings v1.3.1 h1:4jgBlKK6tLKFvO8u5pmYjG91cqytmDCDvGh7ECVFfFs
8484
github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
8585
github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg=
8686
github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
87+
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
8788
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
8889
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
8990
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=

tools/getComment.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

tools/getVersion.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)