Skip to content

Commit 0580828

Browse files
Merge pull request #28 from DevLab-umontp/publication-package
🚀 CI maven package
2 parents 43edb58 + 487cf67 commit 0580828

File tree

3 files changed

+126
-27
lines changed

3 files changed

+126
-27
lines changed

.github/CODEOWNERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@MathieuSoysal @emerick-biron
2+
3+
*.java @MathieuSoysal @emerick-biron
4+
5+
pom.xml @MathieuSoysal
6+
7+
.github/** @MathieuSoysal
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Maven Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
publish:
9+
10+
runs-on: ubuntu-latest
11+
12+
env:
13+
artifact_name: edt-iut-umontp
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Get the release version
19+
id: get_version
20+
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
21+
22+
- name: Set up JDK 11 for deploy to OSSRH
23+
uses: actions/setup-java@v1
24+
with:
25+
java-version: 11
26+
server-id: ossrh
27+
server-username: MAVEN_USERNAME
28+
server-password: MAVEN_CENTRAL_TOKEN
29+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
30+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
31+
32+
- name: Build with Maven
33+
run: mvn -B package --file pom.xml
34+
35+
- name: Update package version
36+
run: mvn versions:set -DnewVersion=${{ steps.get_version.outputs.VERSION }}
37+
38+
- name: Publish to Apache Maven Central
39+
run: mvn deploy -PossrhDeploy
40+
env:
41+
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }}
42+
MAVEN_CENTRAL_TOKEN: ${{ secrets.NEXUS_PASSWORD }}
43+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
44+
45+
- name: Set up JDK 11 for deploy to github packages
46+
uses: actions/setup-java@v1
47+
with:
48+
java-version: 11
49+
server-id: github
50+
51+
- name: Publish to GitHub Packages Apache Maven
52+
run: mvn deploy -PgithubDeploy
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

pom.xml

Lines changed: 65 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555

5656
<licenses>
5757
<license>
58-
<name>MIT License</name>
59-
<url>http://www.opensource.org/licenses/mit-license.php</url>
58+
<name>Apache Software License, Version 2.0</name>
59+
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
6060
</license>
6161
</licenses>
6262

@@ -70,35 +70,58 @@
7070
<developer>
7171
<name>Mathieu SOYSAL</name>
7272
<email>Mathieu.Soysal@outlook.fr</email>
73+
<url>https://MathieuSoysal.me/</url>
7374
<organization>com.github.devlab-umontp</organization>
7475
<organizationUrl>https://github.com/DevLab-umontp</organizationUrl>
7576
</developer>
7677
</developers>
7778

79+
<issueManagement>
80+
<system>github</system>
81+
<url>https://github.com/DevLab-umontp/Librarie-Java-EDT/issues</url>
82+
</issueManagement>
83+
7884
<scm>
7985
<connection>scm:git:git://github.com/DevLab-umontp/API-JAVA-EDT.git</connection>
8086
<developerConnection>scm:git:ssh://github.com:DevLab-umontp/API-JAVA-EDT.git</developerConnection>
8187
<url>http://github.com/DevLab-umontp/API-JAVA-EDT</url>
8288
</scm>
8389

84-
<distributionManagement>
85-
<snapshotRepository>
86-
<id>ossrh</id>
87-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
88-
</snapshotRepository>
89-
<repository>
90-
<id>ossrh</id>
91-
<name>Sonatype</name>
92-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
93-
</repository>
94-
</distributionManagement>
95-
9690

9791
<profiles>
92+
93+
<!-- Porfil : Maven Centrale -->
9894
<profile>
99-
<id>release</id>
95+
<id>ossrhDeploy</id>
96+
97+
<distributionManagement>
98+
<snapshotRepository>
99+
<id>ossrh</id>
100+
<name>Central Repository OSSRH</name>
101+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
102+
</snapshotRepository>
103+
<repository>
104+
<id>ossrh</id>
105+
<name>Central Repository OSSRH</name>
106+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
107+
</repository>
108+
</distributionManagement>
109+
100110
<build>
101111
<plugins>
112+
113+
<plugin>
114+
<groupId>org.sonatype.plugins</groupId>
115+
<artifactId>nexus-staging-maven-plugin</artifactId>
116+
<version>1.6.8</version>
117+
<extensions>true</extensions>
118+
<configuration>
119+
<serverId>ossrh</serverId>
120+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
121+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
122+
</configuration>
123+
</plugin>
124+
102125
<plugin>
103126
<groupId>org.apache.maven.plugins</groupId>
104127
<artifactId>maven-source-plugin</artifactId>
@@ -107,11 +130,12 @@
107130
<execution>
108131
<id>attach-sources</id>
109132
<goals>
110-
<goal>jar</goal>
133+
<goal>jar-no-fork</goal>
111134
</goals>
112135
</execution>
113136
</executions>
114137
</plugin>
138+
115139
<plugin>
116140
<groupId>org.apache.maven.plugins</groupId>
117141
<artifactId>maven-javadoc-plugin</artifactId>
@@ -125,6 +149,7 @@
125149
</execution>
126150
</executions>
127151
</plugin>
152+
128153
<plugin>
129154
<groupId>org.apache.maven.plugins</groupId>
130155
<artifactId>maven-gpg-plugin</artifactId>
@@ -136,26 +161,48 @@
136161
<goals>
137162
<goal>sign</goal>
138163
</goals>
164+
<configuration>
165+
<gpgArguments>
166+
<arg>--pinentry-mode</arg>
167+
<arg>loopback</arg>
168+
</gpgArguments>
169+
</configuration>
139170
</execution>
140171
</executions>
141172
</plugin>
173+
142174
</plugins>
143175
</build>
144176
</profile>
177+
178+
<!-- Profil : Github Apache Maven Packages -->
179+
<profile>
180+
<id>githubDeploy</id>
181+
<distributionManagement>
182+
<repository>
183+
<id>github</id>
184+
<name>GitHub DevLab-umontp Apache Maven Packages</name>
185+
<url>https://maven.pkg.github.com/DevLab-umontp/Librarie-Java-EDT</url>
186+
</repository>
187+
</distributionManagement>
188+
</profile>
145189
</profiles>
146190

147191
<build>
148192
<plugins>
193+
149194
<plugin>
150195
<groupId>org.apache.maven.plugins</groupId>
151196
<artifactId>maven-surefire-plugin</artifactId>
152197
<version>3.0.0-M5</version>
153198
</plugin>
199+
154200
<plugin>
155201
<groupId>org.apache.maven.plugins</groupId>
156202
<artifactId>maven-failsafe-plugin</artifactId>
157203
<version>3.0.0-M5</version>
158204
</plugin>
205+
159206
<plugin>
160207
<groupId>org.apache.maven.plugins</groupId>
161208
<artifactId>maven-compiler-plugin</artifactId>
@@ -166,17 +213,7 @@
166213
<encoding>${project.build.sourceEncoding}</encoding>
167214
</configuration>
168215
</plugin>
169-
<plugin>
170-
<groupId>org.sonatype.plugins</groupId>
171-
<artifactId>nexus-staging-maven-plugin</artifactId>
172-
<version>1.6.8</version>
173-
<extensions>true</extensions>
174-
<configuration>
175-
<serverId>ossrh</serverId>
176-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
177-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
178-
</configuration>
179-
</plugin>
216+
180217
<plugin>
181218
<groupId>org.jacoco</groupId>
182219
<artifactId>jacoco-maven-plugin</artifactId>
@@ -197,6 +234,7 @@
197234
</execution>
198235
</executions>
199236
</plugin>
237+
200238
</plugins>
201239
</build>
202240
</project>

0 commit comments

Comments
 (0)