-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipeline-public-nuget-publish.yml
73 lines (59 loc) · 1.99 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
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
trigger:
branches:
include:
- refs/tags/release-bindings-v*
pr: none
pool:
vmImage: 'macOS-12'
variables:
- group: nuget.org
steps:
- bash: |
echo "##vso[task.setvariable variable=bindingsVersion]$(cat Xamarin.FacebookSlim.iOS/Xamarin.FacebookSlim.iOS.csproj | grep '<Version>' | awk -F '[<>]' '{print $3}')"
displayName: "extract library version"
- bash: |
echo "##vso[build.updatebuildnumber]xamarin-facebookslim-ios-bindings-$(Build.SourceBranchName)-$(Build.BuildId)"
displayName: "update build name"
- bash: |
if [[ "$(Build.SourceBranchName)" != *"$(bindingsVersion)" ]]; then
echo "mismatch between tag $(Build.SourceBranchName) and nuget version $(bindingsVersion)"
exit 1
fi
displayName: "check version sanity"
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '7.0.103'
displayName: "install dotnet 7.0.103"
- bash: |
dotnet workload install ios
displayName: "install ios workload"
- bash: |
./clear.sh
displayName: "clear.sh"
- bash: |
./build.sh
displayName: "build.sh"
- bash: |
cd Xamarin.FacebookSlim.iOS
dotnet clean --configuration Release
dotnet restore
dotnet build --configuration Release
dotnet pack --configuration Release
displayName: "dotnet build and pack"
- bash: |
dotnet nuget push Xamarin.FacebookSlim.iOS/nugetoutput/Xamarin.FacebookSlim.iOS.*.nupkg -k "$(nugetOrgApiKey)" -s https://api.nuget.org/v3/index.json
displayName: "publish nuget"
- task: GitHubRelease@1
inputs:
gitHubConnection: 'github.com_thisisthekap'
repositoryName: 'thisisthekap/Xamarin.FacebookSlim.iOS'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag'
tag: '$(Build.SourceBranchName)'
title: 'Xamarin.FacebookSlim.iOS Bindings $(bindingsVersion)'
assets: 'Xamarin.FacebookSlim.iOS/nugetoutput/Xamarin.FacebookSlim.iOS.*.nupkg'
changeLogCompareToRelease: 'lastFullRelease'
changeLogType: 'issueBased'
displayName: Create GitHub Release