Skip to content

Commit c608408

Browse files
authored
Merge pull request #8 from bramwelt-gitlab-test/github-actions
Initial Java GithubActions
2 parents 86a225c + 2f03799 commit c608408

File tree

4 files changed

+124
-1
lines changed

4 files changed

+124
-1
lines changed

.github/workflows/merge.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Merges
3+
4+
# yamllint disable-line rule:truthy
5+
on:
6+
push:
7+
branches:
8+
- master
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
env:
14+
MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode"
15+
MAVEN_OPTS: "-Dmaven.repo.local=$HOME/.m2/repository"
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Set up Java 1.8
19+
uses: actions/setup-java@v1
20+
with:
21+
java-version: 1.8
22+
- name: Cache Packages
23+
uses: actions/cache@v1
24+
with:
25+
path: ~/.m2/repository
26+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
27+
restore-keys: |
28+
${{ runner.os }}-maven-
29+
- name: Build and Run Tests
30+
run: mvn $MAVEN_CLI_OPTS install
31+
- name: Publish to GitHub Packages Apache Maven
32+
run: mvn $MAVEN_CLI_OPTS deploy
33+
env:
34+
MAVEN_RELEASE_REPO_USER: ${{ github.USER }}
35+
MAVEN_RELEASE_REPO_PASS: ${{ github.token }}

.github/workflows/pull_request.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Pull Requests
3+
4+
# yamllint disable-line rule:truthy
5+
on:
6+
push:
7+
branches:
8+
- master
9+
pull_request:
10+
branches:
11+
- master
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
env:
17+
MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode"
18+
MAVEN_OPTS: "-Dmaven.repo.local=$HOME/.m2/repository"
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Set up Java 1.8
22+
uses: actions/setup-java@v1
23+
with:
24+
java-version: 1.8
25+
- name: Cache Packages
26+
uses: actions/cache@v1
27+
with:
28+
path: ~/.m2/repository
29+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
30+
restore-keys: |
31+
${{ runner.os }}-maven-
32+
- name: Build and Run Tests
33+
run: mvn $MAVEN_CLI_OPTS install

.gitignore

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
1-
target/*
1+
target/
2+
pom.xml.tag
3+
pom.xml.releaseBackup
4+
pom.xml.versionsBackup
5+
pom.xml.next
6+
release.properties
7+
dependency-reduced-pom.xml
8+
buildNumber.properties
9+
.mvn/timing.properties
10+
.mvn/wrapper/maven-wrapper.jar
11+
*.swp

.m2/settings.xml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4+
<servers>
5+
<server>
6+
<id>release</id>
7+
<username>${env.MAVEN_RELEASE_REPO_USER}</username>
8+
<password>${env.MAVEN_RELEASE_REPO_PASS}</password>
9+
</server>
10+
11+
</servers>
12+
<profiles>
13+
<profile>
14+
<id>none</id>
15+
<repositories>
16+
<repository>
17+
<snapshots>
18+
<enabled>false</enabled>
19+
</snapshots>
20+
<id>release</id>
21+
<name>${env.MAVEN_RELEASE_REPO}</name>
22+
<url>${env.MAVEN_RELEASE_URL}</url>
23+
</repository>
24+
25+
</repositories>
26+
<pluginRepositories>
27+
<pluginRepository>
28+
<snapshots>
29+
<enabled>false</enabled>
30+
</snapshots>
31+
<id>release</id>
32+
<name>${env.MAVEN_RELEASE_REPO}</name>
33+
<url>${env.MAVEN_RELEASE_REPO_URL}</url>
34+
</pluginRepository>
35+
36+
</pluginRepositories>
37+
</profile>
38+
39+
</profiles>
40+
41+
<activeProfiles>
42+
<activeProfile>none</activeProfile>
43+
44+
</activeProfiles>
45+
</settings>

0 commit comments

Comments
 (0)