fluentui-react-native/.ado/templates/apple-nuget-publish.yml

101 строка
3.6 KiB
YAML

parameters:
- name: skipNugetPublish
displayName: Skip Nuget Publish
type: boolean
default: false
jobs:
- job: NuGetPublish
displayName: Apple NuGet Publish
pool:
name: Azure Pipelines
vmImage: internal-macos12
os: macOS
variables:
- name: BUILDSECMON_OPT_IN
value: true
timeoutInMinutes: 90 # how long to run the job before automatically cancelling
cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them
${{ if not(parameters.skipNugetPublish) }}:
templateContext:
outputs:
- output: nuget
packagesToPush: '$(Build.ArtifactStagingDirectory)/Microsoft.FluentUI.ReactNative.*.nupkg'
packageParentPath: '$(Build.ArtifactStagingDirectory)'
publishVstsFeed: Office # Required when pushing to internal feed.
nuGetFeedType: internal # Change to external when publishing to external feed
publishPackageMetadata: true # Optional
steps:
- checkout: self
persistCredentials: true
- template: setup-repo-min-build.yml
# Clean Derived Data
- script: |
rm -rf $(Build.Repository.LocalPath)/DerivedData
displayName: 'Clean DerivedData'
- script: |
sudo gem install cocoapods
displayName: 'Install CocoaPods Environment'
- bash: |
sudo xcode-select --switch $(xcode_path)
displayName: Switch Xcode version $(xcode_version)
failOnStderr: true
- bash: |
echo "pod install --project-directory=ios"
pod install --project-directory=ios
workingDirectory: apps/fluent-tester
displayName: 'pod install iOS'
- bash: |
echo "pod install --project-directory=macos"
pod install --project-directory=macos
workingDirectory: apps/fluent-tester
displayName: 'pod install macOS'
# macOS Release
- template: apple-xcode-build.yml
parameters:
xcode_sdk: 'macosx'
xcode_workspacePath: 'apps/fluent-tester/macos/FluentTester.xcworkspace'
xcode_actions: 'build'
xcode_scheme: 'FluentTester'
xcode_configuration: 'Release'
xcode_extraArgs: '-xcconfig $(Build.Repository.LocalPath)/.ado/xcconfig/publish_overrides.xcconfig'
# iPhone Simulator Release
- template: apple-xcode-build.yml
parameters:
xcode_sdk: 'iphonesimulator'
xcode_workspacePath: 'apps/fluent-tester/ios/FluentTester.xcworkspace'
xcode_actions: 'build'
xcode_scheme: 'FluentTester'
xcode_configuration: 'Release'
xcode_extraArgs: '-xcconfig $(Build.Repository.LocalPath)/.ado/xcconfig/publish_overrides_ios_simulator.xcconfig'
# iPhone Device Release
- template: apple-xcode-build.yml
parameters:
xcode_sdk: 'iphoneos'
xcode_workspacePath: 'apps/fluent-tester/ios/FluentTester.xcworkspace'
xcode_actions: 'build'
xcode_scheme: 'FluentTester'
xcode_configuration: 'Release'
xcode_extraArgs: '-xcconfig $(Build.Repository.LocalPath)/.ado/xcconfig/publish_overrides_ios_device.xcconfig'
# generate the sanitizedBuildNumber environment variable
- bash: '.ado/scripts/generate_build_number.sh'
displayName: 'Generate Build Number'
# pack the nuspec
- task: NuGetCommand@2
displayName: 'NuGet pack'
inputs:
command: pack
packagesToPack: 'package.nuspec'
buildProperties: buildNumber=$(sanitizedBuildNumber);commitId=$(Build.SourceVersion);repoUri=$(Build.Repository.Uri)