Skip to content

release-CI

release-CI #40

Workflow file for this run

name: release-CI
on:
create:
branches:
- release/**
jobs:
build:
env:
CONFIG: 'Release'
SOLUTION: 'src/CatNip.Infrastructure.sln'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get build version
run: |
Import-Module .\.github\tools\get-build-version.psm1
Write-Host $Env:GITHUB_REF
$version = GetBuildVersion -VersionString $Env:GITHUB_REF
echo "BUILD_VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
shell: pwsh
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: dotnet restore
run: dotnet restore $SOLUTION
- name: dotnet build
run: dotnet build $SOLUTION --configuration $CONFIG -p:Version=$BUILD_VERSION --no-restore
- name: dotnet nuget push
if: startsWith(github.ref, 'refs/heads/release')
run: dotnet nuget push **\*.nupkg -s 'https://api.nuget.org/v3/index.json' -k ${{secrets.NUGETSECRET}}