Skip to content

Commit

Permalink
Support to automatic deploy to maven (#281)
Browse files Browse the repository at this point in the history
* Supported to deploy package to maven

* add end line

Co-authored-by: Anqi <[email protected]>
  • Loading branch information
laura-ding and Nicole00 authored Mar 30, 2021
1 parent 55dd09a commit 83df15f
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 1 deletion.
38 changes: 38 additions & 0 deletions .github/workflows/deploy_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Deploy release to the Maven Central Repository

on:
release:
types:
- published

jobs:
deploy:
runs-on: ubuntu-18.04
steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Install Java and Maven
uses: actions/setup-java@v1
with:
java-version: 1.8

- 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 ../../client/src/test/resources/docker-compose.yaml .
docker-compose up -d
sleep 10
popd
popd
- name: Deploy Release to Maven package
uses: samuelmeuli/action-maven-publish@v1
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
nexus_username: ${{ secrets.OSSRH_USERNAME }}
nexus_password: ${{ secrets.OSSRH_TOKEN }}
37 changes: 37 additions & 0 deletions .github/workflows/deploy_snapshot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Deploy snapshot to the Maven Central Repository

on:
push:
branches: [ master ]

jobs:
deploy:
runs-on: ubuntu-18.04
steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Install Java and Maven
uses: actions/setup-java@v1
with:
java-version: 1.8

- 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 ../../client/src/test/resources/docker-compose.yaml .
docker-compose up -d
sleep 10
popd
popd
- name: Deploy Snapshot to Maven package
uses: samuelmeuli/action-maven-publish@v1
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
nexus_username: ${{ secrets.OSSRH_USERNAME }}
nexus_password: ${{ secrets.OSSRH_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
popd
- name: Build with Maven
run: mvn -B package
run: mvn -B package
20 changes: 20 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,29 @@
<goals>
<goal>sign</goal>
</goals>
<configuration>
<!-- Prevent `gpg` from using pinentry programs -->
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
<!-- Skip deployment to Nexus for test project -->
<skipRemoteStaging>true</skipRemoteStaging>
</configuration>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 83df15f

Please sign in to comment.