Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
haraldsteinlechner committed Apr 9, 2024
2 parents 1c8601d + 978a9d3 commit 541a3a2
Show file tree
Hide file tree
Showing 160 changed files with 253,278 additions and 13,017 deletions.
44 changes: 28 additions & 16 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
{
"version": 1,
"isRoot": true,
"tools": {
"paket": {
"version": "7.0.0-alpha003",
"commands": [
"paket"
]
},
"aardpack": {
"version": "1.0.10",
"commands": [
"aardpack"
]
}
"version": 1,
"isRoot": true,
"tools": {
"paket": {
"version": "7.0.0-alpha003",
"commands": [
"paket"
]
},
"aardpack": {
"version": "1.0.10",
"commands": [
"aardpack"
]
},
"adaptify": {
"version": "1.1.9",
"commands": [
"adaptify"
]
},
"fantomas": {
"version": "6.2.3",
"commands": [
"fantomas"
]
}
}
}
}
25 changes: 5 additions & 20 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,17 @@ on:
- aardium/package.json
- .github/workflows/deploy.yml
jobs:
mac_arm64:
name: OSX (arm64)
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@v2
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Yarn Install
working-directory: aardium
run: yarn install
- name: Add Cert to Keychain
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.MAC_CERT_BASE64 }}
p12-password: ${{ secrets.MAC_CERT_PASSWORD }}

mac_x64:
name: OSX (x64)
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
architecture: 'x64'
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v1
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@ src\Aardvark.OpcViewer.psess
/aardium/build/build/
/aardium/dist
/aardium/yarn-error.log
/provex/result.obj
111 changes: 109 additions & 2 deletions Build.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ open System.IO
open Fake.Core
open Fake.Core.TargetOperators
open Fake.DotNet
open Fake.Tools
open Fake.IO.Globbing.Operators

open Fake.IO
open Fake.Api
open Fake.Tools.Git

open System.IO.Compression
open System.Runtime.InteropServices
open System.Text.RegularExpressions

initializeContext()

Expand Down Expand Up @@ -411,7 +414,7 @@ Target.create "Publish" (fun _ ->
// 1. publish exe
"src/PRo3D.Viewer/PRo3D.Viewer.fsproj" |> DotNet.publish (fun o ->
{ o with
Framework = Some "net5.0"
Framework = Some "net6.0"
Runtime = Some "win10-x64" //-p:PublishSingleFile=true -p:IncludeAllContentForSelfExtract=true
Common = { o.Common with CustomParams = Some "-p:PublishSingleFile=true -p:IncludeAllContentForSelfExtract=true -p:InPublish=True -p:DebugType=None -p:DebugSymbols=false -p:BuildInParallel=false" }
//SelfContained = Some true // https://github.com/dotnet/sdk/issues/10566#issuecomment-602111314
Expand All @@ -424,7 +427,7 @@ Target.create "Publish" (fun _ ->
// 1. publish exe
"src/PRo3D.Viewer/PRo3D.Viewer.fsproj" |> DotNet.publish (fun o ->
{ o with
Framework = Some "net5.0"
Framework = Some "net6.0"
Runtime = Some "osx-x64"
Common = { o.Common with CustomParams = Some "-p:InPublish=True -p:DebugType=None -p:DebugSymbols=false -p:BuildInParallel=false" }
//SelfContained = Some true // https://github.com/dotnet/sdk/issues/10566#issuecomment-602111314
Expand Down Expand Up @@ -600,6 +603,108 @@ Target.create "GitHubRelease" (fun _ ->
)


Target.create "Pack" (fun _ ->
let args =
[
"paket"
"pack"
"--version"
notes.NugetVersion
"--interproject-references"
"fix"
"--release-notes"
sprintf "\"%s\"" (String.concat "\\n" notes.Notes)
"--project-url"
"\"https://github.com/pro3d-space/PRo3D\""
sprintf "\"%s\"" (Path.Combine(__SOURCE_DIRECTORY__, "bin"))
]
let ret =
Process.shellExec {
ExecParams.Program = "dotnet"
WorkingDir = __SOURCE_DIRECTORY__
CommandLine = String.concat " " args
Args = []
}
if ret <> 0 then failwithf "paket failed with exit code %d" ret

"./src/opc-tool/opc-tool.fsproj" |> DotNet.pack (fun o ->
{ o with
NoRestore = true
NoBuild = true
MSBuildParams = { o.MSBuildParams with DisableInternalBinLog = true; Properties = ["Version", notes.NugetVersion] }
}
)
)

Target.create "Push" (fun _ ->
let packageNameRx = Regex @"^(?<name>[a-zA-Z_0-9\.-]+?)\.(?<version>([0-9]+\.)*[0-9]+.*?)\.nupkg$"

//if not (Git.Information.isCleanWorkingCopy ".") then
// Git.Information.showStatus "."
// failwith "repo not clean"


if File.exists "deploy.targets" then
let packages =
!!"bin/*.nupkg"
|> Seq.filter (fun path ->
let name = Path.GetFileName path
let m = packageNameRx.Match name
if m.Success then
m.Groups.["version"].Value = notes.NugetVersion
else
false
)
|> Seq.toList

let targetsAndKeys =
File.ReadAllLines "deploy.targets"
|> Array.map (fun l -> l.Split(' '))
|> Array.choose (function [|dst; key|] -> Some (dst, key) | _ -> None)
|> Array.choose (fun (dst, key) ->
let path =
Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
".ssh",
key
)
printfn "exists? %s" path
if File.exists path then
let key = File.ReadAllText(path).Trim()
Some (dst, key)
else
None
)
|> Map.ofArray


//Git.CommandHelper.directRunGitCommandAndFail "." "fetch --tags"
//Git.Branches.tag "." notes.NugetVersion

//let branch = Git.Information.getBranchName "."
//Git.Branches.pushBranch "." "origin" branch

if List.isEmpty packages then
failwith "no packages produced"

if Map.isEmpty targetsAndKeys then
failwith "no deploy targets"

for (dst, key) in Map.toSeq targetsAndKeys do
Trace.tracefn "pushing to '%s'." dst
let options (o : Paket.PaketPushParams) =
{ o with
PublishUrl = dst
ApiKey = key
WorkingDir = "bin"
}

Paket.pushFiles options packages

//Git.Branches.pushTag "." "origin" notes.NugetVersion
()
)

"Publish" ==> "GithubRelease" |> ignore

Target.create "Run" (fun _ ->
Expand All @@ -610,6 +715,8 @@ Target.create "Run" (fun _ ->
"AddNativeResources" ==> "CopyJRWrapper" ==> "Publish" |> ignore
"AddNativeResources" ==> "PublishToElectron" |> ignore
"Credits" ==> "PublishToElectron" |> ignore
"Compile" ==> "Pack" |> ignore
"Pack" ==> "Push" |> ignore

[<EntryPoint>]
let main args =
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ The process for contributing to PRo3D is optimized for easy peer reviews by the
* Discuss the feature with the community. High-frequency discussion should happen in our discord channel
* Implement the feature in a feature branch `features/[issue#]_thename` or `bugs/[issue#]_bugname`
* Create a PullRequest (PR), ask for contributors to review the PR and merge the PR when done
* For creating a new release (in develop), change the PRODUCT_RELEASE_NOTES.md / package.json accordingly. For details please look at https://github.com/pro3d-space/PRo3D/blob/main/docs/Build-Deploy-System.md
* For creating a new release, change the PRODUCT_RELEASE_NOTES.md / package.json accordingly. For details please look at https://github.com/pro3d-space/PRo3D/blob/main/docs/Build-Deploy-System.md
* The CI will trigger a build and create a tag accordingly
* Please put into the release - the version, humand readable description of the new features/fixes and references to issues etc. (in github choose the release, press edit button, apply the changes and use "publish release")
Loading

0 comments on commit 541a3a2

Please sign in to comment.