From abe82e3c16b215ea319cc29c8833fee0c645b2ef Mon Sep 17 00:00:00 2001 From: Zhenghao Zhang Date: Tue, 22 Nov 2022 21:30:57 +0800 Subject: [PATCH] add release action --- .github/workflows/release.yml | 34 +++++++++++++ pom.xml | 92 +++++++++++++++++++++++++++++++++-- 2 files changed, 122 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..9ebd631 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,34 @@ +name: Release +on: + release: + types: [published] +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Build the stack + run: docker-compose up -d + - name: Check the deployed service health + uses: jtalk/url-health-check-action@v2 + with: + url: http://127.0.0.1:8088/metrics + max-attempts: 5 + retry-delay: 5s + retry-all: true + - name: Set up Maven Central Repository + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'adopt' + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + - name: Publish package + run: mvn --batch-mode deploy + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} diff --git a/pom.xml b/pom.xml index b8b6e53..fb55b39 100644 --- a/pom.xml +++ b/pom.xml @@ -41,10 +41,94 @@ ossrh https://s01.oss.sonatype.org/content/repositories/snapshots - - ossrh - https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ - + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.7 + true + + ossrh + https://s01.oss.sonatype.org/ + true + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.9.1 + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + --pinentry-mode + loopback + + + + + + + + + ${project.groupId}:${project.artifactId} + Java SDK for Gorse recommender system. + https://gorse.io + + + + The Apache License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + + + + + + Zhenghao Zhang + zhangzhenghao@hotmail.com + Gorse Project + https://gorse.io + + + + + scm:git:git://github.com/gorse-io/gorse4j.git + scm:git:ssh://github.com/gorse-io/gorse4j.git + https://github.com/gorse-io/gorse4j + + \ No newline at end of file