Skip to content

Commit 2efdc3e

Browse files
authored
GT-353 Automate release process (#566)
1 parent 5473b2e commit 2efdc3e

16 files changed

+433
-24
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ debug/
1616

1717
# direnv files
1818
.envrc
19+
20+
# vim files
21+
.DS_Store

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
- Deprecate ClientConfig.SynchronizeEndpointsInterval due to bug in implementation
2929
- [V1] Add Rename function for collections (single server only).
3030
- [V1] Fix using VST for database with non-ANSI characters
31+
- Automate release process
3132

3233
## [1.6.0](https://github.com/arangodb/go-driver/tree/v1.6.0) (2023-05-30)
3334
- Add ErrArangoDatabaseNotFound and IsExternalStorageError helper to v2

MAINTAINERS.md

+8
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,11 @@ To attach DLV debugger run tests with `DEBUG=true` flag e.g.:
2525
```shell
2626
DEBUG=true TESTOPTIONS="-test.run TestResponseHeader -test.v" make run-tests-single-json-with-auth
2727
```
28+
29+
# Release Instructions
30+
31+
1. Update CHANGELOG.md
32+
2. Make sure that GitHub access token exist in `~/.arangodb/github-token` and has read/write access for this repo.
33+
3. Run `make release-patch|minor|major` to create a release.
34+
- To release v2 version, use `make release-v2-patch|minor|major`.
35+
4. Go To GitHub and fill the description with the content of CHANGELOG.md

Makefile

+23-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
DRIVER_VERSION := 1.6.0
2-
31
PROJECT := go-driver
42
SCRIPTDIR := $(shell pwd)
53

@@ -491,6 +489,8 @@ tools: __dir_setup
491489
@GOBIN=$(TMPDIR)/bin go install github.com/google/[email protected]
492490
@echo ">> Fetching govulncheck"
493491
@GOBIN=$(TMPDIR)/bin go install golang.org/x/vuln/cmd/[email protected]
492+
@echo ">> Fetching github-release"
493+
@GOBIN=$(TMPDIR)/bin go install github.com/github-release/[email protected]
494494

495495
.PHONY: license
496496
license:
@@ -561,7 +561,24 @@ run-v2-tests-resilientsingle-with-auth:
561561
@echo "Resilient Single, with authentication, v2"
562562
@${MAKE} TEST_MODE="resilientsingle" TEST_AUTH="rootpw" __run_v2_tests
563563

564-
apply-version:
565-
@echo "Updating version to: $(DRIVER_VERSION)"
566-
@VERSION=$(DRIVER_VERSION) go generate version-driver.go
567-
@VERSION=$(DRIVER_VERSION) go generate ./v2/connection/version-driver.go
564+
GH_RELEASE := $(TMPDIR)/bin/github-release
565+
RELEASE := $(SCRIPTDIR)/tools/release
566+
V2_VERSION := ./v2/version/VERSION
567+
568+
release-patch:
569+
go run $(RELEASE) -type=patch -github-release=$(GH_RELEASE)
570+
571+
release-minor:
572+
go run $(RELEASE) -type=minor -github-release=$(GH_RELEASE)
573+
574+
release-major:
575+
go run $(RELEASE) -type=major -github-release=$(GH_RELEASE)
576+
577+
release-v2-patch:
578+
go run $(RELEASE) -type=patch -github-release=$(GH_RELEASE) -versionfile=$(V2_VERSION)
579+
580+
release-v2-minor:
581+
go run $(RELEASE) -type=minor -github-release=$(GH_RELEASE) -versionfile=$(V2_VERSION)
582+
583+
release-v2-major:
584+
go run $(RELEASE) -type=major -github-release=$(GH_RELEASE) -versionfile=$(V2_VERSION)

VERSION

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.6.0

agency/transaction.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type Transaction struct {
4343
// The argument 'clientID' should be used to mark that transaction sender uniquely.
4444
func NewTransaction(clientID string, options TransactionOptions) Transaction {
4545
if clientID == "" {
46-
clientID = fmt.Sprintf("go-driver/%s", driver.DriverVersion)
46+
clientID = fmt.Sprintf("go-driver/%s", driver.DriverVersion())
4747
}
4848

4949
return Transaction{

context.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ func setDirtyReadFlagIfRequired(ctx context.Context, wasDirty bool) {
359359

360360
// ApplyVersionHeader adds the driver version to the request.
361361
func ApplyVersionHeader(ctx context.Context, req Request) {
362-
val := fmt.Sprintf("go-driver-v1/%s", DriverVersion)
362+
val := fmt.Sprintf("go-driver-v1/%s", DriverVersion())
363363
if ctx != nil {
364364
if v := ctx.Value(keyDriverFlags); v != nil {
365365
if flags, ok := v.([]string); ok {

go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ go 1.19
55
require (
66
github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e
77
github.com/coreos/go-iptables v0.6.0
8+
github.com/coreos/go-semver v0.3.1
89
github.com/dchest/uniuri v0.0.0-20160212164326-8902c56451e9
910
github.com/golang-jwt/jwt v3.2.2+incompatible
1011
github.com/google/uuid v1.1.1

go.sum

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e h1:Xg+hGrY2
22
github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e/go.mod h1:mq7Shfa/CaixoDxiyAAc5jZ6CVBAyPaNQCGS7mkj4Ho=
33
github.com/coreos/go-iptables v0.6.0 h1:is9qnZMPYjLd8LYqmm/qlE+wwEgJIkTYdhV3rfZo4jk=
44
github.com/coreos/go-iptables v0.6.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q=
5+
github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4=
6+
github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec=
57
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
68
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
79
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -38,3 +40,5 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
3840
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
3941
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
4042
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
43+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
44+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 commit comments

Comments
 (0)