Skip to content

Commit 6f747c8

Browse files
committed
adding CI
1 parent f0737db commit 6f747c8

4 files changed

Lines changed: 203 additions & 0 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
tags-ignore:
8+
- '**'
9+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onpushpull_requestpull_request_targetpathspaths-ignore
10+
# Avoid building if only modifying non-code files.
11+
# An exception is docs/options.md , as created from build
12+
paths:
13+
- "**"
14+
- '!README.md'
15+
- '!LICENSE'
16+
- '!.gitignore'
17+
- '!release_notes.md'
18+
19+
20+
jobs:
21+
full-build-base:
22+
runs-on: ${{ matrix.os }}
23+
strategy:
24+
matrix:
25+
os: [ ubuntu-latest, windows-latest, macos-latest ]
26+
steps:
27+
# Checkout code
28+
- uses: actions/checkout@v4
29+
# Build/test for JDK
30+
- name: Setup JDK 8
31+
uses: actions/setup-java@v1
32+
with:
33+
java-version: 1.8
34+
- name: Cache Maven packages
35+
uses: actions/cache@v3
36+
with:
37+
path: ~/.m2
38+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
39+
restore-keys: ${{ runner.os }}-m2
40+
- name: Build with Maven
41+
run: mvn clean verify --fae
42+
# Make test report accessible from GitHub Actions (as Maven logs are long)
43+
- name: Publish Test Report
44+
if: success() || failure()
45+
uses: mikepenz/action-junit-report@v4
46+
env:
47+
NODE_OPTIONS: "--max_old_space_size=6144"
48+
with:
49+
report_paths: '**/target/surefire-reports/TEST-*.xml'

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release on GitHub
2+
3+
4+
## Run only when we push a tag.
5+
on:
6+
push:
7+
tags:
8+
- "v*"
9+
10+
11+
jobs:
12+
13+
build-base:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Setup JDK 1.8
18+
uses: actions/setup-java@v1
19+
with:
20+
java-version: 1.8
21+
- name: Cache Maven packages
22+
uses: actions/cache@v3
23+
with:
24+
path: ~/.m2
25+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
26+
restore-keys: ${{ runner.os }}-m2
27+
- name: Build with Maven
28+
# Don't run any test, as build should had already been verified (and it takes hours...)
29+
run: mvn clean verify -DskipTests
30+
- name: Release
31+
uses: softprops/action-gh-release@v1
32+
with:
33+
body: "See release notes at [release_notes.md](https://github.com/WebFuzzing/overlay-jvm/blob/master/release_notes.md)."
34+
prerelease: false
35+
draft: false
36+
fail_on_unmatched_files: true
37+

pom.xml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,90 @@
144144

145145
</dependencies>
146146

147+
148+
<profiles>
149+
<profile>
150+
<!--
151+
This profile is needed when making a deployment to Maven Central.
152+
153+
0) make sure you are on the "master" branch
154+
155+
1) update release_notes.md before preparing a new release
156+
157+
2) manually update <version> in thi file. Typically just remove the -SNAPSHOT tag.
158+
Git commit/push.
159+
160+
3) run:
161+
mvn -P release -DskipTests deploy
162+
163+
IMPORTANT: must make sure you are building with JDK 8!!!
164+
165+
make sure it is visible at:
166+
https://central.sonatype.com/artifact/com.webfuzzing/commons
167+
if not, check publishing status at
168+
https://central.sonatype.com/publishing/deployments (requires login)
169+
170+
4) run:
171+
git tag v<x.y.z>
172+
git push origin v<x.y.z>
173+
174+
5) increase version number, and put back -SNAPSHOT.
175+
Git commit/push.
176+
-->
177+
<id>release</id>
178+
<build>
179+
<plugins>
180+
<plugin>
181+
<groupId>org.apache.maven.plugins</groupId>
182+
<artifactId>maven-gpg-plugin</artifactId>
183+
</plugin>
184+
<plugin>
185+
<groupId>org.sonatype.central</groupId>
186+
<artifactId>central-publishing-maven-plugin</artifactId>
187+
</plugin>
188+
</plugins>
189+
</build>
190+
</profile>
191+
</profiles>
192+
193+
194+
147195
<build>
196+
<pluginManagement>
197+
<plugins>
198+
<!-- To deploy to Maven Central
199+
https://central.sonatype.com/account
200+
https://central.sonatype.org/publish/publish-portal-maven/
201+
-->
202+
<plugin>
203+
<groupId>org.sonatype.central</groupId>
204+
<artifactId>central-publishing-maven-plugin</artifactId>
205+
<version>0.7.0</version>
206+
<extensions>true</extensions>
207+
<configuration>
208+
<publishingServerId>central</publishingServerId>
209+
<autoPublish>true</autoPublish>
210+
</configuration>
211+
</plugin>
212+
<!-- To sign Jar files before uploading them to Maven Central -->
213+
<plugin>
214+
<groupId>org.apache.maven.plugins</groupId>
215+
<artifactId>maven-gpg-plugin</artifactId>
216+
<version>1.6</version>
217+
<executions>
218+
<execution>
219+
<id>sign-artifacts</id>
220+
<phase>deploy</phase>
221+
<goals>
222+
<goal>sign</goal>
223+
</goals>
224+
</execution>
225+
</executions>
226+
</plugin>
227+
</plugins>
228+
</pluginManagement>
229+
230+
148231
<plugins>
149232
<plugin>
150233
<groupId>org.apache.maven.plugins</groupId>
@@ -166,6 +249,37 @@
166249
<runOrder>alphabetical</runOrder>
167250
</configuration>
168251
</plugin>
252+
<plugin>
253+
<groupId>org.apache.maven.plugins</groupId>
254+
<artifactId>maven-source-plugin</artifactId>
255+
<version>3.2.0</version>
256+
<executions>
257+
<execution>
258+
<id>create-sources</id>
259+
<phase>verify</phase>
260+
<goals>
261+
<goal>jar</goal>
262+
</goals>
263+
</execution>
264+
</executions>
265+
</plugin>
266+
<plugin>
267+
<groupId>org.apache.maven.plugins</groupId>
268+
<artifactId>maven-javadoc-plugin</artifactId>
269+
<version>3.1.1</version>
270+
<configuration>
271+
<source>8</source>
272+
</configuration>
273+
<executions>
274+
<execution>
275+
<id>create-javadocs</id>
276+
<phase>verify</phase>
277+
<goals>
278+
<goal>jar</goal>
279+
</goals>
280+
</execution>
281+
</executions>
282+
</plugin>
169283
</plugins>
170284
</build>
171285

release_notes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SNAPSHOT
2+
3+
Under development in `master` branch.

0 commit comments

Comments
 (0)