Skip to content

Commit d9a1afb

Browse files
GitHub actions (#76)
1 parent 94bc806 commit d9a1afb

File tree

6 files changed

+131
-87
lines changed

6 files changed

+131
-87
lines changed

.github/workflows/ci.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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: CI
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
workflow_dispatch: {}
12+
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
java: [ '8', '11' ]
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up JDK
23+
uses: actions/setup-java@v2
24+
with:
25+
java-version: ${{ matrix.java }}
26+
distribution: 'zulu'
27+
28+
- name: Build with Maven
29+
run: mvn package
30+
31+
# CodeQL:
32+
# # CodeQL runs on ubuntu-latest and windows-latest
33+
# runs-on: ubuntu-latest
34+
35+
# steps:
36+
# - name: Checkout repository
37+
# uses: actions/checkout@v2
38+
# with:
39+
# # We must fetch at least the immediate parents so that if this is
40+
# # a pull request then we can checkout the head.
41+
# fetch-depth: 2
42+
43+
# # Initializes the CodeQL tools for scanning.
44+
# - name: Initialize CodeQL
45+
# uses: github/codeql-action/init@v1
46+
# with:
47+
# languages: java
48+
49+
# - name: build
50+
# run: mvn --quiet --batch-mode clean install
51+
52+
# - name: Perform CodeQL Analysis
53+
# uses: github/codeql-action/analyze@v1
54+
55+
# codeclimate:
56+
# runs-on: ubuntu-latest
57+
# needs: build
58+
# steps:
59+
# - name: checkout
60+
# uses: actions/checkout@master
61+
# with:
62+
# ref: ${{ github.ref }}
63+
# - name: Download main project dir
64+
# uses: actions/download-artifact@v1
65+
# with:
66+
# name: mirus
67+
# - name: Upload coverage to Code Climate
68+
# uses: paambaati/codeclimate-action@v2.6.0
69+
# env:
70+
# CC_TEST_REPORTER_ID: # todo 873529a2ad74a48f14a73b29dd3f392c7da63902534ac0fd224746f32ba77ac5
71+
# JACOCO_SOURCE_PATH: "${{github.workspace}}/src/main/java"
72+
# with:
73+
# # The report file must be there, otherwise Code Climate won't find it
74+
# coverageCommand: echo "already done"
75+
# coverageLocations: |
76+
# ${{github.workspace}}/target/site/jacoco/jacoco.xml:jacoco
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
2+
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
3+
4+
name: Maven Package
5+
6+
on:
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Set up JDK
21+
uses: actions/setup-java@v2
22+
with:
23+
java-version: '11'
24+
distribution: 'adopt'
25+
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
26+
27+
- name: Build with Maven
28+
run: mvn -B package --file pom.xml
29+
30+
- name: Publish to GitHub Packages Apache Maven
31+
run: mvn deploy
32+
env:
33+
GITHUB_TOKEN: ${{ github.token }}
34+
35+
- name: Set up Apache Maven Central
36+
uses: actions/setup-java@v2
37+
with: # running setup-java again overwrites the settings.xml
38+
distribution: 'zulu'
39+
java-version: '11'
40+
server-username: MAVEN_USERNAME # env variable for username in deploy
41+
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
42+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
43+
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
44+
45+
- name: Release to Apache Maven Central
46+
run: mvn deploy
47+
env:
48+
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USER }} # SONATYPE_USERNAME
49+
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} # SONATYPE_PASSWORD
50+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

.travis.gpg.sh

Lines changed: 0 additions & 37 deletions
This file was deleted.

.travis.settings.xml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

pom.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,11 @@
164164
<artifactId>maven-gpg-plugin</artifactId>
165165
<version>1.6</version>
166166
<configuration>
167-
<useAgent>false</useAgent>
167+
<!-- Prevent gpg from using pinentry programs -->
168+
<gpgArguments>
169+
<arg>--pinentry-mode</arg>
170+
<arg>loopback</arg>
171+
</gpgArguments>
168172
</configuration>
169173
<executions>
170174
<execution>

0 commit comments

Comments
 (0)