-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipeline-public-nuget-publish.yml
48 lines (38 loc) · 1.44 KB
/
azure-pipeline-public-nuget-publish.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
trigger:
branches:
include:
- refs/tags/release-bindings-v*
pr: none
pool:
vmImage: 'macOS-11'
variables:
- group: nuget.org
steps:
- bash: |
echo "##vso[task.setvariable variable=bindingsVersion]$(cat Xamarin.ExoPlayerSlim/Xamarin.ExoPlayerSlim.csproj | grep '<Version>' | awk -F '[<>]' '{print $3}')"
- bash: |
echo "##vso[build.updatebuildnumber]production-xamarin-exoplayerslim-$(Build.SourceBranchName)-$(Build.BuildId)"
- bash: |
if [[ "$(Build.SourceBranchName)" != *"$(bindingsVersion)" ]]; then
echo "mismatch between tag $(Build.SourceBranchName) and nuget version $(bindingsVersion)"
exit 1
fi
- bash: |
cd Xamarin.ExoPlayerSlim
msbuild /t:Restore /p:Configuration=Release
msbuild /t:Build /p:Configuration=Release
msbuild /t:Pack /p:Configuration=Release
- bash: |
dotnet nuget push Xamarin.ExoPlayerSlim/nugetoutput/Xamarin.ExoPlayerSlim.*.nupkg -k "$(nugetOrgApiKey)" -s https://api.nuget.org/v3/index.json
- task: GitHubRelease@1
inputs:
gitHubConnection: 'github.com_thisisthekap'
repositoryName: 'thisisthekap/Xamarin.ExoPlayerSlim'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag'
tag: '$(Build.SourceBranchName)'
title: 'Xamarin.ExoPlayerSlim $(bindingsVersion)'
assets: 'Xamarin.ExoPlayerSlim/nugetoutput/Xamarin.ExoPlayerSlim.*.nupkg'
changeLogCompareToRelease: 'lastFullRelease'
changeLogType: 'issueBased'