Skip to content

Commit

Permalink
Release version 4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MangelMaxime committed Mar 4, 2020
1 parent 26e0d88 commit 551824a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 22 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## 4.0.0 - 2020-03-04

### Changed

* isCamelCase is now replaced by caseStrategy=CamelCase

### Added

* Added caseStrategy that accept CamelCase | PascalCase | SnakeCase

## 3.6.0 - 2019-10-24

### Added
Expand Down
44 changes: 23 additions & 21 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,34 +176,36 @@ let needsPublishing (versionRegex: Regex) (newVersion: string) projFile =
let pushNuget (newVersion: string) (projFile: string) =
let versionRegex = Regex("<Version>(.*?)</Version>", RegexOptions.IgnoreCase)

let nugetKey =
match Environment.environVarOrNone "NUGET_KEY" with
| Some nugetKey -> nugetKey
| None -> failwith "The Nuget API key must be set in a NUGET_KEY environmental variable"
if needsPublishing versionRegex newVersion projFile then

let needsPublishing = needsPublishing versionRegex newVersion projFile
let nugetKey =
match Environment.environVarOrNone "NUGET_KEY" with
| Some nugetKey -> nugetKey
| None -> failwith "The Nuget API key must be set in a NUGET_KEY environmental variable"

(versionRegex, projFile) ||> Util.replaceLines (fun line _ ->
versionRegex.Replace(line, "<Version>" + newVersion + "</Version>") |> Some)
(versionRegex, projFile) ||> Util.replaceLines (fun line _ ->
versionRegex.Replace(line, "<Version>" + newVersion + "</Version>") |> Some)

DotNet.pack (fun p ->
DotNet.Options.lift dotnetSdk.Value p
)
projFile
DotNet.pack (fun p ->
DotNet.Options.lift dotnetSdk.Value p
)
projFile

let projDir = Path.GetDirectoryName(projFile)
let projDir = Path.GetDirectoryName(projFile)

let files =
Directory.GetFiles(projDir </> "bin" </> "Release", "*.nupkg")
|> Array.find (fun nupkg -> nupkg.Contains(newVersion))
|> fun x -> [x]

if needsPublishing then
Paket.pushFiles (fun o ->
{ o with ApiKey = nugetKey
PublishUrl = "https://www.nuget.org/api/v2/package"
WorkingDir = __SOURCE_DIRECTORY__ })
files
|> (fun nupkg ->
DotNet.nugetPush (fun p ->
{ p with
PushParams =
{ p.PushParams with
ApiKey = Some nugetKey
Source = Some "nuget.org"
}
}
) nupkg
)

let versionRegex = Regex("^## ?\\[?v?([\\w\\d.-]+\\.[\\w\\d.-]+[a-zA-Z0-9])\\]?", RegexOptions.IgnoreCase)

Expand Down
2 changes: 1 addition & 1 deletion src/Thoth.Json.Net.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<RepositoryUrl>https://github.com/thoth-org/Thoth.Json.Net</RepositoryUrl>
<PackageTags>fsharp;json</PackageTags>
<Authors>Maxime Mangel</Authors>
<Version>3.6.0</Version>
<Version>4.0.0</Version>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net46</TargetFrameworks>
Expand Down

0 comments on commit 551824a

Please sign in to comment.