mirror of
https://github.com/XFox111/GUTSchedule.git
synced 2026-04-22 06:58:01 +03:00
88 lines
2.7 KiB
YAML
88 lines
2.7 KiB
YAML
# Android pipeline config
|
|
|
|
trigger:
|
|
branches:
|
|
include:
|
|
- master
|
|
paths:
|
|
exclude:
|
|
- '*'
|
|
include:
|
|
- changelogs/android/*
|
|
|
|
pool:
|
|
vmImage: 'windows-latest'
|
|
|
|
variables:
|
|
buildConfiguration: 'Release'
|
|
outputDirectory: '$(build.binariesDirectory)/$(buildConfiguration)'
|
|
|
|
steps:
|
|
- task: NuGetToolInstaller@1
|
|
displayName: 'Install NuGet Tool'
|
|
|
|
- task: NuGetCommand@2
|
|
displayName: 'Restore Solution'
|
|
inputs:
|
|
restoreSolution: '**/*.sln'
|
|
|
|
- task: PowerShell@2
|
|
displayName: 'Update version number'
|
|
inputs:
|
|
targetType: 'inline'
|
|
script: |
|
|
(Get-Content AndroidManifest.xml -encoding UTF8 | Out-String) -replace '(?<=\bandroid:versionCode=")[^"]*', $(Build.BuildId) | set-content AndroidManifest.xml -encoding UTF8
|
|
(Get-Content AndroidManifest.xml -encoding UTF8 | Out-String) -replace '(?<=\bandroid:versionName=")[^"]*', $(Build.BuildNumber) | set-content AndroidManifest.xml -encoding UTF8
|
|
Rename-Item '$(Build.SourcesDirectory)/changelogs/android/en-IN/changelogs/android-changelog.txt' '$(Build.BuildId).txt'
|
|
Rename-Item '$(Build.SourcesDirectory)/changelogs/android/ru-RU/changelogs/android-changelog.txt' '$(Build.BuildId).txt'
|
|
workingDirectory: '$(Build.SourcesDirectory)\GUT.Schedule\GUTSchedule.Droid\Properties'
|
|
|
|
- task: XamarinAndroid@1
|
|
displayName: 'Build Solution (AppBundle)'
|
|
inputs:
|
|
projectFile: '**/**.Droid.csproj'
|
|
outputDirectory: '$(outputDirectory)'
|
|
configuration: '$(buildConfiguration)'
|
|
msbuildVersionOption: 'latest'
|
|
msbuildArchitectureOption: 'x64'
|
|
msbuildArguments: ' /t:PackageForAndroid -t:SignAndroidPackage -p:AndroidPackageFormat=aab /p:Configuration=Release'
|
|
jdkOption: 'JDKVersion'
|
|
|
|
- task: XamarinAndroid@1
|
|
displayName: 'Build Solution (APK)'
|
|
inputs:
|
|
projectFile: '**/**.Droid.csproj'
|
|
outputDirectory: '$(outputDirectory)'
|
|
configuration: 'Release (APK)'
|
|
msbuildVersionOption: 'latest'
|
|
msbuildArchitectureOption: 'x64'
|
|
jdkOption: 'JDKVersion'
|
|
|
|
- task: DeleteFiles@1
|
|
displayName: 'Delete debug files'
|
|
inputs:
|
|
SourceFolder: '$(outputDirectory)'
|
|
Contents: |
|
|
**/**.pdb
|
|
**/**.dll
|
|
|
|
- task: CopyFiles@2
|
|
displayName: 'Copy changelog to output'
|
|
inputs:
|
|
SourceFolder: '$(Build.SourcesDirectory)/changelogs'
|
|
Contents: '**'
|
|
TargetFolder: '$(outputDirectory)/changelogs'
|
|
|
|
- task: PowerShell@2
|
|
displayName: 'Update package name'
|
|
inputs:
|
|
targetType: 'inline'
|
|
script: 'get-childitem *-Signed.* | foreach { rename-item $_ $_.Name.Replace("-Signed", "") }'
|
|
workingDirectory: '$(outputDirectory)'
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
displayName: 'Drop Artifact'
|
|
inputs:
|
|
PathtoPublish: '$(outputDirectory)'
|
|
ArtifactName: 'AndroidBundle'
|
|
publishLocation: 'Container' |