Skip to content

Commit 9071eb1

Browse files
author
Olivier Chédru
committed
Move package to org.dhatim and deploy with github actions
1 parent 54b557b commit 9071eb1

23 files changed

Lines changed: 306 additions & 199 deletions

.github/settings.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
2+
<servers>
3+
<server>
4+
<id>ossrh</id>
5+
<username>${env.SONATYPE_USERNAME}</username>
6+
<password>${env.SONATYPE_PASSWORD}</password>
7+
</server>
8+
</servers>
9+
<profiles>
10+
<profile>
11+
<id>ossrh</id>
12+
<activation>
13+
<activeByDefault>true</activeByDefault>
14+
</activation>
15+
<properties>
16+
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
17+
</properties>
18+
</profile>
19+
</profiles>
20+
</settings>

.github/workflows/build.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: build
2+
on:
3+
push:
4+
branches: [ '*' ]
5+
tags: [ '*' ]
6+
pull_request:
7+
branches: [ '*' ]
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-java@v1
14+
with:
15+
java-version: 1.8
16+
- name: get tag
17+
id: get_tag
18+
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
19+
- name: maven build
20+
env:
21+
TAG: ${{ steps.get_tag.outputs.tag }}
22+
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
23+
GPG_OWNERTRUST: ${{ secrets.GPG_OWNERTRUST }}
24+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
25+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
26+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
27+
run: |
28+
if echo "${TAG}" | egrep '^[0-9]+\.[0-9]+\.[0-9]+(-[0-9]+)?$'
29+
then
30+
# the tag looks like a version number: proceed with release
31+
echo ${GPG_SECRET_KEY} | base64 --decode | gpg --import --no-tty --batch --yes
32+
echo ${GPG_OWNERTRUST} | base64 --decode | gpg --import-ownertrust --no-tty --batch --yes
33+
mvn -ntp versions:set -DnewVersion=${TAG}
34+
mvn -ntp -s .github/settings.xml -Prelease deploy
35+
else
36+
# this is a regular build
37+
mvn -ntp install
38+
fi

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
.classpath
33
.project
44
.settings/
5+
/.idea/
6+
hamcrest-postgresql.iml

pom.xml

Lines changed: 63 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
22
<modelVersion>4.0.0</modelVersion>
33

4-
<groupId>com.dhatim</groupId>
4+
<parent>
5+
<groupId>org.dhatim</groupId>
6+
<artifactId>root-oss</artifactId>
7+
<version>21.2.0</version>
8+
</parent>
9+
10+
<groupId>org.dhatim</groupId>
511
<artifactId>hamcrest-postgresql</artifactId>
6-
<version>0.0.26-SNAPSHOT</version>
12+
<version>0-SNAPSHOT</version>
713
<packaging>jar</packaging>
814

9-
<prerequisites>
10-
<maven>3.0</maven>
11-
</prerequisites>
12-
1315
<name>Hamcrest-style matchers for Postgresql SQLs</name>
1416
<url>https://github.com/dhatim/hamcrest-postgresql</url>
1517

@@ -21,23 +23,20 @@
2123
</licenses>
2224

2325
<scm>
24-
<connection>scm:git:git@github.com:dhatim/hamcrest-postgresql.git</connection>
26+
<connection>scm:git:https://github.com/dhatim/hamcrest-postgresql</connection>
2527
<tag>HEAD</tag>
2628
</scm>
2729

2830
<properties>
2931
<maven.compiler.source>1.8</maven.compiler.source>
3032
<maven.compiler.target>1.8</maven.compiler.target>
3133
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
32-
<compiler-plugin.version>3.3</compiler-plugin.version>
33-
<antlr4.version>4.7</antlr4.version>
3434
</properties>
3535

3636
<dependencies>
3737
<dependency>
3838
<groupId>junit</groupId>
3939
<artifactId>junit</artifactId>
40-
<version>4.12</version>
4140
<scope>test</scope>
4241
</dependency>
4342
<dependency>
@@ -48,7 +47,6 @@
4847
<dependency>
4948
<groupId>org.antlr</groupId>
5049
<artifactId>antlr4-runtime</artifactId>
51-
<version>${antlr4.version}</version>
5250
</dependency>
5351
</dependencies>
5452

@@ -57,7 +55,6 @@
5755
<plugin>
5856
<groupId>org.antlr</groupId>
5957
<artifactId>antlr4-maven-plugin</artifactId>
60-
<version>${antlr4.version}</version>
6158
<executions>
6259
<execution>
6360
<id>antlr</id>
@@ -75,7 +72,6 @@
7572
<plugin>
7673
<groupId>org.codehaus.mojo</groupId>
7774
<artifactId>build-helper-maven-plugin</artifactId>
78-
<version>1.10</version>
7975
<executions>
8076
<execution>
8177
<id>add-sources</id>
@@ -91,12 +87,63 @@
9187
</executions>
9288
</plugin>
9389
<plugin>
94-
<artifactId>maven-release-plugin</artifactId>
95-
<version>2.5.3</version>
90+
<groupId>org.apache.maven.plugins</groupId>
91+
<artifactId>maven-javadoc-plugin</artifactId>
9692
<configuration>
97-
<tagNameFormat>v@{project.version}</tagNameFormat>
93+
<show>public</show>
9894
</configuration>
95+
<executions>
96+
<execution>
97+
<id>attach-javadocs</id>
98+
<goals>
99+
<goal>jar</goal>
100+
</goals>
101+
</execution>
102+
</executions>
99103
</plugin>
100104
</plugins>
101105
</build>
106+
107+
<profiles>
108+
<profile>
109+
<id>release</id>
110+
<build>
111+
<plugins>
112+
<plugin>
113+
<groupId>org.sonatype.plugins</groupId>
114+
<artifactId>nexus-staging-maven-plugin</artifactId>
115+
<extensions>true</extensions>
116+
<configuration>
117+
<serverId>ossrh</serverId>
118+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
119+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
120+
</configuration>
121+
</plugin>
122+
<plugin>
123+
<artifactId>maven-source-plugin</artifactId>
124+
<executions>
125+
<execution>
126+
<id>attach-sources</id>
127+
<goals>
128+
<goal>jar-no-fork</goal>
129+
</goals>
130+
</execution>
131+
</executions>
132+
</plugin>
133+
<plugin>
134+
<artifactId>maven-gpg-plugin</artifactId>
135+
<executions>
136+
<execution>
137+
<id>sign-artifacts</id>
138+
<phase>verify</phase>
139+
<goals>
140+
<goal>sign</goal>
141+
</goals>
142+
</execution>
143+
</executions>
144+
</plugin>
145+
</plugins>
146+
</build>
147+
</profile>
148+
</profiles>
102149
</project>
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)