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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
112 changes: 56 additions & 56 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
# top-most EditorConfig file
root = true
[*]
charset = utf-8
end_of_line = crlf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
# C# code style
[*.cs]
dotnet_sort_system_directives_first = true
csharp_style_namespace_declarations = file_scoped:suggestion
csharp_prefer_primary_constructors = true:suggestion
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = true:silent
csharp_new_line_before_open_brace = all
csharp_new_line_between_query_expression_clauses = true
csharp_style_expression_bodied_methods = when_possible:suggestion
csharp_style_expression_bodied_properties = when_possible:suggestion
csharp_style_expression_bodied_accessors = when_possible:suggestion
csharp_style_prefer_switch_expression = true:suggestion
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
csharp_style_prefer_readonly_struct = true:suggestion
csharp_style_prefer_static_local_function = true:suggestion
csharp_prefer_simple_default_expression = true:suggestion
# Dotnet code style
[*.{cs,vb}]
dotnet_style_qualification_for_field = false:suggestion
dotnet_style_qualification_for_property = false:suggestion
dotnet_style_qualification_for_method = false:suggestion
dotnet_style_qualification_for_event = false:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
# Naming conventions
dotnet_naming_rule.private_fields_should_be_camel_case.symbols = private_fields
dotnet_naming_rule.private_fields_should_be_camel_case.style = camel_case
# symbol group
dotnet_naming_symbols.private_fields.applicable_kinds = field
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
# style
dotnet_naming_style.camel_case.capitalization = camel_case
# top-most EditorConfig file
root = true

[*]
charset = utf-8
end_of_line = crlf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

# C# code style
[*.cs]
dotnet_sort_system_directives_first = true
csharp_style_namespace_declarations = file_scoped:suggestion
csharp_prefer_primary_constructors = true:suggestion

csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = true:silent

csharp_new_line_before_open_brace = all
csharp_new_line_between_query_expression_clauses = true

csharp_style_expression_bodied_methods = when_possible:suggestion
csharp_style_expression_bodied_properties = when_possible:suggestion
csharp_style_expression_bodied_accessors = when_possible:suggestion

csharp_style_prefer_switch_expression = true:suggestion
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
csharp_style_prefer_readonly_struct = true:suggestion
csharp_style_prefer_static_local_function = true:suggestion
csharp_prefer_simple_default_expression = true:suggestion

# Dotnet code style
[*.{cs,vb}]
dotnet_style_qualification_for_field = false:suggestion
dotnet_style_qualification_for_property = false:suggestion
dotnet_style_qualification_for_method = false:suggestion
dotnet_style_qualification_for_event = false:suggestion

dotnet_style_null_propagation = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion

# Naming conventions
dotnet_naming_rule.private_fields_should_be_camel_case.symbols = private_fields
dotnet_naming_rule.private_fields_should_be_camel_case.style = camel_case

# symbol group
dotnet_naming_symbols.private_fields.applicable_kinds = field
dotnet_naming_symbols.private_fields.applicable_accessibilities = private

# style
dotnet_naming_style.camel_case.capitalization = camel_case

19 changes: 19 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Normalize all text files to LF in the repository (cross-platform .NET repo).
# Without this, line endings drifted (mixed CRLF/LF) because core.autocrlf was unset.
* text=auto eol=lf

# Windows-only scripts must stay CRLF
*.cmd text eol=crlf
*.bat text eol=crlf

# Binary files — never touch line endings
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.svg binary
*.pfx binary
*.snk binary
*.zip binary
*.gz binary
264 changes: 132 additions & 132 deletions .github/workflows/03-publish-prerelease.yml
Original file line number Diff line number Diff line change
@@ -1,132 +1,132 @@
name: NuGet Prerelease
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-multiplatform:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }} # branch selected in the UI
fetch-depth: 0
fetch-tags: true
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Restore dependencies
run: dotnet restore
working-directory: ./src
- name: Build solution
run: dotnet build -c Release --no-restore
working-directory: ./src
- name: Run tests
run: dotnet test -c Release --no-build --no-restore --verbosity normal --filter "Type!=Performance"
working-directory: ./src
publish-prerelease:
runs-on: ubuntu-latest
needs: test-multiplatform
permissions:
contents: read
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: '1'
DOTNET_CLI_TELEMETRY_OPTOUT: '1'
defaults:
run:
working-directory: src
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }} # same branch as tests
fetch-depth: 0
fetch-tags: true
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v3
with:
versionSpec: '6.x'
- name: Calculate version
id: gv
uses: gittools/actions/gitversion/execute@v3
- name: Build prerelease version
id: prerelease
run: |
BASE="${{ steps.gv.outputs.MajorMinorPatch }}-${{ steps.gv.outputs.PreReleaseLabel }}"
N="${{ steps.gv.outputs.CommitsSinceVersionSource }}"
VERSION="$BASE.$N"
echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV
echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "Calculated prerelease version: $VERSION"
- name: Log calculated version
run: |
echo "GitVersion SemVer (original): ${{ steps.gv.outputs.SemVer }}"
echo "Using PACKAGE_VERSION: $PACKAGE_VERSION"
- name: Restore dependencies
run: dotnet restore
working-directory: ./src
- name: Build solution
run: dotnet build -c Release --no-restore -p:Version=$PACKAGE_VERSION -p:AssemblyVersion=${{ steps.gv.outputs.AssemblySemVer }} -p:FileVersion=${{ steps.gv.outputs.AssemblySemFileVer }}
working-directory: ./src
- name: Pack NuGet packages (incl. symbols)
run: dotnet pack -c Release --no-restore /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg -o ../artifacts -p:Version=$PACKAGE_VERSION
working-directory: ./src
- name: Ensure packages exist
run: |
shopt -s nullglob
files=("$GITHUB_WORKSPACE"/artifacts/*.nupkg "$GITHUB_WORKSPACE"/artifacts/*.snupkg)
(( ${#files[@]} )) || { echo "::error ::No packages found in artifacts/"; exit 1; }
- name: Upload artifacts (audit)
uses: actions/upload-artifact@v4
with:
name: prerelease-packages-${{ env.PACKAGE_VERSION }}
path: ${{ github.workspace }}/artifacts
retention-days: 30
- name: Push prerelease to NuGet.org
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
shopt -s nullglob
for p in "$GITHUB_WORKSPACE"/artifacts/*.nupkg "$GITHUB_WORKSPACE"/artifacts/*.snupkg; do
echo "Pushing prerelease package: $p"
dotnet nuget push "$p" --source https://api.nuget.org/v3/index.json --api-key "$NUGET_API_KEY" --skip-duplicate
done
name: NuGet Prerelease

on:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test-multiplatform:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
permissions:
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }} # branch selected in the UI
fetch-depth: 0
fetch-tags: true

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

- name: Restore dependencies
run: dotnet restore
working-directory: ./src

- name: Build solution
run: dotnet build -c Release --no-restore
working-directory: ./src

- name: Run tests
run: dotnet test -c Release --no-build --no-restore --verbosity normal --filter "Type!=Performance"
working-directory: ./src


publish-prerelease:
runs-on: ubuntu-latest
needs: test-multiplatform
permissions:
contents: read
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: '1'
DOTNET_CLI_TELEMETRY_OPTOUT: '1'
defaults:
run:
working-directory: src

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }} # same branch as tests
fetch-depth: 0
fetch-tags: true

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

- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v3
with:
versionSpec: '6.x'

- name: Calculate version
id: gv
uses: gittools/actions/gitversion/execute@v3

- name: Build prerelease version
id: prerelease
run: |
BASE="${{ steps.gv.outputs.MajorMinorPatch }}-${{ steps.gv.outputs.PreReleaseLabel }}"
N="${{ steps.gv.outputs.CommitsSinceVersionSource }}"
VERSION="$BASE.$N"

echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV
echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_OUTPUT

echo "Calculated prerelease version: $VERSION"

- name: Log calculated version
run: |
echo "GitVersion SemVer (original): ${{ steps.gv.outputs.SemVer }}"
echo "Using PACKAGE_VERSION: $PACKAGE_VERSION"

- name: Restore dependencies
run: dotnet restore
working-directory: ./src

- name: Build solution
run: dotnet build -c Release --no-restore -p:Version=$PACKAGE_VERSION -p:AssemblyVersion=${{ steps.gv.outputs.AssemblySemVer }} -p:FileVersion=${{ steps.gv.outputs.AssemblySemFileVer }}
working-directory: ./src

- name: Pack NuGet packages (incl. symbols)
run: dotnet pack -c Release --no-restore /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg -o ../artifacts -p:Version=$PACKAGE_VERSION
working-directory: ./src

- name: Ensure packages exist
run: |
shopt -s nullglob
files=("$GITHUB_WORKSPACE"/artifacts/*.nupkg "$GITHUB_WORKSPACE"/artifacts/*.snupkg)
(( ${#files[@]} )) || { echo "::error ::No packages found in artifacts/"; exit 1; }

- name: Upload artifacts (audit)
uses: actions/upload-artifact@v4
with:
name: prerelease-packages-${{ env.PACKAGE_VERSION }}
path: ${{ github.workspace }}/artifacts
retention-days: 30

- name: Push prerelease to NuGet.org
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
shopt -s nullglob
for p in "$GITHUB_WORKSPACE"/artifacts/*.nupkg "$GITHUB_WORKSPACE"/artifacts/*.snupkg; do
echo "Pushing prerelease package: $p"
dotnet nuget push "$p" --source https://api.nuget.org/v3/index.json --api-key "$NUGET_API_KEY" --skip-duplicate
done
Loading
Loading