Skip to content

GT-353 Automate release process #566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ debug/

# direnv files
.envrc

# vim files
.DS_Store
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- Deprecate ClientConfig.SynchronizeEndpointsInterval due to bug in implementation
- [V1] Add Rename function for collections (single server only).
- [V1] Fix using VST for database with non-ANSI characters
- Automate release process

## [1.6.0](https://github.com/arangodb/go-driver/tree/v1.6.0) (2023-05-30)
- Add ErrArangoDatabaseNotFound and IsExternalStorageError helper to v2
Expand Down
8 changes: 8 additions & 0 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,11 @@ To attach DLV debugger run tests with `DEBUG=true` flag e.g.:
```shell
DEBUG=true TESTOPTIONS="-test.run TestResponseHeader -test.v" make run-tests-single-json-with-auth
```

# Release Instructions

1. Update CHANGELOG.md
2. Make sure that GitHub access token exist in `~/.arangodb/github-token` and has read/write access for this repo.
3. Run `make release-patch|minor|major` to create a release.
- To release v2 version, use `make release-v2-patch|minor|major`.
4. Go To GitHub and fill the description with the content of CHANGELOG.md
29 changes: 23 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
DRIVER_VERSION := 1.6.0

PROJECT := go-driver
SCRIPTDIR := $(shell pwd)

Expand Down Expand Up @@ -491,6 +489,8 @@ tools: __dir_setup
@GOBIN=$(TMPDIR)/bin go install github.com/google/addlicense@v1.0.0
@echo ">> Fetching govulncheck"
@GOBIN=$(TMPDIR)/bin go install golang.org/x/vuln/cmd/govulncheck@v0.1.0
@echo ">> Fetching github-release"
@GOBIN=$(TMPDIR)/bin go install github.com/github-release/github-release@v0.10.0

.PHONY: license
license:
Expand Down Expand Up @@ -561,7 +561,24 @@ run-v2-tests-resilientsingle-with-auth:
@echo "Resilient Single, with authentication, v2"
@${MAKE} TEST_MODE="resilientsingle" TEST_AUTH="rootpw" __run_v2_tests

apply-version:
@echo "Updating version to: $(DRIVER_VERSION)"
@VERSION=$(DRIVER_VERSION) go generate version-driver.go
@VERSION=$(DRIVER_VERSION) go generate ./v2/connection/version-driver.go
GH_RELEASE := $(TMPDIR)/bin/github-release
RELEASE := $(SCRIPTDIR)/tools/release
V2_VERSION := ./v2/version/VERSION

release-patch:
go run $(RELEASE) -type=patch -github-release=$(GH_RELEASE)

release-minor:
go run $(RELEASE) -type=minor -github-release=$(GH_RELEASE)

release-major:
go run $(RELEASE) -type=major -github-release=$(GH_RELEASE)

release-v2-patch:
go run $(RELEASE) -type=patch -github-release=$(GH_RELEASE) -versionfile=$(V2_VERSION)

release-v2-minor:
go run $(RELEASE) -type=minor -github-release=$(GH_RELEASE) -versionfile=$(V2_VERSION)

release-v2-major:
go run $(RELEASE) -type=major -github-release=$(GH_RELEASE) -versionfile=$(V2_VERSION)
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.6.0
2 changes: 1 addition & 1 deletion agency/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type Transaction struct {
// The argument 'clientID' should be used to mark that transaction sender uniquely.
func NewTransaction(clientID string, options TransactionOptions) Transaction {
if clientID == "" {
clientID = fmt.Sprintf("go-driver/%s", driver.DriverVersion)
clientID = fmt.Sprintf("go-driver/%s", driver.DriverVersion())
}

return Transaction{
Expand Down
2 changes: 1 addition & 1 deletion context.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ func setDirtyReadFlagIfRequired(ctx context.Context, wasDirty bool) {

// ApplyVersionHeader adds the driver version to the request.
func ApplyVersionHeader(ctx context.Context, req Request) {
val := fmt.Sprintf("go-driver-v1/%s", DriverVersion)
val := fmt.Sprintf("go-driver-v1/%s", DriverVersion())
if ctx != nil {
if v := ctx.Value(keyDriverFlags); v != nil {
if flags, ok := v.([]string); ok {
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.19
require (
github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e
github.com/coreos/go-iptables v0.6.0
github.com/coreos/go-semver v0.3.1
github.com/dchest/uniuri v0.0.0-20160212164326-8902c56451e9
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/google/uuid v1.1.1
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e h1:Xg+hGrY2
github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e/go.mod h1:mq7Shfa/CaixoDxiyAAc5jZ6CVBAyPaNQCGS7mkj4Ho=
github.com/coreos/go-iptables v0.6.0 h1:is9qnZMPYjLd8LYqmm/qlE+wwEgJIkTYdhV3rfZo4jk=
github.com/coreos/go-iptables v0.6.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q=
github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4=
github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec=
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down Expand Up @@ -38,3 +40,5 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Loading