Skip to content
This repository was archived by the owner on Aug 29, 2026. It is now read-only.
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
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI

on:
pull_request:
push:
branches: [main]

permissions:
contents: read

jobs:
build-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # MinVer needs full history and tags

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x

- name: Restore
run: dotnet restore ArgSentry.sln

- name: Build
run: dotnet build ArgSentry.sln --configuration Release --no-restore

- name: Test with coverage
run: >
dotnet test test/ArgSentry.Test/ArgSentry.Test.csproj
--configuration Release --no-build
/p:CollectCoverage=true /p:CoverletOutputFormat=opencover
/p:CoverletOutput=./coverage/

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: test/ArgSentry.Test/coverage/coverage.opencover.xml
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release

on:
push:
branches: [main]
tags: ['v*.*.*']

permissions:
contents: write # needed to create GitHub Releases on tag pushes

jobs:
pack-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # MinVer needs full history and tags

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x

- name: Restore
run: dotnet restore ArgSentry.sln

- name: Build
run: dotnet build src/ArgSentry/ArgSentry.csproj --configuration Release --no-restore

- name: Pack
run: >
dotnet pack src/ArgSentry/ArgSentry.csproj
--configuration Release --no-build
--output ./dist

- name: Push to NuGet
run: >
dotnet nuget push "./dist/*.nupkg"
--api-key ${{ secrets.NUGET_API_KEY }}
--source https://api.nuget.org/v3/index.json
--skip-duplicate

- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: ./dist/*.nupkg
33 changes: 33 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Contributing

## Branching and Pull Requests

This project uses a trunk-based development model. `main` is the only long-lived branch.

1. Create a short-lived feature branch off `main`.
2. Open a Pull Request targeting `main`.
3. The `CI` workflow (`build-test` job) must pass.
4. Merges must result in linear history. Use squash or rebase merges.

## Releases

Releases are fully automated.

* **Prereleases:** Every merge to `main` triggers the `release.yml` workflow, which publishes a prerelease NuGet package (e.g., `3.1.0-preview.0.7`). No action is required from contributors.
* **Stable Releases:** The maintainer cuts stable releases by pushing an annotated git tag matching `vX.Y.Z` (e.g. `git tag -a v3.1.0 -m "v3.1.0" && git push origin v3.1.0`). This builds a clean `X.Y.Z` package, publishes it to NuGet, and creates a GitHub Release with auto-generated notes.

## Versioning

Versioning is handled automatically via [MinVer](https://github.com/adamralph/minver) based on git tags.

* Do not manually edit `AssemblyVersion`, `FileVersion`, or `InformationalVersion` in the `.csproj` file.
* Version numbers are derived from the latest git tag.

## Local Development

To build and test the project locally:

```bash
dotnet build
dotnet test
```
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ ArgSentry
![Nuget](https://img.shields.io/nuget/v/argsentry)
![Nuget](https://img.shields.io/nuget/dt/argsentry)

[![Build status](https://ci.appveyor.com/api/projects/status/yxa3tt4d9exdhgik?svg=true)](https://ci.appveyor.com/project/eric-davis/argsentry)
[![codecov](https://codecov.io/gh/eric-davis/ArgSentry/branch/master/graph/badge.svg)](https://codecov.io/gh/eric-davis/ArgSentry)
[![CI](https://github.com/eric-davis/ArgSentry/actions/workflows/ci.yml/badge.svg)](https://github.com/eric-davis/ArgSentry/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/eric-davis/ArgSentry/branch/main/graph/badge.svg)](https://codecov.io/gh/eric-davis/ArgSentry)

ArgSentry is a .NET / .NET Core utility library for validating method argument values.

Expand Down
15 changes: 11 additions & 4 deletions src/ArgSentry/ArgSentry.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
netstandard1.1
</TargetFrameworks>

<!-- These version properties are placeholders. Will be patched by appveyor build process. Manage version in appveyor.yml -->
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion>
<InformationalVersion>1.0.0.0</InformationalVersion>
<!-- Version is computed automatically by MinVer from git tags/history - do not set manually. -->
<MinVerTagPrefix>v</MinVerTagPrefix>
<MinVerDefaultPreReleaseIdentifiers>preview.0</MinVerDefaultPreReleaseIdentifiers>
<MinVerVerbosity>normal</MinVerVerbosity>

<Title>ArgSentry</Title>
<Description>ArgSentry is a utility class for validating method argument values.</Description>
Expand Down Expand Up @@ -52,4 +52,11 @@
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="MinVer" Version="7.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

</Project>
Loading