From 828fb6bddae486aa8b4672ba6001930ee62981eb Mon Sep 17 00:00:00 2001 From: Nicole00 Date: Wed, 15 Dec 2021 13:53:05 +0800 Subject: [PATCH] config auto deploy workflow --- .github/workflows/deploy_release.yml | 35 ++++++++++ .github/workflows/deploy_snapshot.yml | 37 +++++++++++ .github/workflows/maven.yml | 2 +- example/pom.xml | 2 +- nebula-algorithm/pom.xml | 2 +- pom.xml | 95 ++++++++++++++++++++++----- 6 files changed, 154 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/deploy_release.yml create mode 100644 .github/workflows/deploy_snapshot.yml diff --git a/.github/workflows/deploy_release.yml b/.github/workflows/deploy_release.yml new file mode 100644 index 0000000..25300a1 --- /dev/null +++ b/.github/workflows/deploy_release.yml @@ -0,0 +1,35 @@ +# This workflow will build a Java project with Maven +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven + +name: release + +on: + release: + types: published + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + + - name: Cache the Maven packages to speed up build + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-maven- + + - name: Deploy SNAPSHOT to Sonatype + uses: samuelmeuli/action-maven-publish@v1 + with: + gpg_private_key: ${{ secrets.JAVA_GPG_PRIVATE_KEY }} + gpg_passphrase: ${{ secrets.JAVA_GPG_PASSPHRASE }} + nexus_username: ${{ secrets.OSSRH_USERNAME }} + nexus_password: ${{ secrets.OSSRH_TOKEN }} diff --git a/.github/workflows/deploy_snapshot.yml b/.github/workflows/deploy_snapshot.yml new file mode 100644 index 0000000..68aee92 --- /dev/null +++ b/.github/workflows/deploy_snapshot.yml @@ -0,0 +1,37 @@ +# This workflow will build a Java project with Maven +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven + +name: snapshot + +on: + push: + branches: [ master ] + schedule: + - cron: '0 6 * * *' + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + + - name: Cache the Maven packages to speed up build + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-maven- + + - name: Deploy SNAPSHOT to Sonatype + uses: samuelmeuli/action-maven-publish@v1 + with: + gpg_private_key: ${{ secrets.JAVA_GPG_PRIVATE_KEY }} + gpg_passphrase: ${{ secrets.JAVA_GPG_PASSPHRASE }} + nexus_username: ${{ secrets.OSSRH_USERNAME }} + nexus_password: ${{ secrets.OSSRH_TOKEN }} diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 713c417..0d3f6dd 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -1,7 +1,7 @@ # This workflow will build a Java project with Maven # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven -name: Java CI with Maven +name: pull_request on: push: diff --git a/example/pom.xml b/example/pom.xml index bc9d8aa..3820610 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - nebula-spark + algorithm com.vesoft 2.5-SNAPSHOT ../pom.xml diff --git a/nebula-algorithm/pom.xml b/nebula-algorithm/pom.xml index 5b8c091..5bd3318 100644 --- a/nebula-algorithm/pom.xml +++ b/nebula-algorithm/pom.xml @@ -4,7 +4,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - nebula-spark + algorithm com.vesoft 2.5-SNAPSHOT ../pom.xml diff --git a/pom.xml b/pom.xml index ac4b060..d7ef15d 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 com.vesoft - nebula-spark + algorithm pom 2.5-SNAPSHOT @@ -51,29 +51,92 @@ - release - https://oss.sonatype.org/service/local/staging/deploy/maven2/ + ossrh + Nexus Release Repository + https://oss.sonatype.org/service/local/staging/deploy/maven2 - snapshots - https://oss.sonatype.org/content/repositories/snapshots/ + ossrh + Nexus Snapshot Repository + https://oss.sonatype.org/content/repositories/snapshots + + + + deploy + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.0 + + + attach-sources + + jar-no-fork + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + attach-javadocs + + jar + + + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + sign-artifacts + verify + + sign + + + + + --pinentry-mode + loopback + + + + + + + + + + + - org.apache.maven.plugins - maven-gpg-plugin - 1.6 - - - verify - - sign - - - + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.8 + true + + ossrh + https://oss.sonatype.org/ + true +