diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..e7db300c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,47 @@ +# 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-18.04 + + 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: Install nebula-graph + run: | + mkdir tmp + pushd tmp + git clone https://github.com/vesoft-inc/nebula-docker-compose.git + pushd nebula-docker-compose/ + cp ../../nebula-spark-connector/src/test/resources/docker-compose.yaml . + docker-compose up -d + sleep 10 + popd + popd + + - name: Deploy release to Maven + 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/example/pom.xml b/example/pom.xml index a3763901..2445d3a0 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -22,6 +22,23 @@ true + + org.sonatype.plugins + nexus-staging-maven-plugin + + + default-deploy + deploy + + deploy + + + ossrh + true + + + + org.apache.maven.plugins diff --git a/nebula-spark-connector/pom.xml b/nebula-spark-connector/pom.xml index 72c4a6b8..dea46cb1 100644 --- a/nebula-spark-connector/pom.xml +++ b/nebula-spark-connector/pom.xml @@ -69,6 +69,17 @@ + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.8 + true + + ossrh + https://oss.sonatype.org/ + true + + org.apache.maven.plugins diff --git a/pom.xml b/pom.xml index d1aef83e..c68b0e23 100644 --- a/pom.xml +++ b/pom.xml @@ -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 +