Skip to content

Commit

Permalink
edit package publishing config & add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
idleyui committed Aug 9, 2021
1 parent 45e69c9 commit 2b0527f
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 17 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,35 @@
name: Release

on:
push:
tags:
- "v*"

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

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

- name: Setup gpg
run: |
mkdir ~/.gnupg
echo use-agent >> ~/.gnupg/gpg.conf
echo pinentry-mode loopback >> ~/.gnupg/gpg.conf
echo allow-loopback-pinentry >> ~/.gnupg/gpg-agent.conf
- name: Release Maven package
uses: samuelmeuli/action-maven-publish@v1
with:
gpg_private_key: ${{ secrets.gpg_private_key }}
gpg_passphrase: ${{ secrets.gpg_passphrase }}
nexus_username: ${{ secrets.nexus_username }}
nexus_password: ${{ secrets.nexus_password }}
server_id: ossrh
maven_args: -DskipTests
12 changes: 3 additions & 9 deletions pom.xml
Expand Up @@ -21,12 +21,6 @@
</license>
</licenses>

<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>

<scm>
<connection>scm:git:http://github.com/aliyun/aliyun-odps-jdbc.git</connection>
<developerConnection>scm:git:git@github.com:aliyun/aliyun-odps-jdbc.git</developerConnection>
Expand All @@ -35,11 +29,11 @@

<distributionManagement>
<snapshotRepository>
<id>sonatype-nexus-snapshots</id>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>nexus-releases</id>
<id>ossrh</id>
<name>Nexus Release Repository</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
Expand Down Expand Up @@ -174,7 +168,7 @@
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>nexus-releases</serverId>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
Expand Down
11 changes: 3 additions & 8 deletions settings.xml
Expand Up @@ -3,14 +3,9 @@
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>sonatype-nexus-snapshots</id>
<username>${env.SONATYPE_USERNAME}</username>
<password>${env.SONATYPE_PASSWORD}</password>
</server>
<server>
<id>nexus-releases</id>
<username>${env.SONATYPE_USERNAME}</username>
<password>${env.SONATYPE_PASSWORD}</password>
<id>ossrh</id>
<username>${env.nexus_username}</username>
<password>${env.nexus_password}</password>
</server>
</servers>
</settings>

0 comments on commit 2b0527f

Please sign in to comment.