Skip to content

Commit e3e905d

Browse files
committed
Add github actions ci-cd
1 parent f8f0ed2 commit e3e905d

15 files changed

Lines changed: 106 additions & 31 deletions

.github/workflows/ci-cd.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: ci-cd
2+
3+
on:
4+
push:
5+
branches: [master]
6+
tags: [1.*]
7+
paths:
8+
- ".github/workflows/ci-cd.yml"
9+
- "src/**"
10+
- "pom.xml"
11+
# pull_request:
12+
# branches: [master]
13+
schedule:
14+
# ┌───────────── minute (0 - 59)
15+
# │ ┌───────────── hour (0 - 23)
16+
# │ │ ┌───────────── day of the month (1 - 31)
17+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
18+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
19+
# │ │ │ │ │
20+
# │ │ │ │ │
21+
# │ │ │ │ │
22+
# * * * * *
23+
- cron: "15 1 * * *"
24+
25+
permissions:
26+
contents: write
27+
28+
concurrency:
29+
group: ci-cd
30+
cancel-in-progress: false
31+
32+
jobs:
33+
release:
34+
runs-on: ubuntu-latest
35+
env:
36+
MVN: mvn --show-version --batch-mode
37+
steps:
38+
- name: jdk11
39+
uses: actions/setup-java@v2
40+
with:
41+
java-version: "11"
42+
distribution: "adopt"
43+
server-id: ossrh
44+
server-username: OSSRH_USR
45+
server-password: OSSRH_PWD
46+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
47+
- name: checkout
48+
uses: actions/checkout@v2
49+
- name: cache ~/.m2
50+
uses: actions/cache@v2
51+
with:
52+
path: ~/.m2
53+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
54+
- name: version set
55+
if: startsWith(github.ref, 'refs/tags/')
56+
run: $MVN versions:set -DnewVersion=${GITHUB_REF#refs/tags/}
57+
- name: mvn clean compile
58+
run: $MVN clean compile
59+
- name: mvn test
60+
run: $MVN test
61+
- name: mvn deploy
62+
run: $MVN --activate-profiles deploy --define gpg.passphrase=${{ secrets.GPG_PASSPHRASE }} --define skipTests deploy
63+
env:
64+
OSSRH_USR: ${{ secrets.OSSRH_USR }}
65+
OSSRH_PWD: ${{ secrets.OSSRH_PWD }}
66+
- name: mvn release
67+
if: startsWith(github.ref, 'refs/tags/')
68+
run: $MVN --activate-profiles deploy nexus-staging:release
69+
env:
70+
OSSRH_USR: ${{ secrets.OSSRH_USR }}
71+
OSSRH_PWD: ${{ secrets.OSSRH_PWD }}
72+
- name: github release
73+
uses: softprops/action-gh-release@v1
74+
if: startsWith(github.ref, 'refs/tags/')
75+
with:
76+
files: |
77+
target/payload-*.jar
78+
target/payload-*.jar.asc
79+
80+
# - name: Step To run on failure
81+
# if: ${{ failure() }}
82+
# run: $MVN --activate-profiles deploy nexus-staging:drop
83+
# env:
84+
# OSSRH_USR: ${{ secrets.OSSRH_USR }}
85+
# OSSRH_PWD: ${{ secrets.OSSRH_PWD }}

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ script:
3333

3434
after_success:
3535
- if [[ -n "$TRAVIS_TAG" && "$TRAVIS_JDK_VERSION" == "openjdk11" ]]; then
36-
$MAVEN_CMD nexus-staging:release --settings settings.xml;
36+
$MAVEN_CMD nexus-staging:release --activate-profiles deploy --settings settings.xml;
3737
fi
3838

3939
after_failure:
4040
- if [[ -n "$TRAVIS_TAG" && "$TRAVIS_JDK_VERSION" == "openjdk11" ]]; then
41-
$MAVEN_CMD nexus-staging:drop --settings settings.xml;
41+
$MAVEN_CMD nexus-staging:drop --activate-profiles deploy --settings settings.xml;
4242
fi
4343

4444
deploy:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Payload
2-
[![Build Status](https://travis-ci.com/juliaaano/payload.svg)](https://travis-ci.com/juliaaano/payload)
2+
[![ci](https://github.com/juliaaano/payload/actions/workflows/ci-cd.yml/badge.svg)](https://github.com/juliaaano/payload/actions/workflows/ci-cd.yml)
33
[![Release](https://img.shields.io/github/release/juliaaano/payload.svg)](https://github.com/juliaaano/payload/releases/latest)
44
[![Maven Central](https://img.shields.io/maven-central/v/com.juliaaano/payload.svg)](https://maven-badges.herokuapp.com/maven-central/com.juliaaano/payload)
55
[![Javadocs](http://www.javadoc.io/badge/com.juliaaano/payload.svg?color=blue)](http://www.javadoc.io/doc/com.juliaaano/payload)
@@ -53,7 +53,7 @@ pre defined providers in the classpath. You can also [implement your own](#custo
5353
<dependency>
5454
<groupId>com.juliaaano</groupId>
5555
<artifactId>payload</artifactId>
56-
<version>1.1.1</version>
56+
<version>1.1.3</version>
5757
</dependency>
5858
```
5959

pom.xml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
45

56
<modelVersion>4.0.0</modelVersion>
67

78
<groupId>com.juliaaano</groupId>
89
<artifactId>payload</artifactId>
9-
<version>1.1.2-SNAPSHOT</version>
10+
<version>1.1.4-SNAPSHOT</version>
1011
<packaging>jar</packaging>
1112

1213
<name>Payload</name>
@@ -16,15 +17,15 @@
1617
<licenses>
1718
<license>
1819
<name>MIT License</name>
19-
<url>http://www.juliaaano.com/LICENSE</url>
20+
<url>https://www.juliaaano.com/LICENSE</url>
2021
</license>
2122
</licenses>
2223

2324
<developers>
2425
<developer>
2526
<name>Juliano Mohr</name>
2627
<email>juliaaano@gmail.com</email>
27-
<organization>Juliaaano</organization>
28+
<organization>juliaaano</organization>
2829
<organizationUrl>https://www.juliaaano.com</organizationUrl>
2930
</developer>
3031
</developers>
@@ -215,12 +216,12 @@
215216
<goals>
216217
<goal>sign</goal>
217218
</goals>
218-
<!-- <configuration>
219+
<configuration>
219220
<gpgArguments>
220221
<arg>&#x002D;&#x002D;pinentry-mode</arg>
221222
<arg>loopback</arg>
222223
</gpgArguments>
223-
</configuration> -->
224+
</configuration>
224225
</execution>
225226
</executions>
226227
</plugin>

settings.xml

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

src/main/java/com/juliaaano/payload/InvalidMediaTypeException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Thrown to indicate that a client has passed an invalid or unsupported
55
* {@link MediaType}.
66
*
7-
* @author Juliano Mohr
7+
* @author JM
88
*/
99
public class InvalidMediaTypeException extends IllegalArgumentException {
1010

src/main/java/com/juliaaano/payload/MediaType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* type. Use it to retrieve {@link Payload} with the corresponding
2727
* {@link PayloadFactory}.
2828
*
29-
* @author Juliano Mohr
29+
* @author JM
3030
*/
3131
public enum MediaType {
3232

src/main/java/com/juliaaano/payload/Payload.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
* @param <T> the Java object type for which this payload is represented by.
1111
*
12-
* @author Juliano Mohr
12+
* @author JM
1313
*/
1414
public interface Payload<T> {
1515

src/main/java/com/juliaaano/payload/PayloadFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* therefore implementations of this factory should be media type specific,
88
* such as {@link com.juliaaano.payload.xml.XmlProviderFactory}.
99
*
10-
* @author Juliano Mohr
10+
* @author JM
1111
*/
1212
public interface PayloadFactory {
1313

src/main/java/com/juliaaano/payload/provider/Provider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* It should be extended by clients of the library who wish to support
88
* additional (custom) providers.
99
*
10-
* @author Juliano Mohr
10+
* @author JM
1111
*/
1212
public interface Provider {
1313

0 commit comments

Comments
 (0)