diff --git a/azure/mobile/build-xamarin-android.yml b/azure/mobile/build-xamarin-android.yml index 8b5cc49..23d39c8 100644 --- a/azure/mobile/build-xamarin-android.yml +++ b/azure/mobile/build-xamarin-android.yml @@ -103,10 +103,8 @@ parameters: stages: - stage: ${{ parameters.stage_name }} dependsOn: ${{ parameters.depends_on }} - condition: eq( variables['build_enabled'],'true') + condition: eq( ${{ parameters.build_android_enabled }},'true') variables: - - name: build_enabled - value: ${{ parameters.build_android_enabled }} - name: ANDROID_NDK_HOME value: C:\Microsoft\AndroidNDK64\android-ndk-r16b - name: ANDROID_NDK_PATH @@ -128,7 +126,6 @@ stages: # specified in the parameter secure_file_keystore_filename - task: DownloadSecureFile@1 displayName: 'Download secure file ${{ parameters.secure_file_keystore_filename }}' - condition: and( succeeded(), eq( variables['build_enabled'],'true') ) name: signing_keystore inputs: secureFile: '${{ parameters.secure_file_keystore_filename }}' @@ -141,7 +138,6 @@ stages: # whether the build output will be apk or aab - task: PowerShell@2 displayName: 'Determine packaging format' - condition: and( succeeded(), eq( variables['build_enabled'],'true') ) inputs: targetType: 'inline' script: | @@ -165,7 +161,7 @@ stages: # multiple android projects - task: PowerShell@2 displayName: 'Determine the location of the AndroidManifest.xml file' - condition: and( eq( variables['manifestPath'], ''), eq( variables['build_enabled'],'true') ) + condition: and( succeeded(), eq( variables['manifestPath'], '') ) inputs: targetType: 'inline' script: | @@ -177,7 +173,6 @@ stages: # Update the AndroidManifest.xml with the verion information - task: android-manifest-version@1 displayName: 'Setting application version in $(manifestPath)' - condition: and( succeeded(), eq( variables['build_enabled'],'true') ) inputs: sourcePath: '$(manifestPath)' versionCodeOption: 'buildid' @@ -197,7 +192,6 @@ stages: # Build the solution - task: VSBuild@1 displayName: 'Building solution ${{ parameters.solution_filename }}' - condition: and( succeeded(), eq( variables['build_enabled'],'true') ) inputs: solution: '${{ parameters.solution_filename }}' configuration: '${{ parameters.solution_build_configuration }}' @@ -218,7 +212,6 @@ stages: # have the same filename - task: CopyFiles@2 displayName: 'Copying files to artifact folder ${{ parameters.artifact_folder }}' - condition: and( succeeded(), eq( variables['build_enabled'],'true') ) inputs: contents: '$(outputSearch)' targetFolder: '$(build.artifactStagingDirectory)/${{ parameters.artifact_folder }}' @@ -228,7 +221,6 @@ stages: # Rename the application package to the name specified in the application_package parameter - task: PowerShell@2 displayName: 'Rename application package' - condition: and( succeeded(), eq( variables['build_enabled'],'true') ) inputs: targetType: 'inline' script: | @@ -245,7 +237,6 @@ stages: # Publish artifacts from this stage - task: PublishBuildArtifacts@1 displayName: 'Publishing artifacts to ${{ parameters.artifact_name }}' - condition: and( succeeded(), eq( variables['build_enabled'],'true') ) inputs: pathtoPublish: '$(build.artifactStagingDirectory)' artifactName: '${{ parameters.artifact_name }}' diff --git a/azure/mobile/build-xamarin-windows.yml b/azure/mobile/build-xamarin-windows.yml index 05b93c9..c5365e4 100644 --- a/azure/mobile/build-xamarin-windows.yml +++ b/azure/mobile/build-xamarin-windows.yml @@ -107,10 +107,8 @@ parameters: stages: - stage: ${{ parameters.stage_name }} dependsOn: ${{ parameters.depends_on }} - condition: eq( variables['build_enabled'],'true') + condition: eq( ${{ parameters.build_windows_enabled }},'true') variables: - - name: build_enabled - value: ${{ parameters.build_windows_enabled }} - name: cert_thumbprint value: '' - name: cert_subject @@ -133,7 +131,6 @@ stages: # specified in the parameter windows_cert_securefiles_filename - task: DownloadSecureFile@1 displayName: 'Download secure file ${{ parameters.windows_cert_securefiles_filename }}' - condition: and( succeeded(), eq( variables['build_enabled'],'true') ) name: signing_certificate inputs: secureFile: '${{ parameters.windows_cert_securefiles_filename }}' @@ -147,7 +144,7 @@ stages: # multiple windows projects - task: PowerShell@2 displayName: 'Determine the location of the package.appxmanifest file' - condition: and( eq( variables['manifestPath'], ''), eq( variables['build_enabled'],'true') ) + condition: and( succeeded(), eq( variables['manifestPath'], '') ) inputs: targetType: 'inline' script: | @@ -161,7 +158,7 @@ stages: # windows_upload_name parameter - task: PowerShell@2 displayName: 'Determine upload file name' - condition: and( eq( variables['windows_upload_filename'], ''), eq( variables['build_enabled'],'true') ) + condition: and( succeeded(), eq( variables['windows_upload_filename'], '') ) inputs: targetType: 'inline' script: | @@ -175,7 +172,6 @@ stages: # and subject of the certificate - task: PowerShell@2 displayName: Extract certificate thumbnail and subject - condition: and( succeeded(), eq( variables['build_enabled'],'true') ) inputs: targetType: 'inline' script: | @@ -204,7 +200,6 @@ stages: # This task updates the version number and publisher in the package.manifest file - task: MagicChunks@2 displayName: 'Updating manifest file with version number and publisher - $(manifestPath)' - condition: and( succeeded(), eq( variables['build_enabled'],'true') ) inputs: sourcePath: $(manifestPath) fileType: Xml @@ -228,7 +223,6 @@ stages: # Build the solution - task: VSBuild@1 displayName: 'Building solution ${{ parameters.solution_filename }}' - condition: and( succeeded(), eq( variables['build_enabled'],'true') ) inputs: solution: ${{ parameters.solution_filename }} msbuildArgs: '/p:AppxBundlePlatforms="${{ parameters.uwpPackagePlatforms }}" @@ -252,7 +246,6 @@ stages: # have the same filename - task: CopyFiles@2 displayName: 'Copying files to artifact folder ${{ parameters.artifact_folder }}' - condition: and( succeeded(), eq( variables['build_enabled'],'true') ) inputs: contents: '$(appxPackageDir)\**\*.*xbundle' targetFolder: '$(build.artifactStagingDirectory)/${{ parameters.artifact_folder }}' @@ -264,7 +257,6 @@ stages: # have the same filename - task: CopyFiles@2 displayName: 'Copying files to artifact folder ${{ parameters.artifact_folder }}' - condition: and( succeeded(), eq( variables['build_enabled'],'true') ) inputs: contents: '$(appxPackageDir)\**\*.*xupload' targetFolder: '$(build.artifactStagingDirectory)/${{ parameters.artifact_folder }}' @@ -274,7 +266,6 @@ stages: # Rename the application package to the name specified in the application_package parameter - task: PowerShell@2 displayName: 'Rename application package' - condition: and( succeeded(), eq( variables['build_enabled'],'true') ) inputs: targetType: 'inline' script: | @@ -286,7 +277,6 @@ stages: # Publish artifacts from this stage - task: PublishBuildArtifacts@1 - condition: and( succeeded(), eq( variables['build_enabled'],'true') ) displayName: 'Publishing artifacts to ${{ parameters.artifact_name }}' inputs: pathtoPublish: '$(build.artifactStagingDirectory)' diff --git a/azure/mobile/deploy-appcenter.yml b/azure/mobile/deploy-appcenter.yml index ec90dcb..1d829b9 100644 --- a/azure/mobile/deploy-appcenter.yml +++ b/azure/mobile/deploy-appcenter.yml @@ -132,10 +132,8 @@ parameters: stages: - stage: ${{ parameters.stage_name }} dependsOn: ${{ parameters.depends_on }} - condition: eq( variables['deploy_enabled'],'true') + condition: eq( ${{ parameters.deploy_appcenter_enabled }} ,'true') variables: - - name: deploy_enabled - value: ${{ parameters.deploy_appcenter_enabled }} - name: application_fullpath value: '$(Pipeline.Workspace)/${{ parameters.artifact_name }}/${{ parameters.artifact_folder }}/${{ parameters.application_package }}' - name: release_notes_fullpath @@ -167,7 +165,6 @@ stages: # Download the artifacts - task: DownloadBuildArtifacts@0 displayName: Download pipeline artifacts - condition: and( succeeded(), eq( variables['deploy_enabled'],'true') ) inputs: buildType: 'current' artifactName: ${{ parameters.artifact_name }} @@ -178,7 +175,7 @@ stages: - task: PowerShell@2 displayName: Use Bundletool to extract and sign APK - condition: and( and( succeeded(), eq( variables['deploy_enabled'],'true') ), contains( variables['application_fullpath'],'.aab') ) + condition: and( succeeded(), contains( variables['application_fullpath'],'.aab') ) inputs: targetType: 'inline' script: | @@ -202,7 +199,6 @@ stages: - task: AppCenterDistribute@3 displayName: 'Deploy to Visual Studio App Center' - condition: and( succeeded(), eq( variables['deploy_enabled'],'true') ) inputs: serverEndpoint: ${{ parameters.appcenter_service_connection }} appSlug: '${{ parameters.appcenter_organisation }}/${{ parameters.appcenter_applicationid }}'