Skip to content

refactor: unsafe calls #34

refactor: unsafe calls

refactor: unsafe calls #34

Workflow file for this run

name: Release
on:
workflow_dispatch:
push:
tags:
- '*'
jobs:
build:
name: Build, Analyze & Test
runs-on: ubuntu-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: NuGet Cache
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: ${{ runner.os}}-nuget
- name: Install .NET SDK
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.10.2
with:
versionSpec: '5.x'
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0.10.2
with:
useConfigFile: true
configFilePath: 'GitVersion.yaml'
- name: Restore
run: dotnet restore --verbosity Quiet
- name: Build
run: |
dotnet build -c release --no-restore \
-p:Version=${{ steps.gitversion.outputs.assemblySemVer }} \
-p:FileVersion=${{ steps.gitversion.outputs.assemblySemFileVer }} \
-p:InformationalVersion=${{ steps.gitversion.outputs.informationalVersion }}
- name: Test
run: dotnet test -c release --no-restore --no-build
- name: Pack
run: |
dotnet pack -c release --no-restore --no-build \
-p:PackageVersion=${{ steps.gitversion.outputs.fullSemVer }} \
-p:PackageOutputPath=${{ runner.temp }}/packages
- name: Push
run: dotnet nuget push *.nupkg -k ${{ secrets.NUGET_TOKEN }} -s https://api.nuget.org/v3/index.json --skip-duplicate
working-directory: ${{ runner.temp }}/packages