Comet/build/package-nuget.yml

147 строки
4.3 KiB
YAML

stages:
- stage: BuildPackSource
jobs:
- job: BuildCome
displayName: Build Comet
pool:
vmImage: 'windows-2019'
demands:
- MSBuild
- Xamarin.Android
steps:
- task: Bash@3
displayName: 'Version Script'
inputs:
targetType: 'inline'
script: |
echo '$(Build_BuildID)' $BUILD_BUILDID
BUILDNUMBER=$BUILD_BUILDID
VERSION=0.1.$BUILDNUMBER-beta
echo 'VERSION ' $VERSION
#if ! [ $BRANCH = master ]; then
# VERSION=1.0.$BUILDNUMBER
# echo "##vso[build.updatebuildnumber]$VERSION"
#fi;
echo "##vso[task.setvariable variable=Version]$VERSION"
- task: NuGetToolInstaller@1
displayName: Use Nuget 5.0.2
inputs:
versionSpec: '5.0.2'
- task: NuGetCommand@2
displayName: 'NuGet restore'
inputs:
restoreSolution: build/Comet-Nuget.sln
- task: MSBuild@1
displayName: 'Build Comet'
inputs:
solution: 'src/Comet/Comet.csproj'
configuration: '$(BuildConfiguration)'
- task: MSBuild@1
displayName: 'Build Xamarin.Forms.Loader.csproj'
inputs:
solution: 'src/Xamarin.Forms.Loader/Xamarin.Forms.Loader.csproj'
configuration: '$(BuildConfiguration)'
- task: MSBuild@1
displayName: 'Build Comet.Android'
inputs:
solution: 'src/Comet.Android/Comet.Android.csproj'
configuration: '$(BuildConfiguration)'
msbuildArguments: '/p:JavaSdkDirectory="$(JAVA_HOME_8_X64)"'
- task: MSBuild@1
displayName: 'Build Comet.iOS'
inputs:
solution: 'src/Comet.iOS/Comet.iOS.csproj'
configuration: '$(BuildConfiguration)'
- task: MSBuild@1
displayName: 'Build Comet.Mac'
inputs:
solution: 'src/Comet.Mac/Comet.Mac.csproj'
configuration: '$(BuildConfiguration)'
- task: MSBuild@1
displayName: 'Build Comet.Skia'
inputs:
solution: 'src/Comet.Skia/Comet.Skia.csproj'
configuration: '$(BuildConfiguration)'
- task: MSBuild@1
displayName: 'Build Comet.Skia.Android'
inputs:
solution: 'src/Comet.Skia.Android/Comet.Skia.Android.csproj'
configuration: '$(BuildConfiguration)'
msbuildArguments: '/p:JavaSdkDirectory="$(JAVA_HOME_8_X64)"'
- task: MSBuild@1
displayName: 'Build Comet.Skia.iOS'
inputs:
solution: 'src/Comet.Skia.iOS/Comet.Skia.iOS.csproj'
configuration: '$(BuildConfiguration)'
- task: MSBuild@1
displayName: 'Build Comet.Skia.Mac'
inputs:
solution: 'src/Comet.Skia.Mac/Comet.Skia.Mac.csproj'
configuration: '$(BuildConfiguration)'
- task: MSBuild@1
displayName: 'Build Comet.UWP'
inputs:
solution: 'src/Comet.UWP/Comet.UWP.csproj'
configuration: '$(BuildConfiguration)'
- task: MSBuild@1
displayName: 'Build Comet.WPF'
inputs:
solution: 'src/Comet.WPF/Comet.WPF.csproj'
configuration: '$(BuildConfiguration)'
- task: MSBuild@1
displayName: 'Build Comet.Skia.UWP'
inputs:
solution: 'src/Comet.Skia.UWP/Comet.Skia.UWP.csproj'
configuration: '$(BuildConfiguration)'
- task: MSBuild@1
displayName: 'Build Comet.Skia.WPF'
inputs:
solution: 'src/Comet.Skia.WPF/Comet.Skia.WPF.csproj'
configuration: '$(BuildConfiguration)'
- task: NuGetCommand@2
displayName: 'dotnet pack Comet.nuspec'
inputs:
command: pack
packagesToPack: 'Comet.nuspec'
versioningScheme: byEnvVar
versionEnvVar: VERSION
- task: CopyFiles@2
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: '**\*.nupkg'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop_nuget_beta'
publishLocation: 'Container'
- script: echo Publish Nuget Github the code!
- task: NuGetCommand@2
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
nuGetFeedType: 'external'
publishFeedCredentials: 'ClanceyNugetFeed'