Skip to content

Lock HashAlgorithm instance instead of delegate #343

Lock HashAlgorithm instance instead of delegate

Lock HashAlgorithm instance instead of delegate #343

Workflow file for this run

name: CI
on:
push:
branches:
- "main"
tags:
- "v*"
pull_request:
branches:
- "main"
workflow_dispatch:
jobs:
build-windows:
name: Build & Test (Windows)
runs-on: windows-2025
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Run tests
run: dotnet test -c Release -p:CollectCoverage=false
build-linux:
name: Build, Test & Pack (Linux)
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Build
run: dotnet build -c Release
- name: Run tests
run: dotnet test --no-build -c Release
- name: Publish to Codecov
uses: codecov/codecov-action@v7
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Set Dev version
if: github.ref == 'refs/heads/main'
run: echo "VERSION=$(git describe --long --tags | sed 's/^v//;0,/-/s//./')" >> $GITHUB_ENV
- name: Set Release version
if: startsWith(github.ref, 'refs/tags/v')
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
- name: Pack NuGet artifacts
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
run: dotnet pack --no-build -c Release -p:PackageVersion="${{ env.VERSION }}" -o packages
- name: Upload artifacts
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v7
with:
name: packages
path: packages/*nupkg
github:
name: Deploy to GitHub
needs: [build-windows, build-linux]
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-24.04
steps:
- name: Download artifacts
uses: actions/download-artifact@v8
with:
name: packages
- name: Push to GitHub
run: |
dotnet nuget push "*.nupkg" \
--skip-duplicate \
-k ${{ secrets.GITHUB_TOKEN }} \
-s https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
release:
name: Create GitHub release
needs: [build-windows, build-linux]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Download artifacts
uses: actions/download-artifact@v8
with:
name: packages
path: packages
- name: Create GitHub Release
run: gh release create ${{ github.ref_name }} packages/*nupkg
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
nuget:
name: Deploy to NuGet
needs: [release]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-24.04
steps:
- name: Download artifacts
uses: actions/download-artifact@v8
with:
name: packages
- name: Push to NuGet
run: |
dotnet nuget push "*.nupkg" \
-k ${{ secrets.NUGET_KEY }} \
-s https://api.nuget.org/v3/index.json