Skip to content

Commit

Permalink
Try auto release to Sonatype
Browse files Browse the repository at this point in the history
  • Loading branch information
kezhenxu94 committed Apr 3, 2020
1 parent 073b98e commit 3c5c163
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 8 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,27 @@ on:
env:
GITHUB_USERNAME: x-access-token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

jobs:
deploy-github:
name: Deploy to GitHub Package Registry
name: GitHub
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Deploy to GitHub Package Registry
- name: Deploy to GitHub
run: ./mvnw --batch-mode --settings settings.xml -Pgithub clean deploy

deploy-sonatype:
name: Sonatype
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Import GPG Keys
run: |
gpg --keyserver keyserver.ubuntu.com --recv-keys ${{ secrets.GPG_PUBLIC_KEY }}
echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --import --no-tty --batch --yes -
- name: Deploy to Sonatype
run: ./mvnw --batch-mode --settings settings.xml -Possrh,sign clean deploy
15 changes: 9 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>io.github.kezhenxu94</groupId>
<artifactId>cache-lite</artifactId>
<version>0.1.6-SNAPSHOT</version>
<version>0.1.7</version>

<name>cache-lite</name>
<description>An extremely light-weight cache framework for Kotlin</description>
Expand All @@ -30,7 +30,7 @@
<connection>scm:git:git://github.com/kezhenxu94/cache-lite.git</connection>
<developerConnection>scm:git:git@github.com:kezhenxu94/cache-lite.git</developerConnection>
<url>https://github.com/kezhenxu94/cache-lite</url>
<tag>v0.1.3</tag>
<tag>v0.1.6</tag>
</scm>

<issueManagement>
Expand All @@ -57,10 +57,6 @@
<kotlin.version>1.3.71</kotlin.version>
<junit.version>4.12</junit.version>
<java.version>1.8</java.version>

<gpg.executable>gpg</gpg.executable>
<gpg.keyname>${env.GPG_KEY_NAME}</gpg.keyname>
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
</properties>

<profiles>
Expand All @@ -81,6 +77,12 @@
</goals>
</execution>
</executions>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</plugin>
</plugins>
</build>
Expand Down Expand Up @@ -247,6 +249,7 @@
<localCheckout>true</localCheckout>
<pushChanges>false</pushChanges>
<mavenExecutorId>forked-path</mavenExecutorId>
<arguments>-DskipTests</arguments>
</configuration>
</plugin>
</plugins>
Expand Down
6 changes: 6 additions & 0 deletions settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
</activeProfiles>

<profiles>
<profile>
<id>sign</id>
<properties>
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
</properties>
</profile>
<profile>
<id>github</id>
<repositories>
Expand Down

0 comments on commit 3c5c163

Please sign in to comment.