Skip to content

Commit 244d4eb

Browse files
author
rmpestano
committed
fixes #203
1 parent f13b18c commit 244d4eb

3 files changed

Lines changed: 78 additions & 14 deletions

File tree

.github/workflows/ci.yml

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,51 @@ jobs:
1010
build:
1111
name: Build
1212
runs-on: ubuntu-18.04
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up JDK
16+
uses: actions/setup-java@v2.5.0
17+
with:
18+
distribution: 'adopt'
19+
java-version: '8'
20+
- uses: actions/cache@v2.1.7
21+
with:
22+
path: ~/.m2/repository
23+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
24+
restore-keys: |
25+
${{ runner.os }}-maven-
26+
- name: build
27+
run: mvn package
28+
29+
release:
30+
name: Release Admin template to maven central
31+
runs-on: ubuntu-18.04
32+
needs: build
1333
env:
1434
user: ${{ secrets.user }}
1535
pass: ${{ secrets.pass }}
36+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
1637
steps:
1738
- uses: actions/checkout@v2
1839
- name: Set up JDK
19-
uses: actions/setup-java@main
40+
uses: actions/setup-java@v2.5.0
2041
with:
2142
distribution: 'adopt'
2243
java-version: '8'
23-
- uses: actions/cache@v2.1.7
44+
server-id: releases
45+
server-username: user
46+
server-password: pass
47+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
48+
gpg-passphrase: GPG_PASSPHRASE
49+
- uses: actions/cache@v1
2450
with:
2551
path: ~/.m2/repository
2652
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
2753
restore-keys: |
2854
${{ runner.os }}-maven-
29-
- name: build & deploy
30-
if: "contains(github.ref, 'master')"
31-
run: mvn clean -U package deploy --settings settings.xml && mvn clean -U package deploy -Plegacy --settings settings.xml
32-
- name: build
33-
if: "!contains(github.ref, 'master')"
34-
run: mvn package
55+
- name: Deploy snapshots
56+
run: mvn deploy --settings settings.xml
57+
if: "contains(github.ref, 'master') && !contains(github.event.head_commit.message, 'prepare release')"
58+
- name: Release
59+
run: mvn deploy -Prelease
60+
if: "contains(github.ref, 'master') && contains(github.event.head_commit.message, 'prepare release')"

pom.xml

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
<dependency>
6666
<groupId>com.github.adminfaces</groupId>
6767
<artifactId>admin-theme</artifactId>
68-
<version>1.3.0</version>
68+
<version>1.3.1</version>
6969
</dependency>
7070
</dependencies>
7171

@@ -110,6 +110,15 @@
110110
</configuration>
111111
</plugin>
112112
</plugins>
113+
<pluginManagement>
114+
<plugins>
115+
<plugin>
116+
<groupId>org.apache.maven.plugins</groupId>
117+
<artifactId>maven-deploy-plugin</artifactId>
118+
<version>2.8.2</version>
119+
</plugin>
120+
</plugins>
121+
</pluginManagement>
113122
</build>
114123

115124
<profiles>
@@ -160,7 +169,20 @@
160169
<build>
161170
<plugins>
162171
<plugin>
172+
<groupId>org.sonatype.plugins</groupId>
173+
<artifactId>nexus-staging-maven-plugin</artifactId>
174+
<version>1.6.8</version>
175+
<extensions>true</extensions>
176+
<configuration>
177+
<serverId>releases</serverId>
178+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
179+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
180+
</configuration>
181+
</plugin>
182+
<plugin>
183+
<groupId>org.apache.maven.plugins</groupId>
163184
<artifactId>maven-source-plugin</artifactId>
185+
<version>3.2.1</version>
164186
<executions>
165187
<execution>
166188
<id>attach-sources</id>
@@ -189,6 +211,27 @@
189211
<skipTests>true</skipTests>
190212
</configuration>
191213
</plugin>
214+
<plugin>
215+
<groupId>org.apache.maven.plugins</groupId>
216+
<artifactId>maven-gpg-plugin</artifactId>
217+
<version>1.6</version>
218+
<executions>
219+
<execution>
220+
<id>sign-artifacts</id>
221+
<phase>verify</phase>
222+
<goals>
223+
<goal>sign</goal>
224+
</goals>
225+
</execution>
226+
</executions>
227+
<configuration>
228+
<!-- Prevent gpg from using pinentry programs -->
229+
<gpgArguments>
230+
<arg>--pinentry-mode</arg>
231+
<arg>loopback</arg>
232+
</gpgArguments>
233+
</configuration>
234+
</plugin>
192235
</plugins>
193236
</build>
194237
</profile>
@@ -200,10 +243,6 @@
200243
<id>snapshots</id>
201244
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
202245
</snapshotRepository>
203-
<repository>
204-
<id>central</id>
205-
<url>https://oss.sonatype.org/content/repositories/releases</url>
206-
</repository>
207246
</distributionManagement>
208247

209248
<repositories>

settings.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
32
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
43
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0

0 commit comments

Comments
 (0)