-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (43 loc) · 1.78 KB
/
dotnet-publish-core.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
51
52
53
name: Publish AdvancedSystems.Core
on:
workflow_dispatch:
inputs:
version:
description: 'Version Number'
required: true
env:
DOTNET_VERSION: '8.0.x'
PROJECT_PATH: 'AdvancedSystems.Core\AdvancedSystems.Core.csproj'
RELEASE_DIRECTORY: '${{ github.workspace }}\output'
RELEASE_VERSION: ${{ github.event.inputs.version }}
NUGET_SOURCE: 'https://api.nuget.org/v3/index.json'
GITHUB_SOURCE: 'https://nuget.pkg.github.com/advanced-systems/index.json'
jobs:
deploy:
name: Deployment
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Set Version from Dispatch Input
run: |
$File = Resolve-Path ${{ env.PROJECT_PATH }}
$Xml = [Xml]::new()
$Xml.Load($File)
$Xml.Project.PropertyGroup.Version = '${{ env.RELEASE_VERSION }}'
$Xml.Save($File)
shell: powershell
- name: Restore Dependencies
run: dotnet restore ${{ env.PROJECT_PATH }} --configfile nuget.config
- name: Build Project
run: dotnet build ${{ env.PROJECT_PATH }} --nologo --no-restore --configuration Release
- name: Pack Project
run: dotnet pack ${{ env.PROJECT_PATH }} --nologo --no-restore --no-build --configuration Release --output ${{ env.RELEASE_DIRECTORY }}
- name: Deploy Package to GitHub
run: dotnet nuget push '${{ env.RELEASE_DIRECTORY }}\*.nupkg' --skip-duplicate --api-key ${{ secrets.GH_AUTH_TOKEN_PUSH }} --source ${{ env.GITHUB_SOURCE }}
- name: Deploy Package to NuGet
run: dotnet nuget push '${{ env.RELEASE_DIRECTORY }}\*.nupkg' --skip-duplicate --api-key ${{ secrets.NUGET_AUTH_TOKEN_PUSH }} --source ${{ env.NUGET_SOURCE }}