Skip to content

Commit 3c5c163

Browse files
committed
Try auto release to Sonatype
1 parent 073b98e commit 3c5c163

File tree

3 files changed

+32
-8
lines changed

3 files changed

+32
-8
lines changed

.github/workflows/deploy.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,27 @@ on:
88
env:
99
GITHUB_USERNAME: x-access-token
1010
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
12+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
13+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
1114

1215
jobs:
1316
deploy-github:
14-
name: Deploy to GitHub Package Registry
17+
name: GitHub
1518
runs-on: ubuntu-latest
1619
steps:
1720
- uses: actions/checkout@v2
18-
- name: Deploy to GitHub Package Registry
21+
- name: Deploy to GitHub
1922
run: ./mvnw --batch-mode --settings settings.xml -Pgithub clean deploy
23+
24+
deploy-sonatype:
25+
name: Sonatype
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v2
29+
- name: Import GPG Keys
30+
run: |
31+
gpg --keyserver keyserver.ubuntu.com --recv-keys ${{ secrets.GPG_PUBLIC_KEY }}
32+
echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --import --no-tty --batch --yes -
33+
- name: Deploy to Sonatype
34+
run: ./mvnw --batch-mode --settings settings.xml -Possrh,sign clean deploy

pom.xml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>io.github.kezhenxu94</groupId>
77
<artifactId>cache-lite</artifactId>
8-
<version>0.1.6-SNAPSHOT</version>
8+
<version>0.1.7</version>
99

1010
<name>cache-lite</name>
1111
<description>An extremely light-weight cache framework for Kotlin</description>
@@ -30,7 +30,7 @@
3030
<connection>scm:git:git://github.com/kezhenxu94/cache-lite.git</connection>
3131
<developerConnection>scm:git:git@github.com:kezhenxu94/cache-lite.git</developerConnection>
3232
<url>https://github.com/kezhenxu94/cache-lite</url>
33-
<tag>v0.1.3</tag>
33+
<tag>v0.1.6</tag>
3434
</scm>
3535

3636
<issueManagement>
@@ -57,10 +57,6 @@
5757
<kotlin.version>1.3.71</kotlin.version>
5858
<junit.version>4.12</junit.version>
5959
<java.version>1.8</java.version>
60-
61-
<gpg.executable>gpg</gpg.executable>
62-
<gpg.keyname>${env.GPG_KEY_NAME}</gpg.keyname>
63-
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
6460
</properties>
6561

6662
<profiles>
@@ -81,6 +77,12 @@
8177
</goals>
8278
</execution>
8379
</executions>
80+
<configuration>
81+
<gpgArguments>
82+
<arg>--pinentry-mode</arg>
83+
<arg>loopback</arg>
84+
</gpgArguments>
85+
</configuration>
8486
</plugin>
8587
</plugins>
8688
</build>
@@ -247,6 +249,7 @@
247249
<localCheckout>true</localCheckout>
248250
<pushChanges>false</pushChanges>
249251
<mavenExecutorId>forked-path</mavenExecutorId>
252+
<arguments>-DskipTests</arguments>
250253
</configuration>
251254
</plugin>
252255
</plugins>

settings.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
</activeProfiles>
88

99
<profiles>
10+
<profile>
11+
<id>sign</id>
12+
<properties>
13+
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
14+
</properties>
15+
</profile>
1016
<profile>
1117
<id>github</id>
1218
<repositories>

0 commit comments

Comments
 (0)