org.hl7.fhir.core/master-branch-pipeline.yml

128 lines
4.0 KiB
YAML

# This pipeline produces a SNAPSHOT build for each of the sub modules in
# the core library, and publishes them to ossrh.
pr: none
trigger:
- master
parameters:
- name: modulesToCache
displayName: Module Target Directories to Cache
type: object
default:
modules:
- org.hl7.fhir.utilities
- org.hl7.fhir.dstu2
- org.hl7.fhir.dstu2016may
- org.hl7.fhir.dstu3
- org.hl7.fhir.r4
- org.hl7.fhir.r4b
- org.hl7.fhir.r5
- org.hl7.fhir.convertors
- org.hl7.fhir.validation
- org.hl7.fhir.validation.cli
- org.hl7.fhir.report
- name: modulesToTest
displayName: Modules to Test
type: object
default:
modules:
- utilities
- dstu2
- dstu2016may
- dstu3
- r4
- r4b
- r5
- convertors
- validation
variables:
- group: PGP_VAR_GROUP
- group: SONATYPE_VAR_GROUP
- group: GIT_VAR_GROUP
- name: MAVEN_CACHE_FOLDER
value: $(Pipeline.Workspace)/.m2/repository
jobs:
- template: setup-and-cache-job-template.yml
parameters:
modulesToCache:
${{ parameters.modulesToCache.modules }}
signArtifacts: true
- template: test-unit-jobs-template.yml
parameters:
testUnits:
- name: ubuntu_java_11
vmImage: "ubuntu-latest"
javaToolOptions:
jdkVersion: 1.11
skipJaCoCo: true
modules:
${{ parameters.modulesToTest.modules }}
- job: deploy_to_sonatype
dependsOn:
- ${{ each module in parameters.modulesToTest.modules }}:
- ubuntu_java_11_${{ module }}
pool:
vmImage: "ubuntu-latest"
steps:
- task: Cache@2
displayName: Cache maven artifacts
inputs:
key: maven | $(Build.BuildId) | artifacts
path: $(MAVEN_CACHE_FOLDER)
- template: cache-target-tasks-template.yml
parameters:
modules:
${{ parameters.modulesToCache.modules }}
- template: setup-signing-tasks-template.yml
# Deploy the SNAPSHOT artifact to sonatype nexus.
# This is done for the master branch merges only.
- task: Maven@3
displayName: 'Deploy to Sonatype staging'
inputs:
mavenPomFile: '$(System.DefaultWorkingDirectory)/pom.xml'
goals: jar:jar deploy:deploy
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
options: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) --settings $(Agent.TempDirectory)/settings.xml -pl "!org.hl7.fhir.report, !org.hl7.fhir.validation.cli" -Dmaven.test.skip -DdeployToSonatype'
mavenOptions: '-Xmx768m -Dmaven.resolver.transport=wagon'
publishJUnitResults: false
- job: deploy_to_github
dependsOn:
- ${{ each module in parameters.modulesToTest.modules }}:
- ubuntu_java_11_${{ module }}
pool:
vmImage: "ubuntu-latest"
steps:
- task: Cache@2
displayName: Cache maven artifacts
inputs:
key: maven | $(Build.BuildId) | artifacts
path: $(MAVEN_CACHE_FOLDER)
- template: cache-target-tasks-template.yml
parameters:
modules:
${{ parameters.modulesToCache.modules }}
- template: setup-signing-tasks-template.yml
# Deploy the SNAPSHOT artifact to GitHub packages.
# This is done for the master branch merges only.
- task: Maven@3
displayName: 'Deploy to GitHub packages'
inputs:
mavenPomFile: '$(System.DefaultWorkingDirectory)/pom.xml'
goals: jar:jar deploy:deploy
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
options: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) --settings $(Agent.TempDirectory)/settings.xml -pl "!org.hl7.fhir.report, !org.hl7.fhir.validation.cli" -Dmaven.test.skip -DdeployToGitHub'
mavenOptions: '-Xmx768m -Dmaven.resolver.transport=wagon'
publishJUnitResults: false