This repository has been archived by the owner on Nov 3, 2023. It is now read-only.
Merge branch 'release/0.0.6' #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Produces and releases artifacts | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Build and run tests on JDK ${{ matrix.java }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
# Restore the cache first | |
- name: Cache .m2 | |
uses: actions/cache@v1 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven | |
# Get GPG private key into GPG | |
- name: Import GPG Owner Trust | |
run: echo ${{ secrets.GPG_OWNERTRUST }} | base64 --decode | gpg --import-ownertrust | |
- name: Import GPG key | |
run: echo ${{ secrets.GPG_SECRET_KEYS }} | base64 --decode | gpg --import --no-tty --batch --yes | |
# Setup JDK and .m2/settings.xml | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
server-id: ossrh | |
server-username: OSS_CENTRAL_USERNAME # env variable for Maven Central | |
server-password: OSS_CENTRAL_PASSWORD # env variable for Maven Central | |
# Prepare | |
- name: Prepare Maven Wrapper | |
run: chmod +x ./mvnw | |
# Build | |
- name: Build with Maven | |
run: ./mvnw clean verify -U -B -T4 | |
# I-Test | |
- name: Run I-Test | |
run: ./mvnw verify -Pitest -U -B -T4 | |
# Publish release | |
- name: Deploy a new release version to Maven Central | |
run: ./mvnw clean deploy -B -DskipTests -DskipExamples -Prelease -Dgpg.keyname="${{ secrets.GPG_KEYNAME }}" -Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}" | |
env: | |
OSS_CENTRAL_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
OSS_CENTRAL_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
# Code analysis | |
- name: Upolad coverage information | |
uses: codecov/codecov-action@v1.0.2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Upload coverage to Codacy | |
uses: codacy/codacy-coverage-reporter-action@v1 | |
with: | |
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
coverage-reports: examples/coverage-aggregate/target/site/jacoco-aggregate/jacoco.xml |