diff --git a/.gitignore b/.gitignore index 52623d6..5a105e5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,4 @@ -.travis/pubring.gpg -.travis/secring.gpg -.travis/settings.xml -.travis/secrets.tar +.travis/codesigning.asc # Created by https://www.gitignore.io/api/maven,linux,eclipse,windows,intellij # Edit at https://www.gitignore.io/?templates=maven,linux,eclipse,windows,intellij diff --git a/.travis.yml b/.travis.yml index cb70100..1a04db6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,33 +5,18 @@ java: cache: directories: - $HOME/.m2/repository + - $HOME/.yarn-cache before_install: - - if [ -n "$encrypted_64235d4acdda_key" ]; then openssl aes-256-cbc -K $encrypted_64235d4acdda_key -iv $encrypted_64235d4acdda_iv -in .travis/secrets.tar.enc -out .travis/secrets.tar -d; fi - - if [ -f ".travis/secrets.tar" ]; then tar -xvf .travis/secrets.tar -C .travis; fi + - if [ -n "$encrypted_64235d4acdda_key" ]; then openssl aes-256-cbc -K $encrypted_64235d4acdda_key -iv $encrypted_64235d4acdda_iv -in .travis/codesigning.asc.enc -out .travis/codesigning.asc -d; fi + - if [ -f ".travis/codesigning.asc" ]; then gpg --fast-import .travis/codesigning.asc; fi install: true -jobs: - include: - - stage: test - script: ./mvnw org.jacoco:jacoco-maven-plugin:prepare-agent verify sonar:sonar -B - - stage: deploy - name: "Deploy SNAPSHOT build" - script: skip - if: (branch = master) AND (type = push) - deploy: - provider: script - skip_cleanup: true - script: ./mvnw deploy -B -P release -s .travis/settings.xml -DskipTests -Dinvoker.skip - on: - branch: master - - script: skip - name: "Deploy stable build" - if: tag IS present - deploy: - provider: script - skip_cleanup: true - script: ./mvnw deploy -B -P release -s .travis/settings.xml -DskipTests -Dinvoker.skip - on: - tags: true +before_script: + - yarn global add @conveyal/maven-semantic-release semantic-release +script: + - ./mvnw org.jacoco:jacoco-maven-plugin:prepare-agent verify sonar:sonar -B + - ./mvnw clean -B # to build classes without jacoco agent for release +after_success: + - semantic-release --prepare @conveyal/maven-semantic-release --publish @semantic-release/github,@conveyal/maven-semantic-release --verify-conditions @semantic-release/github,@conveyal/maven-semantic-release --verify-release @conveyal/maven-semantic-release addons: sonarcloud: organization: "worksapplications" diff --git a/.travis/codesigning.asc.enc b/.travis/codesigning.asc.enc new file mode 100644 index 0000000..da8bdc0 Binary files /dev/null and b/.travis/codesigning.asc.enc differ diff --git a/.travis/secrets.tar.enc b/.travis/secrets.tar.enc deleted file mode 100644 index b48ed49..0000000 Binary files a/.travis/secrets.tar.enc and /dev/null differ diff --git a/.travis/settings.xml.template b/.travis/settings.xml.template deleted file mode 100644 index 52c9edc..0000000 --- a/.travis/settings.xml.template +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - ossrh - ... - ... - - - - - - release - - ... - ... - - - - diff --git a/maven-settings.xml b/maven-settings.xml new file mode 100644 index 0000000..bcfb96b --- /dev/null +++ b/maven-settings.xml @@ -0,0 +1,22 @@ + + + + ossrh + ${env.OSSRH_JIRA_USERNAME} + ${env.OSSRH_JIRA_PASSWORD} + + + + + release + + true + + + gpg + ${env.GPG_KEY_NAME} + ${env.GPG_PASSPHRASE} + + + + diff --git a/pom.xml b/pom.xml index 7912148..dc5d123 100644 --- a/pom.xml +++ b/pom.xml @@ -248,10 +248,6 @@ release - - ${basedir}/.travis/pubring.gpg - ${basedir}/.travis/secring.gpg -