Skip to content

release-CI

release-CI #8

Workflow file for this run

name: release-CI
on:
create:
branches:
- release/**
jobs:
build:
env:
CONFIG: 'Release'
SOLUTION: 'src/Ace.CSharp.Time.sln'
TEST_PROJECT: 'src/tests/Ace.CSharp.Time.Tests/Ace.CSharp.Time.Tests.csproj'
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: 6.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 test
run: dotnet test $TEST_PROJECT --configuration $CONFIG --no-restore --no-build --verbosity normal
- 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}}