Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
38 changes: 38 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"version": "0.2",
"language": "en",
"words": [
"Dema",
"DemaConsulting",
"Dotnet",
"dotnet",
"nuget",
"nuspec",
"csproj",
"runtimeconfig",
"deps",
"freebsd",
"wasm",
"markdownlint",
"cspell",
"SBOM",
"SPDX",
"demaconsulting",
"DotnetToolWrapper",
"github",
"workflows",
"yaml"
],
"ignorePaths": [
"node_modules",
".git",
"bin",
"obj",
"drop",
"*.dll",
"*.exe",
"*.json",
".vs",
"*.bak"
]
}
25 changes: 25 additions & 0 deletions .github/workflows/build_on_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,33 @@
on: [push]

jobs:
quality-checks:
name: Quality Checks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install cspell
run: npm install -g cspell

- name: Install markdownlint-cli
run: npm install -g markdownlint-cli

- name: Run Spelling Check
run: cspell "**/*.md"

- name: Run Markdown Linting
run: markdownlint "**/*.md"

build:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
name: Build Artifacts
needs: quality-checks
uses: ./.github/workflows/build.yaml
with:
semver: '0.0.0-run.${{ github.run_number }}'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.vs
*.bak
node_modules
10 changes: 10 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"default": true,
"MD013": {
"line_length": 120,
"code_blocks": false,
"tables": false
},
"MD033": false,
"MD041": false
}
114 changes: 114 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# GitHub Copilot Agents Configuration

This repository contains configuration and instructions for GitHub Copilot agents to assist with development tasks.

## Repository Overview

**DotnetToolWrapper** is a .NET 8.0, 9.0, and 10.0 console application that serves as a wrapper for native
applications packaged as [.NET Tools](https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools).

## Project Structure

```text
DotnetToolWrapper/
├── .github/
│ └── workflows/ # GitHub Actions workflows
│ ├── build.yaml # Reusable build workflow
│ ├── build_on_push.yaml # Triggered on push events
│ └── release.yaml # Release workflow
├── src/
│ └── DemaConsulting.DotnetToolWrapper/
│ ├── Program.cs # Main application logic
│ └── DemaConsulting.DotnetToolWrapper.csproj
├── .cspell.json # Spelling check configuration
├── .markdownlint.json # Markdown linting configuration
├── README.md # Project documentation
├── LICENSE # MIT License
└── spdx-workflow.yaml # SBOM enhancement workflow
```

## Key Technologies

- **.NET 8.0, 9.0, 10.0**: Multi-targeted framework versions
- **C# 12**: Programming language
- **GitHub Actions**: CI/CD automation
- **SBOM Tools**: Software Bill of Materials generation

## Development Guidelines

### Building the Project

```bash
dotnet restore
dotnet build --configuration Release
```

### Code Standards

- **Language Version**: C# 12
- **Nullable Reference Types**: Enabled
- **Implicit Usings**: Enabled
- **Target Frameworks**: net8.0, net9.0, net10.0

### Workflow Structure

The project uses a modular workflow approach:

1. **build_on_push.yaml**: Triggers on every push, calls the reusable build workflow
2. **build.yaml**: Reusable workflow that performs the actual build, SBOM generation, and artifact upload
3. **release.yaml**: Handles release-specific tasks

### Quality Checks

Quality checks are automated through GitHub Actions:

- **Spelling**: Checked using `cspell` against `.cspell.json` configuration
- **Markdown Linting**: Validated using `markdownlint-cli` against `.markdownlint.json` configuration

## Agent Instructions

### When Working with Code

1. **Multi-targeting**: Always ensure changes are compatible with .NET 8.0, 9.0, and 10.0
2. **Cross-platform**: The tool must work on Windows, Linux, FreeBSD, and macOS
3. **Architecture Support**: Support x86, x64, ARM, ARM64, WASM, and S390x architectures

### When Modifying Workflows

1. Preserve the reusable workflow pattern
2. Update both `build.yaml` and `build_on_push.yaml` if needed
3. Ensure SBOM generation continues to work

### When Updating Documentation

1. Follow the markdown linting rules in `.markdownlint.json`
2. Check spelling against `.cspell.json` dictionary
3. Keep README.md synchronized with actual functionality

## Common Tasks

### Adding New Dependencies

Update the `.csproj` file in `src/DemaConsulting.DotnetToolWrapper/`

### Modifying Build Output

Edit the "Create Drop Folder" step in `.github/workflows/build.yaml`

### Updating Supported Frameworks

1. Modify `<TargetFrameworks>` in the `.csproj` file
2. Update workflow files to include new framework versions
3. Update the "Create Drop Folder" step to copy artifacts for new frameworks

## Testing Changes

Before committing:

1. Build locally: `dotnet build --configuration Release`
2. Run spelling checks: `npx cspell "**/*.md"`
3. Run markdown linting: `npx markdownlint "**/*.md"`

## Contact

For questions or issues, please refer to the repository's issue tracker on GitHub.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

# About

This project generates a .NET 8.0, 9.0, and 10.0 console application suitable for use in [Dotnet Tool](https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools) packages which wrap native applications.
This project generates a .NET 8.0, 9.0, and 10.0 console application suitable for use in
[Dotnet Tool](https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools) packages which wrap
native applications.

# Usage

Expand All @@ -22,7 +24,7 @@ To create a DotNet tool for an existing application:

The following is an example folder structure for a tool:

```
```text
root
|- tool.nuspec Nuspec file
|- README.md README file
Expand Down Expand Up @@ -77,7 +79,8 @@ The following is a sample DotnetToolSettings.xml file:
</DotNetCliTool>
```

The `Name` should be customized to match the desired name of the Dotnet tool. Dotnet uses this information when installing the package.
The `Name` should be customized to match the desired name of the Dotnet tool. Dotnet uses this information
when installing the package.

## DotnetToolWrapper.json

Expand All @@ -94,7 +97,8 @@ The following is a sample DotnetToolWrapper.json file indicating the program to
}
```

The target strings consist of the operating system and architecture. Supported operating systems are `win`, `linux`, `freebsd`, and `osx`. Supported architectures are `x86`, `x64`, `arm`, `arm64`, `wasm`, and `s390x`.
The target strings consist of the operating system and architecture. Supported operating systems are `win`,
`linux`, `freebsd`, and `osx`. Supported architectures are `x86`, `x64`, `arm`, `arm64`, `wasm`, and `s390x`.

## Packaging

Expand Down