-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (34 loc) · 1.4 KB
/
dotnet.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
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET
on:
push:
branches: ["main", "initial"]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore .\Tilde.Translation\Tilde.Translation.csproj
- name: Project clean
run: dotnet clean
- name: Update build version
run: |
$PROJECT_FILE=".\Tilde.Translation\Tilde.Translation.csproj"
$BUILD_NUMBER="${{github.run_number}}"
echo "Build number: $BUILD_NUMBER"
(Get-Content -Path $PROJECT_FILE) -replace "(?<=<Version>)(\d+\.\d+\.\d+\.)(\d+)(?=</Version>)", "`$1$BUILD_NUMBER" | Set-Content -Path $PROJECT_FILE
- name: Build app for release
run: msbuild Tilde.Translation\Tilde.Translation.csproj -t:rebuild -property:Configuration=Release
- name: Publish to private nuget repo
run: |
$NUGET_PACKAGE_PATH=gci -r -fi *.nupkg | % { $_.FullName }
echo "Nuget package path: $NUGET_PACKAGE_PATH"
dotnet nuget push $NUGET_PACKAGE_PATH --api-key ${{ secrets.NUGET_PAT }} --source https://api.nuget.org/v3/index.json