2020-06-12 16:55:10 -04:00
|
|
|
# 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:
|
2023-03-02 18:43:08 -05:00
|
|
|
vmImage: "ubuntu-22.04"
|
2020-06-12 16:55:10 -04:00
|
|
|
|
2020-06-30 11:52:45 -04:00
|
|
|
variables:
|
|
|
|
- group: PGP_VAR_GROUP
|
|
|
|
- group: SONATYPE_VAR_GROUP
|
2020-09-25 15:37:05 -04:00
|
|
|
- group: GIT_VAR_GROUP
|
2020-06-30 11:52:45 -04:00
|
|
|
|
2020-06-12 16:55:10 -04:00
|
|
|
steps:
|
2020-06-30 11:52:45 -04:00
|
|
|
# We need a valid signing key.
|
|
|
|
# The next two steps download the public and private keys from the
|
2020-06-12 16:55:10 -04:00
|
|
|
# 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 <<EOL
|
|
|
|
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
|
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
|
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
|
|
|
|
https://maven.apache.org/xsd/settings-1.0.0.xsd">
|
|
|
|
<servers>
|
|
|
|
<server>
|
2020-09-25 15:37:05 -04:00
|
|
|
<id>github</id>
|
|
|
|
<username>$(GIT_USER_NAME)</username>
|
|
|
|
<password>$(GIT_PAT)</password>
|
2020-06-12 16:55:10 -04:00
|
|
|
</server>
|
|
|
|
<server>
|
2020-09-25 15:37:05 -04:00
|
|
|
<id>ossrh</id>
|
2020-06-12 16:55:10 -04:00
|
|
|
<username>$(SONATYPE_USER)</username>
|
|
|
|
<password>$(SONATYPE_PASS)</password>
|
|
|
|
</server>
|
2020-09-25 16:42:06 -04:00
|
|
|
<server>
|
|
|
|
<id>$(PGP_KEYNAME)</id>
|
|
|
|
<passphrase>$(PGP_PASSPHRASE)</passphrase>
|
|
|
|
</server>
|
2020-11-03 09:08:21 -05:00
|
|
|
<server>
|
|
|
|
<id>github-releases</id>
|
|
|
|
<username>markiantorno</username>
|
|
|
|
<password>$(GIT_PACKAGE_PAT)</password>
|
|
|
|
</server>
|
2020-06-12 16:55:10 -04:00
|
|
|
</servers>
|
2020-09-25 16:47:46 -04:00
|
|
|
<profiles>
|
|
|
|
<profile>
|
|
|
|
<id>release</id>
|
|
|
|
<activation>
|
|
|
|
<activeByDefault>true</activeByDefault>
|
|
|
|
</activation>
|
|
|
|
<properties>
|
|
|
|
<gpg.keyname>$(PGP_KEYNAME)</gpg.keyname>
|
|
|
|
</properties>
|
|
|
|
</profile>
|
|
|
|
</profiles>
|
2020-06-12 16:55:10 -04:00
|
|
|
</settings>
|
|
|
|
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
|
2020-09-28 09:28:29 -04:00
|
|
|
displayName: 'Deploy to Sonatype staging'
|
2020-06-12 16:55:10 -04:00
|
|
|
inputs:
|
|
|
|
mavenPomFile: '$(System.DefaultWorkingDirectory)/pom.xml'
|
|
|
|
goals: deploy
|
2021-08-18 21:37:23 -04:00
|
|
|
javaHomeOption: 'JDKVersion'
|
|
|
|
jdkVersionOption: '1.11'
|
|
|
|
jdkArchitectureOption: 'x64'
|
2021-01-21 10:10:46 -05:00
|
|
|
options: '--settings $(System.DefaultWorkingDirectory)/settings.xml -pl "!org.hl7.fhir.report, !org.hl7.fhir.validation.cli" -DdeployToSonatype'
|
2020-09-25 15:37:05 -04:00
|
|
|
publishJUnitResults: false
|
|
|
|
|
|
|
|
# Deploy the SNAPSHOT artifact to GitHub packages.
|
|
|
|
# This is done for the master branch merges only.
|
|
|
|
- task: Maven@3
|
2020-09-28 09:28:29 -04:00
|
|
|
displayName: 'Deploy to GitHub packages'
|
2020-09-25 15:37:05 -04:00
|
|
|
inputs:
|
|
|
|
mavenPomFile: '$(System.DefaultWorkingDirectory)/pom.xml'
|
|
|
|
goals: deploy
|
2021-08-18 21:37:23 -04:00
|
|
|
javaHomeOption: 'JDKVersion'
|
|
|
|
jdkVersionOption: '1.11'
|
|
|
|
jdkArchitectureOption: 'x64'
|
2021-01-21 10:10:46 -05:00
|
|
|
options: '--settings $(System.DefaultWorkingDirectory)/settings.xml -pl "!org.hl7.fhir.report, !org.hl7.fhir.validation.cli" -Dmaven.test.skip -DdeployToGitHub'
|
2020-06-12 16:55:10 -04:00
|
|
|
publishJUnitResults: false
|