Skip to content

Commit

Permalink
Release version 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
MangelMaxime committed Feb 20, 2020
1 parent ad9f79e commit efbb0de
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 32 deletions.
12 changes: 3 additions & 9 deletions .paket/Paket.Restore.targets
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,10 @@
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' AND Exists('$(PaketRootPath)paket.bootstrapper.exe')">$(PaketRootPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' ">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
<PaketBootStrapperExeDir Condition=" Exists('$(PaketBootStrapperExePath)') " >$([System.IO.Path]::GetDirectoryName("$(PaketBootStrapperExePath)"))\</PaketBootStrapperExeDir>

<PaketBootStrapperCommand Condition=" '$(OS)' == 'Windows_NT' ">"$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>
<PaketBootStrapperCommand Condition=" '$(OS)' != 'Windows_NT' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>

<!-- Disable automagic references for F# DotNet SDK -->
<!-- This will not do anything for other project types -->
<!-- see https://github.com/fsharp/fslang-design/blob/master/tooling/FST-1002-fsharp-in-dotnet-sdk.md -->
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>

<!-- Disable Paket restore under NCrunch build -->
<PaketRestoreDisabled Condition="'$(NCrunch)' == '1'">True</PaketRestoreDisabled>

Expand Down Expand Up @@ -136,7 +130,7 @@
<!-- Parse our simple 'paket.restore.cached' json ...-->
<PaketRestoreCachedSplitObject Include="$([System.Text.RegularExpressions.Regex]::Split(`$(PaketRestoreCachedContents)`, `{|}|,`))"></PaketRestoreCachedSplitObject>
<!-- Keep Key, Value ItemGroup-->
<PaketRestoreCachedKeyValue Include="@(PaketRestoreCachedSplitObject)"
<PaketRestoreCachedKeyValue Include="@(PaketRestoreCachedSplitObject)"
Condition=" $([System.Text.RegularExpressions.Regex]::Split(`%(Identity)`, `&quot;: &quot;`).Length) &gt; 1 ">
<Key>$([System.Text.RegularExpressions.Regex]::Split(`%(Identity)`, `": "`)[0].Replace(`"`, ``).Replace(` `, ``))</Key>
<Value>$([System.Text.RegularExpressions.Regex]::Split(`%(Identity)`, `": "`)[1].Replace(`"`, ``).Replace(` `, ``))</Value>
Expand Down Expand Up @@ -169,7 +163,7 @@
<Exec Command='$(PaketBootStrapperCommand)' Condition=" '$(PaketBootstrapperStyle)' == 'classic' AND Exists('$(PaketBootStrapperExePath)') AND !(Exists('$(PaketExePath)'))" ContinueOnError="false" />
<Error Text="Stop build because of PAKET_ERROR_ON_MSBUILD_EXEC and we need a full restore (hashes don't match)" Condition=" '$(PAKET_ERROR_ON_MSBUILD_EXEC)' == 'true' AND '$(PaketRestoreRequired)' == 'true' AND '$(PaketDisableGlobalRestore)' != 'true'" />
<Exec Command='$(PaketCommand) restore' Condition=" '$(PaketRestoreRequired)' == 'true' AND '$(PaketDisableGlobalRestore)' != 'true' " ContinueOnError="false" />

<!-- Step 2 Detect project specific changes -->
<ItemGroup>
<MyTargetFrameworks Condition="'$(TargetFramework)' != '' " Include="$(TargetFramework)"></MyTargetFrameworks>
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## 1.0.1 - 2020-02-20

* Fix build.fsx, the app was built before updating Prelude.fs

## 1.0.0 - 2020-02-20

### Fixed
Expand Down
47 changes: 25 additions & 22 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,26 @@ let copyModules = BuildTask.create "CopyModules" [ npmInstall ] {
// "Fable.Repl.Lib.fsproj"
// }

let updatePreludeREPLVersion = BuildTask.create "UpdateREPLVersion" [ ] {
let newVersion = Changelog.getLastVersion()

let reg = Regex(@"let \[<Literal>\] REPL_VERSION = ""(.*)""")
let newLines =
PRELUDE_FILE
|> File.ReadLines
|> Seq.map (fun line ->
reg.Replace(line, fun m ->
let previousVersion = m.Groups.[1].Value
if previousVersion = newVersion then
failwith "You need to update the version in the CHANGELOG.md before publishing a new version of the REPL"
else
m.Groups.[0].Value.Replace(m.Groups.[1].Value, newVersion)
)
)
|> Seq.toArray

File.WriteAllLines(PRELUDE_FILE, newLines)
}

let buildLib = BuildTask.create "BuildLib" [ copyModules ] {
Npm.run "build-lib" id
Expand Down Expand Up @@ -186,46 +206,29 @@ let buildLib = BuildTask.create "BuildLib" [ copyModules ] {
File.WriteAllLines(file, newLines)
}

let buildApp = BuildTask.create "BuildApp" [ buildLib ] {
let buildApp = BuildTask.create "BuildApp" [ updatePreludeREPLVersion.IfNeeded; buildLib ] {
Npm.run "build" id
}

let watchApp = BuildTask.create "WatchApp" [ buildLib ] {
Npm.run "start" id
}

let _release = BuildTask.create "Release" [ buildApp ] {
let _release = BuildTask.create "Release" [ updatePreludeREPLVersion; buildApp ] {
let token =
match Environment.environVarOrDefault "GITHUB_TOKEN" "" with
| s when not (String.IsNullOrWhiteSpace s) -> s
| _ -> failwith "The Github token must be set in a GITHUB_TOKEN environmental variable"

let newVersion = Changelog.getLastVersion()

let reg = Regex(@"let \[<Literal>\] REPL_VERSION = ""(.*)""")
let newLines =
PRELUDE_FILE
|> File.ReadLines
|> Seq.map (fun line ->
reg.Replace(line, fun m ->
let previousVersion = m.Groups.[1].Value
if previousVersion = newVersion then
failwith "You need to update the version in the CHANGELOG.md before publishing a new version of the REPL"
else
m.Groups.[0].Value.Replace(m.Groups.[1].Value, newVersion)
)
)
|> Seq.toArray

File.WriteAllLines(PRELUDE_FILE, newLines)
let version = Changelog.getLastVersion()

Git.Staging.stageAll CWD
let commitMsg = sprintf "Release version %s" newVersion
let commitMsg = sprintf "Release version %s" version
Git.Commit.exec CWD commitMsg
Git.Branches.push CWD

GitHub.createClientWithToken token
|> GitHub.draftNewRelease "fable-compiler" "repl" newVersion (Changelog.isPreRelease newVersion) (Changelog.getNotes newVersion)
|> GitHub.draftNewRelease "fable-compiler" "repl" version (Changelog.isPreRelease version) (Changelog.getNotes version)
// |> GitHub.uploadFile nupkg
|> GitHub.publishDraft
|> Async.RunSynchronously
Expand Down
2 changes: 1 addition & 1 deletion src/App/Prelude.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ open Fable.Core

[<RequireQualifiedAccess>]
module Literals =
let [<Literal>] REPL_VERSION = "1.0.0" // Do not edit manually
let [<Literal>] REPL_VERSION = "1.0.1" // Do not edit manually
let [<Literal>] FABLE_VERSION = "2.4.15" // Do not edit manually
let [<Literal>] STORAGE_KEY = "fable-repl"
let [<Literal>] MAX_LOGS_LENGTH = 200
Expand Down

0 comments on commit efbb0de

Please sign in to comment.