Skip to content
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

fix(go-sdk): adding semantic release versioning #4

Merged
merged 7 commits into from
Jun 19, 2020
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
12 changes: 12 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[bumpversion]
current_version = 0.0.0
commit = True
message = Update version {current_version} -> {new_version} [skip ci]

[bumpversion:file:common/version.go]
search = const Version = "{current_version}"
replace = const Version = "{new_version}"

[bumpversion:file:README.md]
search = {current_version}
replace = {new_version}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.enc binary
21 changes: 21 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"debug": true,
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
[
"@semantic-release/exec",
{
"prepareCmd": "bump2version --allow-dirty --current-version ${lastRelease.version} --new-version ${nextRelease.version} patch"
}
],
[
"@semantic-release/git",
{
"message": "chore(release): ${nextRelease.version} release notes [skip ci]\n\n${nextRelease.notes}"
}
],
"@semantic-release/github"
]
}
20 changes: 16 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,24 @@ before_install:
- sudo apt-get install python
- nvm install 12
- npm install -g [email protected]
- openssl aes-256-cbc -K $encrypted_9d748cee9f61_key -iv $encrypted_9d748cee9f61_iv -in vpc.env.enc -out vpc.env -d
- '[ "${TRAVIS_PULL_REQUEST}" == "false" ] && openssl aes-256-cbc -K $encrypted_9d748cee9f61_key -iv $encrypted_9d748cee9f61_iv -in vpc.env.enc -out vpc.env -d || true'

install:
- curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.21.0

script:
- cd vpcclassicv1 && go test -run TestVpcClassicV1 && go test `go list ./...` -v -tags=integration -skipForMockTesting -testCount && cd ..
- cd vpcv1 && go test -run TestVpcV1 && go test `go list ./...` -v -tags=integration -skipForMockTesting -testCount && cd ..
- golangci-lint run
- make travis-ci

before_deploy:
- pip install --user bump2version
- npm install @semantic-release/changelog
- npm install @semantic-release/exec
- npm install @semantic-release/git
- npm install @semantic-release/github

deploy:
- provider: script
script: npx semantic-release
skip_cleanup: true
on:
branch: master
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Makefile

all: build lint tidy

travis-ci: build alltestgen1 alltestgen2 lint tidy

build:
go build ./...

unittest:
go test ./...

alltestgen1:
go test `go list ./... | grep vpcclassicv1` -v -tags=integration -skipForMockTesting -testCount

alltestgen2:
go test `go list ./... | grep vpcv1` -v -tags=integration -skipForMockTesting -testCount

lint:
golangci-lint run

tidy:
go mod tidy
52 changes: 27 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[![Build Status](https://travis-ci.com/IBM/vpc-go-sdk.svg?branch=master)](https://travis-ci.com/IBM/vpc-go-sdk)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/IBM/vpc-go-sdk)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)


# IBM Cloud VPC Go SDK Version 0.0.1
# IBM Cloud VPC Go SDK Version 0.0.0
Go client library to interact with the various [IBM Cloud VPC Services APIs](https://cloud.ibm.com/apidocs?category=vpc).

## Table of Contents
Expand All @@ -24,11 +26,11 @@ Go client library to interact with the various [IBM Cloud VPC Services APIs](htt
+ [Go modules](#go-modules)
+ [`dep` dependency manager](#dep-dependency-manager)
- [Using the SDK](#using-the-sdk)
- [Setting up VPC service](#setting-up-vpc-service)
- [Setting up VPC on Classic service](#setting-up-vpc-on-classic-service)
- [Questions](#questions)
- [Issues](#issues)
- [Open source @ IBM](#open-source--ibm)
- [Setting up VPC service](#setting-up-vpc-service)
- [Setting up VPC on Classic service](#setting-up-vpc-on-classic-service)
- [Contributing](#contributing)
- [License](#license)

Expand Down Expand Up @@ -92,32 +94,17 @@ to your `Gopkg.toml` file. Here is an example:
```
[[constraint]]
name = "github.com/IBM/vpc-go-sdk/vpcclassicv1"
version = "0.0.1"
version = "0.0.0"
[[constraint]]
name = "github.com/IBM/vpc-go-sdk/vpcv1"
version = "0.0.1"
version = "0.0.0"
```

then run `dep ensure`.

## Using the SDK
For general SDK usage information, please see [this link](https://github.com/IBM/ibm-cloud-sdk-common/blob/master/README.md)

## Questions

If you are having difficulties using this SDK or have a question about the IBM Cloud services,
please ask a question at
[Stack Overflow](http://stackoverflow.com/questions/ask?tags=ibm-cloud).

## Issues
If you encounter an issue with the project, you are welcome to submit a
[bug report](<github-repo-url>/issues).
Before that, please search for similar issues. It's possible that someone has already reported the problem.

## Open source @ IBM
Find more open source projects on the [IBM Github Page](http://ibm.github.io/)


## Setting up VPC service

A quick example to get you up and running with VPC Go SDK service in Dallas (us-south) region.
Expand All @@ -133,11 +120,11 @@ package main
import (
"log"

"github.com/IBM/go-sdk-core/v3/core"
"github.com/IBM/go-sdk-core/v4/core"
"github.com/IBM/vpc-go-sdk/vpcv1"
)

var IBMCLOUD_API_KEY = "YOUR_KEY_HERE" // required, Add a valid API key here
var IBMCLOUD_API_KEY = "YOUR_KEY_HERE" // required, Add a valid API key here

func main() {
// Create the IAM authenticator.
Expand Down Expand Up @@ -206,11 +193,13 @@ Refer to the [VPC on Classic Release Notes](https://cloud.ibm.com/docs/vpc-on-cl
package main

import (
"fmt"
"log"

"github.com/IBM/go-sdk-core/v4/core"
"github.com/IBM/vpc-go-sdk/vpcclassicv1"
)

var IBMCLOUD_API_KEY = "YOUR_KEY_HERE" // required, Add a valid API key here
var IBMCLOUD_API_KEY = "YOUR_KEY_HERE" // required, Add a valid API key here

func main() {
// Create the IAM authenticator.
Expand Down Expand Up @@ -269,6 +258,19 @@ func main() {
}
```

## Questions

If you are having difficulties using this SDK or have a question about the IBM Cloud services,
please ask a question at
[Stack Overflow](http://stackoverflow.com/questions/ask?tags=ibm-cloud).

## Issues
If you encounter an issue with the project, you are welcome to submit a
[bug report](<github-repo-url>/issues).
Before that, please search for similar issues. It's possible that someone has already reported the problem.

## Open source @ IBM
Find more open source projects on the [IBM Github Page](http://ibm.github.io/)

## Contributing
See [CONTRIBUTING](CONTRIBUTING.md).
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ go 1.14
require (
github.com/IBM/go-sdk-core/v4 v4.0.4
github.com/go-openapi/strfmt v0.19.5
github.com/joho/godotenv v1.3.0
github.com/onsi/ginkgo v1.13.0
github.com/onsi/gomega v1.10.1
github.com/stretchr/testify v1.6.1
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
Expand Down
Binary file modified vpc.env.enc
Binary file not shown.
Loading