Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ name: nightly

on:
schedule:
- cron: 0 0 * * *
- cron: 0 0 * * 1

jobs:
build:
nightly:
timeout-minutes: 30

runs-on: ubuntu-latest

steps:
Expand All @@ -14,10 +16,11 @@ jobs:
with:
java-version: 11

- uses: actions/checkout@v1
- name: checkout
uses: actions/checkout@v2

- name: caching
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
Expand All @@ -30,16 +33,17 @@ jobs:
run: mvn surefire:test

- name: integration-tests
run: mvn jacoco:restore-instrumented-classes failsafe:integration-test failsafe:verify
run: mvn -DskipUTs -Dgpg.skip=true jacoco:restore-instrumented-classes verify

- name: sonar-analyse
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_HOST: ${{ secrets.OS_SONAR_HOST_URL }}
SONAR_TOKEN: ${{ secrets.OS_SONAR_TOKEN }}
run: |
export SONAR_ORGANIZATION=$(echo ${GITHUB_REPOSITORY} | cut -d / -f 1)
mvn sonar:sonar \
-Dsonar.host.url=https://sonarcloud.io/ \
-Dsonar.login=${{ secrets.SONAR_TOKEN }} \
-Dsonar.host.url=${SONAR_HOST} \
-Dsonar.login=${SONAR_TOKEN} \
-Dsonar.organization=${SONAR_ORGANIZATION} \
-Dsonar.projectKey=${GITHUB_REPOSITORY//\//_} \
-Dsonar.java.binaries=./target/classes
48 changes: 27 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,50 +7,56 @@ on:

jobs:
release:
timeout-minutes: 30

env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

runs-on: ubuntu-latest

steps:
- name: setup-java
uses: actions/setup-java@v1
with:
java-version: 11
server-id: ossrh
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD

- name: setup-github-release
run: sed -i -e 's/<\/servers>/<server><id>github<\/id><username>x-access-token<\/username><password>${GITHUB_TOKEN}<\/password><\/server><\/servers>/g' /home/runner/.m2/settings.xml

- name: setup-gpg
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
run: echo ${GPG_PRIVATE_KEY} | base64 --decode | gpg --batch --import

- name: setup-maven-settings
uses: s4u/maven-settings-action@v1
with:
servers: '[{"id": "ossrh", "username": "${OSSRH_USERNAME}", "password": "${OSSRH_PASSWORD}"}, {"id": "github", "username": "x-access-token", "password": "${GITHUB_TOKEN}"}]'
properties: '[{"gpg.executable": "gpg"}, {"gpg.passphrase": "${GPG_PASSPHRASE}"}]'
sonatypeSnapshots: true
GPG_PRIVATE_KEY: ${{ secrets.OS_GPG_PRIVATE_KEY }}
run: cat <(echo -e "${GPG_PRIVATE_KEY}") | gpg --batch --import

- name: checkout
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: caching
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-

- name: deploy
env:
OSSRH_USERNAME: ${{ secrets.OS_OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OS_OSSRH_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.OS_GPG_PASSPHRASE }}
run: mvn deploy -Dmaven.wagon.http.pool=false -Dgpg.executable=gpg -Dgpg.passphrase=${GPG_PASSPHRASE}

- name: sonar-analyse
env:
SONAR_HOST: ${{ secrets.OS_SONAR_HOST_URL }}
SONAR_TOKEN: ${{ secrets.OS_SONAR_TOKEN }}
run: |
export SONAR_ORGANIZATION=$(echo ${GITHUB_REPOSITORY} | cut -d / -f 1)
mvn clean verify sonar:sonar \
-Dsonar.host.url=https://sonarcloud.io/ \
-Dsonar.login=${{ secrets.SONAR_TOKEN }} \
mvn sonar:sonar \
-Dsonar.host.url=${SONAR_HOST} \
-Dsonar.login=${SONAR_TOKEN} \
-Dsonar.organization=${SONAR_ORGANIZATION} \
-Dsonar.projectKey=${GITHUB_REPOSITORY//\//_} \
-Dsonar.java.binaries=./target/classes

- name: deploy
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
run: mvn deploy
55 changes: 47 additions & 8 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ on:
types: [opened, synchronize]

jobs:
build:
review:
timeout-minutes: 30

runs-on: ubuntu-latest

steps:
Expand All @@ -15,10 +17,44 @@ jobs:
java-version: 11

- name: checkout
uses: actions/checkout@v1
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GPR_TOKEN }}
fetch-depth: ''

- name: post-checkout
run: git fetch --prune --unshallow

- name: action-configuration-autoupdate
id: actions_action_configuration_autoupdate
uses: avides/actions-action-configuration-autoupdate@v1
with:
token: ${{ secrets.GPR_TOKEN }}
actions-configuration-files: os-java-library/nightly.yml,os-java-library/release.yml,os-java-library/review.yml
source-repository: ${{ secrets.ACTIONS_CONFIG_AUTOUPDATE_REPO }}

- uses: stefanzweifel/git-auto-commit-action@v4
with:
file_pattern: .github/workflows/*.yml
commit_user_name: ${{ secrets.ACTIONS_CONFIG_AUTOUPDATE_USER }}
commit_user_email: ${{ secrets.ACTIONS_CONFIG_AUTOUPDATE_EMAIL }}
commit_author: ${{ secrets.ACTIONS_CONFIG_AUTOUPDATE_AUTHOR }}
commit_message: Update GitHub Action configuration

- name: action-configuration-updated
if: ${{ steps.actions_action_configuration_autoupdate.outputs.updated }}
run: exit 1;

- name: project-version-check
uses: avides/actions-project-version-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
file-to-check: pom.xml
additional-files-to-check: README.md

- name: caching
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
Expand All @@ -31,20 +67,23 @@ jobs:
run: mvn surefire:test

- name: integration-tests
run: mvn jacoco:restore-instrumented-classes failsafe:integration-test failsafe:verify
run: mvn -DskipUTs -Dgpg.skip=true jacoco:restore-instrumented-classes verify

- name: sonar-analyse
env:
SONAR_HOST: ${{ secrets.OS_SONAR_HOST_URL }}
SONAR_TOKEN: ${{ secrets.OS_SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export GITHUB_PULL_REQUEST=$(cut -d / -f 3 <(echo ${GITHUB_REF}))
export SONAR_ORGANIZATION=$(echo ${GITHUB_REPOSITORY} | cut -d / -f 1)
mvn sonar:sonar \
-Dsonar.host.url=https://sonarcloud.io/ \
-Dsonar.login=${{ secrets.SONAR_TOKEN }} \
-Dsonar.host.url=${SONAR_HOST} \
-Dsonar.login=${SONAR_TOKEN} \
-Dsonar.organization=${SONAR_ORGANIZATION} \
-Dsonar.projectKey=${GITHUB_REPOSITORY//\//_} \
-Dsonar.pullrequest.key=${GITHUB_PULL_REQUEST} \
-Dsonar.pullrequest.key=${{ github.event.number }} \
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }} \
-Dsonar.scm.revision=${{ github.event.pull_request.head.sha }} \
-Dsonar.java.binaries=./target/classes
- name: pom-analyse
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<dependency>
<groupId>com.avides.xpath</groupId>
<artifactId>xpath-utils</artifactId>
<version>2.0.0</version>
<version>2.1.0</version>
</dependency>
```
#### Available methods
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>com.avides.xpath</groupId>
<artifactId>xpath-utils</artifactId>
<version>2.0.0</version>
<version>2.1.0</version>

<name>xpath-utils</name>
<description>Provides some utility-methods to simplify the use of XPath</description>
Expand Down Expand Up @@ -68,7 +68,7 @@
<github-release-plugin.version>1.4.0</github-release-plugin.version>
<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
<!-- Other -->
<xom.version>1.2.10</xom.version>
<xom.version>1.3.4</xom.version>
<slf4j.version>1.7.25</slf4j.version>
</properties>

Expand All @@ -81,7 +81,7 @@

<dependencies>
<dependency>
<groupId>com.io7m.xom</groupId>
<groupId>xom</groupId>
<artifactId>xom</artifactId>
<version>${xom.version}</version>
<exclusions>
Expand Down