From 5429c943182807cac46bb3dcf5db085578510e40 Mon Sep 17 00:00:00 2001 From: jufukuka Date: Fri, 30 Apr 2021 15:39:22 +0900 Subject: [PATCH] Change circleci/config.yml --- .circleci/.maven.xml | 11 +++++++ .circleci/config.yml | 56 +++++++++++++++++++++++++++------ pom.xml | 73 +++++++++++++++++++++++++++----------------- 3 files changed, 103 insertions(+), 37 deletions(-) create mode 100644 .circleci/.maven.xml diff --git a/.circleci/.maven.xml b/.circleci/.maven.xml new file mode 100644 index 00000000..683c3036 --- /dev/null +++ b/.circleci/.maven.xml @@ -0,0 +1,11 @@ + + + + + ossrh + ${env.SONATYPE_USERNAME} + ${env.SONATYPE_PASSWORD} + + + \ No newline at end of file diff --git a/.circleci/config.yml b/.circleci/config.yml index b6521e8f..e7dca458 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,4 +1,9 @@ -version: 2 +version: 2.1 + +orbs: + sonatype: sonatype-nexus-community/circleci-maven-release-orb@0.0.16 + sonatype-dryrun: sonatype-nexus-community/circleci-maven-release-orb@0.0.16 + jobs: build: docker: @@ -40,16 +45,10 @@ jobs: - run: mvn clean package # Save JUnit result. - - run: - name: Save test results - command: | - mkdir -p ~/junit/ - find . -type f -regex "./src/.*/target/surefire-reports/.*xml" -exec cp {} ~/junit/ \; - when: always - store_test_results: - path: ~/junit + path: target/surefire-reports - store_artifacts: - path: ~/junit + path: target/surefire-reports # run site - run: mvn site @@ -60,3 +59,42 @@ jobs: - store_artifacts: path: ~/site + +custom_filters: + master_only: &master_only + filters: + branches: + only: master + master_ignore: &master_ignore + filters: + branches: + ignore: master + +workflows: + build-and-test: + jobs: + - build: + <<: *master_ignore + run-release: + jobs: + - build: + <<: *master_only + - sonatype-dryrun/run-maven-release: + <<: *master_only + requires: + - build + mvn-release-perform-command: | + mvn --batch-mode release:perform -DdryRun=true -s .circleci/.maven.xml + mvn-release-prepare-command: | + mvn --batch-mode release:prepare -DscmCommentPrefix="[skip ci][maven-release-plugin] " -DdryRun=true -s .circleci/.maven.xml + ssh-fingerprints: b2:fa:12:27:7a:f5:b8:39:85:90:05:6d:58:8e:24:32 + - approve: + type: approval + <<: *master_only + requires: + - sonatype-dryrun/run-maven-release + - sonatype/run-maven-release: + <<: *master_only + requires: + - approve + ssh-fingerprints: b2:fa:12:27:7a:f5:b8:39:85:90:05:6d:58:8e:24:32 \ No newline at end of file diff --git a/pom.xml b/pom.xml index 26bacd89..ed9bc221 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ jp.co.yahoo.yosegi yosegi - 1.2.0 + 1.2.1-SNAPSHOT jar Yosegi Yosegi package. @@ -213,32 +213,6 @@ - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.7 - true - - ossrh - https://oss.sonatype.org/ - true - - - org.apache.rat apache-rat-plugin @@ -247,7 +221,7 @@ **/*.json .gitignore - .circleci/config.yml + .circleci/* .github/PULL_REQUEST_TEMPLATE.md @@ -306,6 +280,15 @@ surefireArgLine + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + gpg-sign + + @@ -327,4 +310,38 @@ + + + gpg-sign + + + + + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + --pinentry-mode + loopback + + + + + + + + + ${env.GPG_PASSPHRASE} + + +