Latest. #119
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Push to Nuget | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
dotnet-version: [8.x] | |
services: | |
gotenberg: | |
image: gotenberg/gotenberg:8 | |
ports: | |
- 3000:3000 | |
env: | |
GOTENBERG_API_BASIC_AUTH_USERNAME: testuser | |
GOTENBERG_API_BASIC_AUTH_PASSWORD: testpass | |
options: >- | |
--health-cmd "curl -f http://localhost:3000/health || exit 1" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
volumes: | |
- ${{ github.workspace }}:/workspace | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Dotnet | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ matrix.dotnet-version }} | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/setup@v4.1.0 | |
with: | |
versionSpec: '6.x' | |
- name: GitVersion | |
id: gitversion | |
uses: gittools/actions/gitversion/execute@v4.1.0 | |
with: | |
useConfigFile: true | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore -c Release | |
- name: Run tests | |
run: dotnet test --no-build -c Release --verbosity normal | |
env: | |
GOTENBERG_URL: http://localhost:3000 | |
GOTENBERG_USERNAME: testuser | |
GOTENBERG_PASSWORD: testpass | |
- name: Pack | |
run: dotnet pack -c Release -p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersion }} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg | |
- name: Publish | |
if: github.event_name != 'pull_request' && (github.ref_name == 'master') | |
run: | | |
dotnet nuget push **/*.nupkg --source 'https://api.nuget.org/v3/index.json' -k ${{ secrets.NUGETKEY }} --skip-duplicate | |
dotnet nuget push **/*.snupkg --source 'https://api.nuget.org/v3/index.json' -k ${{ secrets.NUGETKEY }} --skip-duplicate |