MiniScaffold 0.37.1

Edit this page

Getting Started

In this tutorial, we'll take a look at getting started with MiniScaffold and publishing your first library to NuGet and GitHub.

Prerequisites

Installing MiniScaffold

Install the dotnet template from NuGet:

dotnet new -i "MiniScaffold::*"

Then use the template to create your own library. Replace MyCoolNewLib with your own library name and MyGithubUsername with your own GitHub name. If you have trouble picking a library name then generate one.

dotnet new mini-scaffold -n MyCoolNewLib --githubUsername MyGithubUsername
cd MyCoolNewLib

This will generate a structure similar to this

.
├── CHANGELOG.md
├── Directory.Build.props
├── Directory.Build.targets
├── LICENSE.md
├── README.md
├── build
│   ├── Changelog.fs
│   ├── FsDocs.fs
│   ├── build.fs
│   ├── build.fsproj
│   └── paket.references
├── build.cmd
├── build.sh
├── docsSrc
│   ├── Explanations
│   │   └── Background.md
│   ├── How_Tos
│   │   ├── Doing_A_Thing.md
│   │   └── Doing_Another_Thing.md
│   ├── Tutorials
│   │   └── Getting_Started.md
│   ├── _menu-item_template.html
│   ├── _menu_template.html
│   ├── _template.html
│   ├── content
│   │   ├── fsdocs-custom.css
│   │   ├── fsdocs-dark.css
│   │   ├── fsdocs-light.css
│   │   ├── fsdocs-main.css
│   │   ├── navbar-fixed-left.css
│   │   └── theme-toggle.js
│   └── index.md
├── global.json
├── MyCoolNewLib.sln
├── paket.dependencies
├── paket.lock
├── src
│   ├── Directory.Build.props
│   └── MyCoolNewLib
│       ├── AssemblyInfo.fs
│       ├── Library.fs
│       ├── MyCoolNewLib.fsproj
│       └── paket.references
└── tests
    ├── Directory.Build.props
    └── MyCoolNewLib.Tests
        ├── Main.fs
        ├── Tests.fs
        ├── MyCoolNewLib.Tests.fsproj
        └── paket.references

This may look overwhelming, but we don't have to worry about all of these yet. Let's just focus on the real important ones for this tutorial.

Building your library

To make sure everything is functioning correctly, run the build command for your platform:

./build.sh //for macOS or Linux
.\build.cmd \\for Windows

You'll be flooded with a screen full of text, documenting the build processes at it currently stands. If it completes successfully you should be greeted with something similar:

---------------------------------------------------------------------
Build Time Report
---------------------------------------------------------------------
Target                   Duration
------                   --------
Clean                    00:00:00.0180266
DotnetRestore            00:00:08.1013232
DotnetBuild              00:00:09.2786467
DotnetTest               00:00:07.9084110
GenerateCoverageReport   00:00:00.8499974
DotnetPack               00:00:06.3346539
Total:                   00:00:32.6192299
Status:                  Ok
---------------------------------------------------------------------

This is FAKE telling us everything that ran, how long, and if it completed successfully.

If it does not complete successfully, either open an issue or ask on F# Slack.

Fill out README.md

The README.md comes with a lot of information but it's recommended to fill out the introduction description.

Making a Release

The release process is streamlined so you only have to start your git repository, set your NuGet keys for GitHub Actions, create CHANGELOG notes, and run the Release build target. After you've done the initial setup, you will only need to perform the last two steps for each release.

Create your Github Repository

Add your NUGET_TOKEN to your environment

Prepare your CHANGELOG.md

Then update the CHANGELOG.md with an "Unreleased" section containing release notes for this version, in KeepAChangelog format.

Here's an example of adding an Unreleased section to a CHANGELOG.md with a 0.1.0 section already released.

## [Unreleased]

### Added
- Does cool stuff! (https://github.com/MyGithubUsername/MyCoolNewLib/pull/001) (Thanks @TheAngryByrd!)

### Fixed
- Fixes that silly oversight (https://github.com/MyGithubUsername/MyCoolNewLib/pull/002) (Thanks! @baronfel)

## [0.1.0] - 2017-03-17
First release

### Added
- This release already has lots of features

[Unreleased]: https://github.com/user/MyCoolNewLib.git/compare/v0.1.0...HEAD
[0.1.0]: https://github.com/user/MyCoolNewLib.git/releases/tag/v0.1.0

macOS/Linux Parameter:

./build.sh Release 0.2.0

macOS/Linux Environment Variable:

RELEASE_VERSION=0.2.0 ./build.sh Release

Done

You have now successfully created your first OSS library that has been published to NuGet and GitHub. Congratulations!