From 76df48112990bf7f7996f5cda941757f3467bb4c Mon Sep 17 00:00:00 2001 From: Liao Xin <93535922+liewstar@users.noreply.github.com> Date: Fri, 4 Oct 2024 17:42:09 +0800 Subject: [PATCH] feat: automatically publish to Maven repository (#7) --- .github/workflows/maven-ci.yml | 28 ++++++- maven-settings.xml | 22 ++++++ pom.xml | 139 ++++++++++++++++++++++++++++++++- 3 files changed, 186 insertions(+), 3 deletions(-) create mode 100644 maven-settings.xml diff --git a/.github/workflows/maven-ci.yml b/.github/workflows/maven-ci.yml index 37ce154..a504a21 100644 --- a/.github/workflows/maven-ci.yml +++ b/.github/workflows/maven-ci.yml @@ -20,6 +20,32 @@ jobs: uses: actions/setup-java@v1 with: java-version: 1.8 + server-id: ossrh + server-username: OSSRH_JIRA_USERNAME + server-password: OSSRH_JIRA_PASSWORD + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg-passphrase: GPG_PASSPHRASE + + - name: Codecov + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} - name: Build with Maven - run: mvn clean test \ No newline at end of file + run: mvn clean test + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: 20 + + - name: Semantic Release + run: | + npm install -g @conveyal/maven-semantic-release semantic-release + 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 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + OSSRH_JIRA_USERNAME: ${{ secrets.OSSRH_JIRA_USERNAME }} + OSSRH_JIRA_PASSWORD: ${{ secrets.OSSRH_JIRA_PASSWORD }} \ No newline at end of file diff --git a/maven-settings.xml b/maven-settings.xml new file mode 100644 index 0000000..9600d94 --- /dev/null +++ b/maven-settings.xml @@ -0,0 +1,22 @@ + + + + ossrh + ${OSSRH_JIRA_USERNAME} + ${OSSRH_JIRA_PASSWORD} + + + + + ossrh + + true + + + gpg + ${GPG_KEY_NAME} + ${GPG_PASSPHRASE} + + + + diff --git a/pom.xml b/pom.xml index 7d5f3b1..3de3199 100644 --- a/pom.xml +++ b/pom.xml @@ -10,9 +10,73 @@ jCasbin JFinal Plugin Demo project for JFinal + https://github.com/jcasbin/jfinal-authz + 2018 + + + Github + https://github.com/jcasbin/jfinal-authz/issues + + + + org.sonatype.oss + oss-parent + 7 + + + + The Apache Software License, Version 2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + https://github.com/jcasbin/jfinal-authz + git@github.com:jcasbin/jfinal-authz.git + https://github.com/hsluoyz + + + + Yang Luo + hsluoyz@qq.com + https://github.com/hsluoyz + + + + + UTF-8 + + + + + ossrh + https://central.sonatype.com + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + --pinentry-mode + loopback + + + org.eluder.coveralls coveralls-maven-plugin @@ -31,12 +95,83 @@ + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + 11 + false + + -Xdoclint:none + + + notnull + a + Not null + + + default + a + Default: + + + + + + + attach-javadocs + + jar + + + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar-no-fork + + + + + + + org.sonatype.central + central-publishing-maven-plugin + 0.5.0 + true + + ossrh + true + + true + + org.apache.maven.plugins maven-compiler-plugin - 8 - 8 + 1.8 + 1.8 + + + + org.codehaus.mojo + cobertura-maven-plugin + 2.7 + + + html + xml + +