-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (59 loc) · 2.37 KB
/
GenerateRelease-csharp.yaml
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Upload NuGet Package
on:
workflow_run:
workflows:
- 'Update Version'
types:
- 'completed'
defaults:
run:
shell: |
pwsh -noninteractive -command "try {{ $ErrorActionPreference='Stop'; . '{0}' }} catch {{ Write-Error ""FAILED: $_""; throw; }} if ((Test-Path -LiteralPath variable:\LASTEXITCODE)) {{ exit $LASTEXITCODE }}"
# Configuration Type
env:
BUILD_TYPE: 'Release'
jobs:
build-release: # Only run on successful version update action
runs-on: windows-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
steps:
- uses: actions/checkout@v3
with:
ref: '${{ github.ref }}'
fetch-depth: 0
- uses: actions/setup-dotnet@main
with:
dotnet-version: 6.0.x
- name: Build
run: dotnet build ./XamlTimers.sln -c Release
- name: Authenticate with Github NuGet Package Registry
run: dotnet nuget add source --username radj307 --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/radj307/index.json"
- name: Pack NuGet Package
run: dotnet pack ./XamlTimers.csproj --noLogo -c Release -o . --include-symbols
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: package
path: '*.nupkg'
if-no-files-found: error
- name: Upload NuGet Packages
run: foreach ($pkg in $(Get-ChildItem -Filter *.nupkg)) { dotnet nuget push $pkg.Name -k ${{ github.token }} -s https://nuget.pkg.github.com/radj307/index.json --skip-duplicate ; dotnet nuget push $pkg.Name -k ${{ secrets.NUGET_API_KEY_XAMLTIMERS }} -s https://api.nuget.org/v3/index.json --skip-duplicate }
# Create the release using the uploaded artifact on github:
create-release:
needs: build-release
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
path: ${{github.workspace}}
- run: ls -lAghR
- name: 'Create Release'
uses: softprops/action-gh-release@v1
with:
draft: true
files: |
${{github.workspace}}/package/*