-
Notifications
You must be signed in to change notification settings - Fork 4
62 lines (48 loc) · 2.19 KB
/
nuget-uwp.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
54
55
56
57
58
59
60
61
62
name: Yugen.Toolkit.Uwp/Build, Pack and Publish Nuget
on:
push:
branches:
- release/*
jobs:
build_pack_publish:
runs-on: windows-latest
env:
SOLUTION_FILE: Yugen.Toolkit.sln
PROJECT_CONFIGURATION: Release
PROJECT_FOLDER: Yugen.Toolkit.Uwp
PROJECT_FILE: Yugen.Toolkit.Uwp.csproj
NUGET_SOURCE_URL: https://api.nuget.org/v3/index.json
GH_NUGET_SOURCE_NAME: GitHub
GH_NUGET_SOURCE_URL: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/[email protected]
- name: Setup NuGet
uses: nuget/setup-nuget@v1
with:
nuget-api-key: ${{ secrets.NUGET_KEY }}
- name: Restore dependencies
run: nuget restore ${{ env.SOLUTION_FILE }}
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1
- name: MSBuild Build
run: msbuild ${{ env.PROJECT_FOLDER }}\${{ env.PROJECT_FILE }} /p:Configuration=${{ env.PROJECT_CONFIGURATION }}
- name: MSBuild Pack
run: msbuild ${{ env.PROJECT_FOLDER }}\${{ env.PROJECT_FILE }} /p:Configuration=${{ env.PROJECT_CONFIGURATION }} /t:pack /p:PackageVersion=${{ steps.gitversion.outputs.majorMinorPatch }}
- name: Nuget Push
run: nuget push ${{ env.PROJECT_FOLDER }}\bin\${{ env.PROJECT_CONFIGURATION }}\*.nupkg -Source ${{ env.NUGET_SOURCE_URL }} -SkipDuplicate
- name: GH Nuget Add Source
run: nuget source Add -Name ${{ env.GH_NUGET_SOURCE_NAME }} -Source ${{ env.GH_NUGET_SOURCE_URL }} -UserName ${{ github.repository_owner }} -Password ${{ secrets.PACKAGES_TOKEN }}
- name: GH Nuget SetAPIKey
run: nuget setApiKey ${{ secrets.PACKAGES_TOKEN }} -Source ${{ env.GH_NUGET_SOURCE_NAME }}
- name: GH Nuget Push
run: nuget push ${{ env.PROJECT_FOLDER }}\bin\${{ env.PROJECT_CONFIGURATION }}\*.nupkg -Source ${{ env.GH_NUGET_SOURCE_NAME }} -SkipDuplicate