# 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 pool: vmImage: "ubuntu-22.04" variables: - group: PGP_VAR_GROUP - group: SONATYPE_VAR_GROUP - group: GIT_VAR_GROUP steps: # We need a valid signing key. # The next two steps download the public and private keys from the # secure library files. - task: DownloadSecureFile@1 displayName: 'Download public key.' inputs: secureFile: public.key - task: DownloadSecureFile@1 displayName: 'Download private key.' inputs: secureFile: private.key # Import both the private and public keys into gpg for signing. - bash: | gpg --import --no-tty --batch --yes $(Agent.TempDirectory)/public.key gpg --import --no-tty --batch --yes $(Agent.TempDirectory)/private.key gpg --list-keys --keyid-format LONG gpg --list-secret-keys --keyid-format LONG displayName: 'Import signing keys.' # For creating the snapshot release with maven, we need to build a fake settings.xml # for it to read from. This is done for the master branch merges only. - bash: | cat >$(System.DefaultWorkingDirectory)/settings.xml < github $(GIT_USER_NAME) $(GIT_PAT) ossrh $(SONATYPE_USER) $(SONATYPE_PASS) $(PGP_KEYNAME) $(PGP_PASSPHRASE) github-releases markiantorno $(GIT_PACKAGE_PAT) release true $(PGP_KEYNAME) EOL displayName: 'Create .mvn/settings.xml' # 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: deploy javaHomeOption: 'JDKVersion' jdkVersionOption: '1.11' jdkArchitectureOption: 'x64' options: '--settings $(System.DefaultWorkingDirectory)/settings.xml -pl "!org.hl7.fhir.report, !org.hl7.fhir.validation.cli" -DdeployToSonatype' mavenOptions: '-Xmx4096m' publishJUnitResults: false # 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: deploy javaHomeOption: 'JDKVersion' jdkVersionOption: '1.11' jdkArchitectureOption: 'x64' options: '--settings $(System.DefaultWorkingDirectory)/settings.xml -pl "!org.hl7.fhir.report, !org.hl7.fhir.validation.cli" -Dmaven.test.skip -DdeployToGitHub' mavenOptions: '-Xmx4096m' publishJUnitResults: false