V2 #36

Merged
danieljsummers merged 17 commits from v2-out-the-door into main 2023-02-26 18:01:21 +00:00
5 changed files with 52 additions and 40 deletions
Showing only changes of commit e658b073ee - Show all commits

View File

@ -32,24 +32,34 @@ let zipTheme (name : string) (_ : TargetParameter) =
|> Seq.filter (fun (_, name) -> not (name.EndsWith ".zip")) |> Seq.filter (fun (_, name) -> not (name.EndsWith ".zip"))
|> Zip.zipSpec $"{releasePath}/{name}-theme.zip" |> Zip.zipSpec $"{releasePath}/{name}-theme.zip"
/// Frameworks supported by this build
let frameworks = [ "net6.0"; "net7.0" ]
/// Publish the project for the given runtime ID /// Publish the project for the given runtime ID
let publishFor rid (_ : TargetParameter) = let publishFor rid (_ : TargetParameter) =
DotNet.publish (fun opts -> { opts with Runtime = Some rid; SelfContained = Some false; NoLogo = true }) projName frameworks
|> List.iter (fun fwk ->
DotNet.publish
(fun opts ->
{ opts with Runtime = Some rid; SelfContained = Some false; NoLogo = true; Framework = Some fwk })
projName)
/// Package published output for the given runtime ID /// Package published output for the given runtime ID
let packageFor (rid : string) (_ : TargetParameter) = let packageFor rid (_ : TargetParameter) =
let path = $"{projectPath}/bin/Release/net7.0/{rid}/publish" frameworks
let prodSettings = $"{path}/appsettings.Production.json" |> List.iter (fun fwk ->
if File.exists prodSettings then File.delete prodSettings let path = $"{projectPath}/bin/Release/{fwk}/%s{rid}/publish"
[ !! $"{path}/**/*" let prodSettings = $"{path}/appsettings.Production.json"
|> Zip.filesAsSpecs path if File.exists prodSettings then File.delete prodSettings
|> Seq.map (fun (orig, dest) -> [ !! $"{path}/**/*"
orig, if dest.StartsWith "MyWebLog" then dest.Replace ("MyWebLog", "myWebLog") else dest) |> Zip.filesAsSpecs path
Seq.singleton ($"{releasePath}/admin-theme.zip", "admin-theme.zip") |> Seq.map (fun (orig, dest) ->
Seq.singleton ($"{releasePath}/default-theme.zip", "default-theme.zip") orig, if dest.StartsWith "MyWebLog" then dest.Replace ("MyWebLog", "myWebLog") else dest)
] Seq.singleton ($"{releasePath}/admin-theme.zip", "admin-theme.zip")
|> Seq.concat Seq.singleton ($"{releasePath}/default-theme.zip", "default-theme.zip")
|> Zip.zipSpec $"{releasePath}/myWebLog-{version}.{rid}.zip" ]
|> Seq.concat
|> Zip.zipSpec $"{releasePath}/myWebLog-{version}.{fwk}.{rid}.zip")
Target.create "Clean" (fun _ -> Target.create "Clean" (fun _ ->
@ -74,19 +84,21 @@ Target.create "PackageLinux" (packageFor "linux-x64")
Target.create "RepackageLinux" (fun _ -> Target.create "RepackageLinux" (fun _ ->
let workDir = $"{releasePath}/linux" let workDir = $"{releasePath}/linux"
let zipArchive = $"{releasePath}/myWebLog-{version}.linux-x64.zip" frameworks
let sh command args = |> List.iter (fun fwk ->
CreateProcess.fromRawCommand command args let zipArchive = $"{releasePath}/myWebLog-{version}.{fwk}.linux-x64.zip"
|> CreateProcess.redirectOutput let sh command args =
|> Proc.run CreateProcess.fromRawCommand command args
|> ignore |> CreateProcess.redirectOutput
Shell.mkdir workDir |> Proc.run
Zip.unzip workDir zipArchive |> ignore
Shell.cd workDir Shell.mkdir workDir
sh "chmod" [ "+x"; "./myWebLog" ] Zip.unzip workDir zipArchive
sh "tar" [ "cfj"; $"../myWebLog-{version}.linux-x64.tar.bz2"; "." ] Shell.cd workDir
Shell.cd "../.." sh "chmod" [ "+x"; "./myWebLog" ]
Shell.rm zipArchive sh "tar" [ "cfj"; $"../myWebLog-{version}.{fwk}.linux-x64.tar.bz2"; "." ]
Shell.cd "../.."
Shell.rm zipArchive)
Shell.rm_rf workDir Shell.rm_rf workDir
) )

View File

@ -1,6 +1,6 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0</TargetFramework> <TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<DebugType>embedded</DebugType> <DebugType>embedded</DebugType>
<AssemblyVersion>2.0.0.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion>
<FileVersion>2.0.0.0</FileVersion> <FileVersion>2.0.0.0</FileVersion>

View File

@ -6,13 +6,13 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="BitBadger.Npgsql.FSharp.Documents" Version="1.0.0-beta2" /> <PackageReference Include="BitBadger.Npgsql.FSharp.Documents" Version="1.0.0-beta2" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="6.0.8" /> <PackageReference Include="Microsoft.Data.Sqlite" Version="7.0.3" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="6.0.0" /> <PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.FSharpLu.Json" Version="0.11.7" /> <PackageReference Include="Microsoft.FSharpLu.Json" Version="0.11.7" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="NodaTime.Serialization.JsonNet" Version="3.0.0" /> <PackageReference Include="NodaTime.Serialization.JsonNet" Version="3.0.1" />
<PackageReference Include="Npgsql.NodaTime" Version="7.0.1" /> <PackageReference Include="Npgsql.NodaTime" Version="7.0.2" />
<PackageReference Include="RethinkDb.Driver" Version="2.3.150" /> <PackageReference Include="RethinkDb.Driver" Version="2.3.150" />
<PackageReference Include="RethinkDb.Driver.FSharp" Version="0.9.0-beta-07" /> <PackageReference Include="RethinkDb.Driver.FSharp" Version="0.9.0-beta-07" />
</ItemGroup> </ItemGroup>

View File

@ -7,8 +7,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Markdig" Version="0.30.3" /> <PackageReference Include="Markdig" Version="0.30.4" />
<PackageReference Include="Markdown.ColorCode" Version="1.0.1" /> <PackageReference Include="Markdown.ColorCode" Version="1.0.2" />
<PackageReference Include="NodaTime" Version="3.1.6" /> <PackageReference Include="NodaTime" Version="3.1.6" />
</ItemGroup> </ItemGroup>

View File

@ -23,13 +23,13 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="DotLiquid" Version="2.2.656" /> <PackageReference Include="DotLiquid" Version="2.2.682" />
<PackageReference Include="Giraffe" Version="6.0.0" /> <PackageReference Include="Giraffe" Version="6.0.0" />
<PackageReference Include="Giraffe.Htmx" Version="1.8.0" /> <PackageReference Include="Giraffe.Htmx" Version="1.8.5" />
<PackageReference Include="Giraffe.ViewEngine.Htmx" Version="1.8.0" /> <PackageReference Include="Giraffe.ViewEngine.Htmx" Version="1.8.5" />
<PackageReference Include="NeoSmart.Caching.Sqlite" Version="6.0.1" /> <PackageReference Include="NeoSmart.Caching.Sqlite" Version="6.0.1" />
<PackageReference Include="RethinkDB.DistributedCache" Version="1.0.0-rc1" /> <PackageReference Include="RethinkDB.DistributedCache" Version="1.0.0-rc1" />
<PackageReference Include="System.ServiceModel.Syndication" Version="6.0.0" /> <PackageReference Include="System.ServiceModel.Syndication" Version="7.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>