feat(release): initial attempt at providing automatic builds

This commit is contained in:
2021-05-06 02:20:32 +01:00
parent 2054c8c0aa
commit 63289216d7
10 changed files with 811 additions and 6 deletions

View File

@@ -0,0 +1,22 @@
package main
import (
"context"
"net/http"
"github.com/google/go-github/v35/github"
"golang.org/x/oauth2"
)
func NewGitHubClient(ctx context.Context, token string) *github.Client {
var tc *http.Client
if token != "" {
ts := oauth2.StaticTokenSource(
&oauth2.Token{AccessToken: token},
)
tc = oauth2.NewClient(ctx, ts)
}
return github.NewClient(tc)
}