Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Commit 6e33c65

Browse files
authored
Build by GH actions (#451)
* initial PR build * fix * set matrix build for jdks * set matrix build for jdks * set matrix build for jdks * sign and deploy * test * enabled back matrix build * split build phases and improved caching * fix dirs * multiple test reports * gpg singing * gpg plugin fix * try setup-java for publishing * fixed publishing and signing * reduce if * check * fix if * debug * debug * removed debug * removed travis files, badge * better name * activate gpg * test publishing * test publishing * force signing * fixed env property * only on master * use ubuntu-latest
1 parent 2e62a32 commit 6e33c65

File tree

9 files changed

+129
-84
lines changed

9 files changed

+129
-84
lines changed

.github/workflows/build.yaml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Build and Publish
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
cleanup-run:
10+
name: Cleanup previous run in PRs
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Abort previous action run (branch != master)
14+
if: endsWith(github.ref, 'master') == false
15+
uses: rokroskar/[email protected]
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
build:
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
jdk: [ 8, 11, 15 ]
23+
name: Build and Run Tests
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout Code
27+
uses: actions/checkout@v1
28+
29+
- uses: actions/cache@v1
30+
with:
31+
path: ~/.m2/repository
32+
key: ${{ runner.os }}-maven-${{ matrix.jdk }}-${{ hashFiles('**/pom.xml') }}
33+
restore-keys: |
34+
${{ runner.os }}-maven-
35+
36+
- uses: actions/setup-java@v2
37+
with:
38+
distribution: 'zulu'
39+
java-version: ${{ matrix.jdk }}
40+
41+
- name: Prepare dependencies
42+
run: |
43+
mvn install:install-file \
44+
-Dfile=lib/spring-restdocs-core-2.0.5.RELEASE-test.jar \
45+
-DgroupId=org.springframework.restdocs \
46+
-DartifactId=spring-restdocs-core \
47+
-Dversion=2.0.5.RELEASE \
48+
-Dpackaging=jar \
49+
-Dclassifier=test
50+
mvn install:install-file \
51+
-Dfile=lib/dokka-core-0.10.1-tests.jar \
52+
-DgroupId=org.jetbrains.dokka \
53+
-DartifactId=dokka-core -Dversion=0.10.1 \
54+
-Dpackaging=jar \
55+
-Dclassifier=test
56+
57+
- name: Build and Run Tests - Core
58+
run: |
59+
mvn install -B -V -fae
60+
61+
- name: Build and Run Tests - Samples
62+
run: |
63+
cd samples
64+
mvn install -B -V -fae
65+
66+
- name: Build and Run Tests - Gradle java-webmvc
67+
run: |
68+
cd samples/java-webmvc
69+
./gradlew check
70+
71+
- name: Build and Run Tests - Gradle kotlin-webmvc (JDK 8 only)
72+
if: matrix.jdk == '8'
73+
run: |
74+
cd samples/kotlin-webmvc
75+
./gradlew check
76+
77+
- name: Publish Test Report
78+
uses: scacap/action-surefire-report@v1
79+
if: always()
80+
with:
81+
github_token: ${{ secrets.GITHUB_TOKEN }}
82+
check_name: Test Report (${{ matrix.jdk }})
83+
84+
- name: Set up Sonatype
85+
uses: actions/setup-java@v2
86+
with:
87+
distribution: 'zulu'
88+
java-version: ${{ matrix.jdk }}
89+
server-id: ossrh
90+
server-username: SONATYPE_USERNAME
91+
server-password: SONATYPE_PASSWORD
92+
gpg-private-key: ${{ secrets.GPG_SECRET_KEY }}
93+
gpg-passphrase: GPG_PASSPHRASE
94+
95+
- name: Sign and publish core libs (master + JDK 8 only)
96+
if: matrix.jdk == '8' && endsWith(github.ref, 'master')
97+
run: |
98+
mvn deploy -DskipTests=true -B -V
99+
env:
100+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
101+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
102+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
103+
104+
- name: Sign and publish jdk9 doclet (master + JDK 11 only)
105+
if: matrix.jdk == '11' && endsWith(github.ref, 'master')
106+
run: |
107+
cd spring-auto-restdocs-json-doclet-jdk9
108+
mvn deploy -DskipTests=true -B -V
109+
env:
110+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
111+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
112+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

.travis.yml

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Spring Auto REST Docs
22
[![Apache License 2](https://img.shields.io/badge/license-ASF2-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0.txt)
3-
[![Build Status](https://travis-ci.org/ScaCap/spring-auto-restdocs.svg?branch=master)](https://travis-ci.org/ScaCap/spring-auto-restdocs)
3+
[![Build status](https://github.com/ScaCap/spring-auto-restdocs/actions/workflows/build.yaml/badge.svg)](https://github.com/ScaCap/spring-auto-restdocs/actions/workflows/build.yaml)
44
[![Maven Central status](https://img.shields.io/maven-central/v/capital.scalable/spring-auto-restdocs-core.svg)](https://search.maven.org/#search%7Cga%7C1%7Ccapital.scalable%20spring-auto-restdocs)
55

66
The aim of this [Spring REST Docs](https://projects.spring.io/spring-restdocs/)

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
This folder contains `ìndex.html` for github pages.
1+
This folder contains `index.html` for github pages.
22
It's automatically generated from `spring-auto-restdocs-docs`.

pom.xml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,15 @@
154154
<plugin>
155155
<groupId>org.apache.maven.plugins</groupId>
156156
<artifactId>maven-gpg-plugin</artifactId>
157-
<version>1.6</version>
157+
<version>3.0.1</version>
158158
</plugin>
159159
<plugin>
160160
<groupId>org.apache.maven.plugins</groupId>
161161
<artifactId>maven-surefire-plugin</artifactId>
162162
<version>2.22.2</version>
163+
<configuration>
164+
<redirectTestOutputToFile>true</redirectTestOutputToFile>
165+
</configuration>
163166
</plugin>
164167
<plugin>
165168
<groupId>org.asciidoctor</groupId>
@@ -235,7 +238,7 @@
235238
<id>sign-artifacts</id>
236239
<activation>
237240
<property>
238-
<name>gpg.passphrase</name>
241+
<name>env.GPG_PASSPHRASE</name>
239242
</property>
240243
</activation>
241244
<build>
@@ -251,6 +254,13 @@
251254
</goals>
252255
</execution>
253256
</executions>
257+
<configuration>
258+
<!-- Prevent gpg from using pinentry programs -->
259+
<gpgArguments>
260+
<arg>--pinentry-mode</arg>
261+
<arg>loopback</arg>
262+
</gpgArguments>
263+
</configuration>
254264
</plugin>
255265
</plugins>
256266
</build>

samples/java-webflux/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@
158158
<includes>
159159
<include>**/*Test.java</include>
160160
</includes>
161+
<redirectTestOutputToFile>true</redirectTestOutputToFile>
161162
</configuration>
162163
</plugin>
163164
<plugin>

samples/java-webmvc/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@
171171
<includes>
172172
<include>**/*Test.java</include>
173173
</includes>
174+
<redirectTestOutputToFile>true</redirectTestOutputToFile>
174175
</configuration>
175176
</plugin>
176177
<plugin>

samples/kotlin-webmvc/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@
170170
<includes>
171171
<include>**/*Test.*</include>
172172
</includes>
173+
<redirectTestOutputToFile>true</redirectTestOutputToFile>
173174
</configuration>
174175
</plugin>
175176
<plugin>

travis-settings.xml

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

0 commit comments

Comments
 (0)