Skip to content

Commit acda061

Browse files
committed
Adding basic CI workflows
1 parent 1d18e62 commit acda061

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed

.github/workflows/merge-build.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This workflow will build a Java project with Maven
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
3+
4+
name: Merge / Push Build
5+
6+
on: [push]
7+
8+
jobs:
9+
publish-snapshot:
10+
11+
runs-on: ubuntu-latest
12+
13+
permissions:
14+
contents: read
15+
packages: write
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- name: Set up JDK
21+
uses: actions/setup-java@v2
22+
with:
23+
java-version: '11'
24+
distribution: 'adopt'
25+
# server-id: sonatype
26+
# server-username: SONATYPE_BOT_USERNAME
27+
# server-password: SONATYPE_BOT_TOKEN
28+
29+
- name: maven-settings-xml-action
30+
uses: whelk-io/maven-settings-xml-action@v14
31+
if: ${{ github.event.repository.fork == false }}
32+
with:
33+
repositories: '[{ "id": "sonatype", "url": "https://oss.sonatype.org/content/repositories/snapshots/", "releases": {"enabled": "false"}, "snapshots": {"enabled": "true" }}]'
34+
servers: '[{ "id": "sonatype", "username": "${{ secrets.SONATYPE_BOT_USERNAME}}", "password": "${{ secrets.SONATYPE_BOT_TOKEN}}" }]'
35+
36+
- name: "Maven Build & Deploy Snapshot to Sonatype OSSRH"
37+
if: ${{ github.event.repository.fork == false }}
38+
39+
run: mvn -B -e deploy -DaltDeploymentRepository=sonatype::default::https://oss.sonatype.org/content/repositories/snapshots/
40+
41+
- name: "Maven Build"
42+
if: ${{ github.event.repository.fork == true }}
43+
44+
run: mvn -B -e verify

.github/workflows/pr-build.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This workflow will build a Java project with Maven
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
3+
4+
name: PR Build
5+
6+
on: [pull_request]
7+
8+
jobs:
9+
build:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Set up JDK
17+
uses: actions/setup-java@v2
18+
with:
19+
java-version: '11'
20+
distribution: 'adopt'
21+
22+
- name: maven-settings-xml-action
23+
uses: whelk-io/maven-settings-xml-action@v14
24+
with:
25+
repositories: '[{ "id": "sonatype", "url": "https://oss.sonatype.org/content/repositories/snapshots/", "releases": {"enabled": "false"}, "snapshots": {"enabled": "true" }}]'
26+
27+
- name: Build with Maven
28+
run: mvn -B -e verify

0 commit comments

Comments
 (0)