Skip to content

Instantly share code, notes, and snippets.

@TFaga
Last active February 12, 2018 23:02
Show Gist options
  • Save TFaga/b7aafef7802979649ce739c49c5fe8e7 to your computer and use it in GitHub Desktop.
Save TFaga/b7aafef7802979649ce739c49c5fe8e7 to your computer and use it in GitHub Desktop.
travis-gpg-mvn-keys.sh
<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
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository/>
<interactiveMode/>
<usePluginRegistry/>
<offline/>
<pluginGroups/>
<servers>
<server>
<id>ossrh</id>
<username>${env.OSSRH_USERNAME}</username>
<password>${env.OSSRH_PASSWORD}</password>
</server>
</servers>
<mirrors/>
<proxies/>
<profiles>
<profile>
<id>ossrh</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.keyname>KEYID</gpg.keyname>
<gpg.secretKeyring>~/build/${env.TRAVIS_REPO_SLUG}/gpg.key</gpg.secretKeyring>
<gpg.publicKeyring>~/build/${env.TRAVIS_REPO_SLUG}/gpg.pub</gpg.publicKeyring>
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
</properties>
</profile>
</profiles>
<activeProfiles/>
</settings>
gpg --export-secret-key KEYID > gpg.key
gpg --export KEYID > gpg.pub
tar zcvf gpg.tar.gz gpg.pub gpg.key
travis encrypt-file gpg.tar.gz --add
travis encrypt OSSRH_USERNAME=TFaga --add
travis encrypt OSSRH_PASSWORD=pass --add
# tar zxvf gpg.tar.gz
# OSSRH_PASSWORD=pass
# OSSRH_USERNAME=TFaga
# GPG_PASSPHRASE=pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment