FAKE - F# Make - A DSL for build tasks and more FAKE
6.1.3

Lookig for older versions of the documentation, pre FAKE v6? See 

v5.fake.build

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

CreateReleaseParams

The release creation parameters

Release

The release parameters

Functions and values

Function or value Description

GitHub.createClient user password

Full Usage: GitHub.createClient user password

Parameters:
    user : string - The user name
    password : string - The user password

Returns: Async<GitHubClient>

Creates a GitHub API v3 client using the specified credentials

user : string

The user name

password : string

The user password

Returns: Async<GitHubClient>

GitHub.createClientWithToken token

Full Usage: GitHub.createClientWithToken token

Parameters:
    token : string - The authentication token

Returns: Async<GitHubClient>

Creates a GitHub API v3 client using the specified token

token : string

The authentication token

Returns: Async<GitHubClient>

GitHub.createGHEClient url user password

Full Usage: GitHub.createGHEClient url user password

Parameters:
    url : 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

url : string
user : string

The user name

password : string

The user password

Returns: Async<GitHubClient>

GitHub.createGHEClientWithToken url token

Full Usage: GitHub.createGHEClientWithToken url token

Parameters:
    url : 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

url : string

The GitHub enterprise server URL

token : string

The authentication token

Returns: Async<GitHubClient>

GitHub.createPullRequest owner repoName pullRequest client

Full Usage: GitHub.createPullRequest owner repoName pullRequest client

Parameters:
    owner : 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>>

Create a pull request on the specified repository.

owner : 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


 let pullRequest = new PullRequest("Bump FAKE runner version", "version-branch", "master")

 GitHub.createClientWithToken token
 |> GitHub.createPullRequest "fsprojects" "fake" pullRequest
 |> Async.RunSynchronously

GitHub.createRelease owner repoName tagName setParams client

Full Usage: GitHub.createRelease owner repoName tagName setParams client

Parameters:
    owner : 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>

Creates a GitHub Release for the specified repository and tag name

owner : 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>

GitHub.downloadAsset id destination release

Full Usage: GitHub.downloadAsset id destination release

Parameters:
    id : int - The id of the asset to download
    destination : string - The download destination
    release : Async<Release> - The release to act upon

Returns: Async<unit>

Downloads the asset with the specified id to the specified destination

id : int

The id of the asset to download

destination : string

The download destination

release : Async<Release>

The release to act upon

Returns: Async<unit>

GitHub.downloadAssets destination release

Full Usage: GitHub.downloadAssets destination release

Parameters:
    destination : string - The download destination
    release : Async<Release> - The release to act upon

Returns: Async<unit>

Downloads all assets for the specified release to the specified destination

destination : string

The download destination

release : Async<Release>

The release to act upon

Returns: Async<unit>

GitHub.draftNewRelease owner repoName tagName prerelease notes client

Full Usage: GitHub.draftNewRelease owner repoName tagName prerelease notes client

Parameters:
    owner : 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>

Creates a draft GitHub Release for the specified repository and tag name

owner : 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>

GitHub.getLastRelease owner repoName client

Full Usage: GitHub.getLastRelease owner repoName client

Parameters:
    owner : 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>

Gets the latest release for the specified repository

owner : 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>

GitHub.getReleaseByTag owner repoName tagName client

Full Usage: GitHub.getReleaseByTag owner repoName tagName client

Parameters:
    owner : 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>

Gets release with the specified tag for the specified repository

owner : 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>

GitHub.publishDraft release

Full Usage: GitHub.publishDraft release

Parameters:
Returns: Async<unit>

Publishes the specified release by removing its draft status

release : Async<Release>

The release to publish

Returns: Async<unit>

GitHub.uploadFile fileName release

Full Usage: GitHub.uploadFile fileName release

Parameters:
    fileName : string - The name of the file to upload
    release : Async<Release> - The release to create

Returns: Async<Release>

Uploads and attaches the specified file to the specified release

fileName : string

The name of the file to upload

release : Async<Release>

The release to create

Returns: Async<Release>

GitHub.uploadFiles fileNames release

Full Usage: GitHub.uploadFiles fileNames release

Parameters:
    fileNames : seq<string> - The list of files names to upload
    release : Async<Release> - The release to create

Returns: Async<Release>

Uploads and attaches the specified files to the specified release

fileNames : seq<string>

The list of files names to upload

release : Async<Release>

The release to create

Returns: Async<Release>