-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (39 loc) · 1.31 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: release-CI
on:
push:
branches:
- release/**
tags-ignore:
- '**'
paths-ignore:
- 'README.md'
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}}