GitHub Module
Contains tasks to interact with GitHub releases
Example
Target.create "GitHubRelease" (fun _ ->
let token =
match Environment.environVarOrDefault "github_token" "" with
| s when not (System.String.IsNullOrWhiteSpace s) -> s
| _ -> failwith "please set the github_token environment variable to a github personal access token with repro access."
let files =
runtimes @ [ "portable"; "packages" ]
|> List.map (fun n -> sprintf "release/dotnetcore/Fake.netcore/fake-dotnetcore-%s.zip" n)
GitHub.createClientWithToken token
|> GitHub.draftNewRelease gitOwner gitName release.NugetVersion (release.SemVer.PreRelease <> None) release.Notes
|> GitHub.uploadFiles files
|> GitHub.publishDraft
|> Async.RunSynchronously)
Types
Type | Description |
Functions and values
Function or value | Description |
Full Usage:
GitHub.createClient user password
Parameters:
string
-
The user name
password : string
-
The user password
Returns: Async<GitHubClient>
|
|
Full Usage:
GitHub.createClientWithToken token
Parameters:
string
-
The authentication token
Returns: Async<GitHubClient>
|
|
Full Usage:
GitHub.createGHEClient url user password
Parameters:
string
user : string
-
The user name
password : string
-
The user password
Returns: Async<GitHubClient>
|
Creates a GitHub API v3 client to GitHub Enterprise server at the specified url using the specified credentials
|
Full Usage:
GitHub.createGHEClientWithToken url token
Parameters:
string
-
The GitHub enterprise server URL
token : string
-
The authentication token
Returns: Async<GitHubClient>
|
Creates a GitHub API v3 client to GitHub Enterprise server at the specified url using the specified token
|
Full Usage:
GitHub.createPullRequest owner repoName pullRequest client
Parameters:
string
-
The owner of the repository - GitHub handle
repoName : string
-
The repository name
pullRequest : NewPullRequest
-
The pull request information, including source and destination branches
client : Async<GitHubClient>
-
The GitHub client to use for communication
Returns: Async<Async<PullRequest>>
|
Example
|
Full Usage:
GitHub.createRelease owner repoName tagName setParams client
Parameters:
string
-
The repository's owner
repoName : string
-
The repository's name
tagName : string
-
The name of the tag to use for this release
setParams : CreateReleaseParams -> CreateReleaseParams
-
Function used to override the default release parameters
client : Async<GitHubClient>
-
GitHub API v3 client
Returns: Async<Release>
|
|
|
|
|
|
Full Usage:
GitHub.draftNewRelease owner repoName tagName prerelease notes client
Parameters:
string
-
The repository's owner
repoName : string
-
The repository's name
tagName : string
-
The name of the tag to use for this release
prerelease : bool
-
Indicates whether the release will be created as a prerelease
notes : seq<string>
-
Collection of release notes that will be inserted into the body of the release
client : Async<GitHubClient>
-
GitHub API v3 client
Returns: Async<Release>
|
|
Full Usage:
GitHub.getLastRelease owner repoName client
Parameters:
string
-
The owner of the repository - GitHub handle
repoName : string
-
The repository name
client : Async<GitHubClient>
-
The GitHub client to use for communication
Returns: Async<Release>
|
|
Full Usage:
GitHub.getReleaseByTag owner repoName tagName client
Parameters:
string
-
The owner of the repository - GitHub handle
repoName : string
-
The repository name
tagName : string
-
The tag to retrieve release for
client : Async<GitHubClient>
-
The GitHub client to use for communication
Returns: Async<Release>
|
|
|
|
|
|
|