Skip to content

docs: add MIT LICENSE file #9

docs: add MIT LICENSE file

docs: add MIT LICENSE file #9

Workflow file for this run

name: CI
on:
push:
branches: [ main, master ]
tags: [ 'v*' ]
pull_request:
branches: [ main, master ]
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_NOLOGO: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check for unresolved merge conflict markers
run: |
if grep -rIn --exclude-dir=.git -E '^(<{7}|={7}|>{7})( |$)' .; then
echo "::error::Unresolved merge conflict markers found (see above)."
exit 1
fi
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- run: dotnet restore
- run: dotnet build --configuration Release --no-restore
- run: dotnet test --configuration Release --no-build --logger "trx;LogFileName=results.trx" --results-directory ./test-results
- uses: dorny/test-reporter@v1
if: always()
with:
name: Test Results
path: test-results/*.trx
reporter: dotnet-trx
pack:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- run: dotnet restore
- run: dotnet build --configuration Release --no-restore
- name: Determine version
id: version
run: |
if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then VERSION="${GITHUB_REF#refs/tags/v}"; else VERSION="0.0.0-ci.${GITHUB_RUN_NUMBER}"; fi
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
- run: dotnet pack src/AutoHttpClient/AutoHttpClient.csproj --configuration Release --no-build --output nupkgs /p:Version=${{ steps.version.outputs.version }}
- uses: actions/upload-artifact@v4
with:
name: nuget-package
path: nupkgs/*.nupkg
- name: Publish to NuGet.org
if: startsWith(github.ref, 'refs/tags/v')
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
if [ -z "$NUGET_API_KEY" ]; then echo "::warning::NUGET_API_KEY not set"; exit 0; fi
dotnet nuget push nupkgs/*.nupkg --api-key "$NUGET_API_KEY" --source https://api.nuget.org/v3/index.json --skip-duplicate