Skip to content

Commit

Permalink
ci: Use GitHub action to publish to maven central
Browse files Browse the repository at this point in the history
  • Loading branch information
kripaliz committed Aug 7, 2021
1 parent bf4a25f commit c4911ad
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 45 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/maven-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Maven Package

on:
release:
types: [created]

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: mvn -B package

- name: Install gpg secret key
run: |
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- name: Publish
run: |
export GPG_TTY=$(tty)
mvn \
--no-transfer-progress \
--batch-mode \
-Prelease \
-Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} \
deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
19 changes: 19 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CI
on: pull_request

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: mvn -B package
26 changes: 0 additions & 26 deletions .maven.xml

This file was deleted.

15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# UnifiedBDD Automation Parent

## BDD automation testing made simple
[![Build Status](https://travis-ci.org/kripaliz/unifiedbdd-automation-parent.svg?branch=master)](https://travis-ci.org/kripaliz/unifiedbdd-automation-parent)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.kripaliz/unifiedbdd-automation-parent/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.kripaliz/unifiedbdd-automation-parent)

This parent pom is a helper for [unifiedbdd-automation-framework](https://github.com/kripaliz/unifiedbdd-automation-framework) that references it as a dependency and some useful plugin configuration that you can inherit in your test suite.
14 changes: 11 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</parent>
<groupId>com.github.kripaliz</groupId>
<artifactId>unifiedbdd-automation-parent</artifactId>
<version>0.1.4</version>
<version>0.1.5</version>
<packaging>pom</packaging>

<properties>
Expand All @@ -22,7 +22,7 @@
<dependency>
<groupId>com.github.kripaliz</groupId>
<artifactId>unifiedbdd-automation-framework</artifactId>
<version>0.1.4</version>
<version>0.1.5</version>
</dependency>
</dependencies>

Expand Down Expand Up @@ -155,6 +155,9 @@
</goals>
</execution>
</executions>
<configuration>
<additionalJOption>-Xdoclint:none</additionalJOption>
</configuration>
</plugin>
<!-- To sign the artifacts -->
<plugin>
Expand All @@ -170,10 +173,15 @@
</goals>
</execution>
</executions>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>

0 comments on commit c4911ad

Please sign in to comment.