Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Loom.Build/Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public async Task Init(bool force = false)
await Setup.InitializeWorkspace(selectedSln, selectedProj, force);
await Setup.InitializeWorkflows(force);
await Setup.InitializeDependabot(force);
await Setup.InitializeInstructionsMd();
}
catch (Exception ex)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Loom.Build/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"loom.example": {
"commandName": "Project",
"commandLineArgs": "test",
"commandLineArgs": "init",
"workingDirectory": "C:/source/personal/typical",
}
}
Expand Down
77 changes: 77 additions & 0 deletions src/Loom.Build/Setup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,81 @@ internal static async Task InitializeDependabot(bool force)
AnsiConsole.MarkupLine("[green]dependabot.yml created in .github[/]");
}
}

internal static async Task InitializeInstructionsMd()
{
var buildDir = Path.Combine(Environment.CurrentDirectory, ".build");
if (!Directory.Exists(buildDir))
Directory.CreateDirectory(buildDir);

var instructionsMd = Path.Combine(buildDir, "instructions.md");

string content = """
# Loom Build Instructions

## Prerequisites

- .NET SDK from `global.json`
- Tool manifest in `dotnet-tools.json`

Install/restore tools:

```bash
dotnet tool restore
```

Required tools and dependent Loom modules:

| Tool Command | Tool Package | Dependent Module(s) |
| --- | --- | --- |
| `loom` | `loom.build` | CLI entry point used to run all targets/modules |
| `minver` | `minver-cli` | `MinVerModule` |
| `vpk` | `vpk` | `VelopackReleaseModule` |
| `reportgenerator` | `dotnet-reportgenerator-globaltool` | `ReportGeneratorModule` |

## Setup

Initialize Loom files:

```bash
dotnet loom init
```

Run tests:

```bash
dotnet loom test
```

Run release pipeline:

```bash
dotnet loom release
```

## Enable NuGet and GitHub Releases

To allow upload/publishing modules to run, enable the following flags in `.build/loom.json`:

```json
{
"workspace": {
"enableNugetUpload": true,
"enableGithubRelease": true
}
}
```

Also configure required GitHub secrets:

- `GITHUB_TOKEN` is the built-in GitHub Actions token (`secrets.GITHUB_TOKEN`).
- Create a repository secret named `NUGET_API_KEY`.

See release workflow setup in [.github/workflows/release.yml](../.github/workflows/release.yml).

""";

await File.WriteAllTextAsync(instructionsMd, content);
AnsiConsole.MarkupLine("[green]instructions.md updated in .build[/]");
}
}
Loading