Skip to content

Commit

Permalink
Bump version to 0.1.8-alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
eiriktsarpalis committed Dec 14, 2015
1 parent 9eec89d commit 1a88866
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 6 deletions.
Binary file added .paket/paket.bootstrapper.exe
Binary file not shown.
5 changes: 4 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 0.1.8-alpha - Dec 14, 2015
* Update FsPickler dependency.

### 0.1.7-alpha - Dec 11, 2015
* Update FsPickler dependency.

Expand Down Expand Up @@ -53,4 +56,4 @@
* Minor Additions

### 0.0.1-alpha - April 17, 2014
* Initial release
* Initial release
102 changes: 102 additions & 0 deletions paket-files/fsharp/FAKE/modules/Octokit/Octokit.fsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
#I __SOURCE_DIRECTORY__
#I @"../../../../../packages/Octokit/lib/net45"
#I @"../../../../../../packages/build/Octokit/lib/net45"
#r "Octokit.dll"

open Octokit
open System
open System.IO

type Draft =
{ Client : GitHubClient
Owner : string
Project : string
DraftRelease : Release }

let private isRunningOnMono = System.Type.GetType ("Mono.Runtime") <> null

/// A version of 'reraise' that can work inside computation expressions
let private captureAndReraise ex =
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Capture(ex).Throw()
Unchecked.defaultof<_>

/// Retry the Octokit action count times
let rec private retry count asyncF =
// This retry logic causes an exception on Mono:
// https://github.com/fsharp/fsharp/issues/440
if isRunningOnMono then
asyncF
else
async {
try
return! asyncF
with ex ->
return!
match (ex, ex.InnerException) with
| (:? AggregateException, (:? AuthorizationException as ex)) -> captureAndReraise ex
| _ when count > 0 -> retry (count - 1) asyncF
| (ex, _) -> captureAndReraise ex
}

/// Retry the Octokit action count times after input succeed
let private retryWithArg count input asycnF =
async {
let! choice = input |> Async.Catch
match choice with
| Choice1Of2 input' ->
return! (asycnF input') |> retry count
| Choice2Of2 ex ->
return captureAndReraise ex
}

let createClient user password =
async {
let github = new GitHubClient(new ProductHeaderValue("FAKE"))
github.Credentials <- Credentials(user, password)
return github
}

let createClientWithToken token =
async {
let github = new GitHubClient(new ProductHeaderValue("FAKE"))
github.Credentials <- Credentials(token)
return github
}

let private makeRelease draft owner project version prerelease (notes:seq<string>) (client : Async<GitHubClient>) =
retryWithArg 5 client <| fun client' -> async {
let data = new NewRelease(version)
data.Name <- version
data.Body <- String.Join(Environment.NewLine, notes)
data.Draft <- draft
data.Prerelease <- prerelease
let! draft = Async.AwaitTask <| client'.Release.Create(owner, project, data)
let draftWord = if data.Draft then " draft" else ""
printfn "Created%s release id %d" draftWord draft.Id
return {
Client = client'
Owner = owner
Project = project
DraftRelease = draft }
}

let createDraft owner project version prerelease notes client = makeRelease true owner project version prerelease notes client
let createRelease owner project version prerelease notes client = makeRelease false owner project version prerelease notes client

let uploadFile fileName (draft : Async<Draft>) =
retryWithArg 5 draft <| fun draft' -> async {
let fi = FileInfo(fileName)
let archiveContents = File.OpenRead(fi.FullName)
let assetUpload = new ReleaseAssetUpload(fi.Name,"application/octet-stream",archiveContents,Nullable<TimeSpan>())
let! asset = Async.AwaitTask <| draft'.Client.Release.UploadAsset(draft'.DraftRelease, assetUpload)
printfn "Uploaded %s" asset.Name
return draft'
}

let releaseDraft (draft : Async<Draft>) =
retryWithArg 5 draft <| fun draft' -> async {
let update = draft'.DraftRelease.ToUpdate()
update.Draft <- Nullable<bool>(false)
let! released = Async.AwaitTask <| draft'.Client.Release.Edit(draft'.Owner, draft'.Project, draft'.DraftRelease.Id, update)
printfn "Released %d on github" released.Id
}
3 changes: 3 additions & 0 deletions paket-files/fsharp/FAKE/modules/Octokit/paket.dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source http://nuget.org/api/v2

nuget Octokit
1 change: 1 addition & 0 deletions paket-files/fsharp/FAKE/modules/Octokit/paket.version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
25ca24118d3b0f7b51d5c72e6895b27329683b59
4 changes: 2 additions & 2 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ source https://www.nuget.org/api/v2/

nuget Nuget.CommandLine
nuget FAKE
nuget FsPickler ~> 1.6.2
nuget FsPickler >= 1.7.0
nuget FsUnit 1.3.0.1
nuget NUnit 2.6.3
nuget Unquote 2.2.2
github fsharp/FAKE modules/Octokit/Octokit.fsx
github fsharp/FAKE modules/Octokit/Octokit.fsx
6 changes: 3 additions & 3 deletions paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ REDIRECTS: ON
NUGET
remote: https://nuget.org/api/v2
specs:
FAKE (4.10.3)
FsPickler (1.6.2)
FAKE (4.10.5)
FsPickler (1.7.0)
FsUnit (1.3.0.1)
NUnit (>= 2.6.3)
Microsoft.Bcl (1.1.10)
Expand All @@ -20,5 +20,5 @@ NUGET
GITHUB
remote: fsharp/FAKE
specs:
modules/Octokit/Octokit.fsx (917a86046700e4eaaa2aa09de7895e048eaaa1b1)
modules/Octokit/Octokit.fsx (25ca24118d3b0f7b51d5c72e6895b27329683b59)
Octokit

0 comments on commit 1a88866

Please sign in to comment.