Built in Targets: e.g. NonGit.Targets
- CI Tests
- Version Controller
- Nuget package publish
- Github draft
Stable | Prerelease |
---|---|
MacOS/Linux | Windows |
---|---|
dotnet tool install --global fpublisher-cli
USAGE: fpublisher.exe [--help] [--create-sln] [--clean] [--build] [--test] [--next-release] [--run-ci]
OPTIONS:
--create-sln create sln if not exists
--clean clean bin and obj
--build build solution
--test test projects
--next-release draft next release
--run-ci only invoked by CI
--help display this list of options.
Explaintion (See sample )
FPublisher try to find a solution file in below sequence
- $GitRepoName.FPubliusher.sln
- $GitRepoName.sln
- $FolderName.FPubliusher.sln
- $FolderName.sln
test projects in solution contain test
build all projects in solution
- github_token
- github_release_user
Only for repo collaborators and repo owner
Please ensure all the commits are pushed to git server and you are in default branch ReleaseNotes.MD must exists with a TBD release_Note
a list of composable FPublisher building targets
Major CI:
Appveyor (https://ci.appveyor.com/project/ts2fable-imports/fcswatch/builds/23846382)
Targets:
install paket packages
Add source link to projects
build
test
pack
publish to nuget server (Only trigger when an release is drafted)
Zip
Artifacts
Other CI E.g (circleCI)[https://circleci.com/gh/humhei/FPublisher/265?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link]
Targets:
install paket packages
build
test
let run =
Role.update (function
| Msg.Build semverInfoOp ->
{ PreviousMsgs = []
Action = MapState (fun role -> Solution.build semverInfoOp role.Solution) }
| Msg.Test ->
{ PreviousMsgs = [ Msg.Build None ]
Action = MapState (fun role -> Solution.test role.Solution) }
)
Forker
contains the NonGit
Also for state
and targets
type Role =
{ NonGit: NonGit.Role
TargetState: TargetState
NugetPacker: NugetPacker
LocalNugetServer: NugetServer option
VersionController: Lazy<VersionController> }
stored newPackages in Pack
and use it in PublishToLocalNugetServer
| Msg.Pack releaseNotes ->
{ PreviousMsgs = [!^ (NonGit.Msg.Build (Some releaseNotes.SemVer)); !^ NonGit.Msg.Test]
Action = MapState (fun role ->
let githubData = role.GitHubData
let newPackages =
NugetPacker.pack
role.Solution
true
true
githubData.Topics
githubData.License
githubData.Repository
releaseNotes
role.NugetPacker
newPackages
|> box
)
}
| Msg.PublishToLocalNugetServer ->
match role.LocalNugetServer with
| Some localNugetServer ->
let versionFromLocalNugetServer = Role.versionFromLocalNugetServer role |> Async.RunSynchronously
let nextReleaseNotes = Role.nextReleaseNotes versionFromLocalNugetServer role
{ PreviousMsgs = [ Msg.Pack nextReleaseNotes ]
Action = MapState (fun role ->
let (newPackages) = State.getResult role.TargetState.Pack
let currentVersion = VersionController.currentVersion versionFromLocalNugetServer role.VersionController.Value
logger.CurrentVersion currentVersion
let nextVersion = Role.nextVersion versionFromLocalNugetServer role
logger.ImportantGreen "Next version is %s" (SemVerInfo.normalize nextVersion)
NugetServer.publish newPackages localNugetServer |> Async.RunSynchronously
none
)
}
| None -> failwithf "local nuget server is not defined"
Please Directly contribute to this repository src/FPublisher/Roles
FcsWatch: Run standard fsharp codes in watch mode