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:
|
|
|
|
vmImage: "ubuntu-16.04"
|
|
|
|
|
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>
|
|
|
|
</servers>
|
|
|
|
</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
|
|
|
|
displayName: 'Deploy $(module) to Sonatype staging'
|
|
|
|
inputs:
|
|
|
|
mavenPomFile: '$(System.DefaultWorkingDirectory)/pom.xml'
|
|
|
|
goals: deploy
|
2020-09-25 15:37:05 -04:00
|
|
|
options: '--settings $(System.DefaultWorkingDirectory)/settings.xml -DdeployToSonatype'
|
|
|
|
publishJUnitResults: false
|
|
|
|
|
|
|
|
# Deploy the SNAPSHOT artifact to GitHub packages.
|
|
|
|
# This is done for the master branch merges only.
|
|
|
|
- task: Maven@3
|
|
|
|
displayName: 'Deploy $(module) to Sonatype staging'
|
|
|
|
inputs:
|
|
|
|
mavenPomFile: '$(System.DefaultWorkingDirectory)/pom.xml'
|
|
|
|
goals: deploy
|
|
|
|
options: '--settings $(System.DefaultWorkingDirectory)/settings.xml -Dmaven.test.skip -DdeployToGitHub'
|
2020-06-12 16:55:10 -04:00
|
|
|
publishJUnitResults: false
|