https://github.com/drone/drone-go
Go client for the Drone API
https://github.com/drone/drone-go
Last synced: 6 months ago
JSON representation
Go client for the Drone API
- Host: GitHub
- URL: https://github.com/drone/drone-go
- Owner: drone
- License: apache-2.0
- Created: 2015-02-12T18:58:17.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2024-07-08T16:10:16.000Z (almost 2 years ago)
- Last Synced: 2024-11-09T16:47:09.023Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 356 KB
- Stars: 269
- Watchers: 14
- Forks: 113
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# drone-go
[](https://pkg.go.dev/github.com/drone/drone-go?tab=doc)
```Go
package main
import (
"fmt"
"github.com/drone/drone-go/drone"
"golang.org/x/oauth2"
)
const (
token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"
host = "http://drone.company.com"
)
func main() {
// create an http client with oauth authentication.
config := new(oauth2.Config)
auther := config.Client(
oauth2.NoContext,
&oauth2.Token{
AccessToken: token,
},
)
// create the drone client with authenticator
client := drone.NewClient(host, auther)
// gets the current user
user, err := client.Self()
fmt.Println(user, err)
// gets the named repository information
repo, err := client.Repo("drone", "drone-go")
fmt.Println(repo, err)
}
```
## Release procedure
Run the changelog generator.
```BASH
docker run -it --rm -v "$(pwd)":/usr/local/src/your-app githubchangeloggenerator/github-changelog-generator -u drone -p drone-go -t
```
You can generate a token by logging into your GitHub account and going to Settings -> Personal access tokens.
Next we tag the PR's with the fixes or enhancements labels. If the PR does not fufil the requirements, do not add a label.
Run the changelog generator again with the future version according to semver.
```BASH
docker run -it --rm -v "$(pwd)":/usr/local/src/your-app githubchangeloggenerator/github-changelog-generator -u drone -p drone-go -t --future-release v1.0.0
```
Create your pull request for the release. Get it merged then tag the release.