Skip to content

Commit

Permalink
Merge pull request #95 from reportportal/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
HardNorth authored Aug 6, 2021
2 parents 17e4be3 + 6ebdefc commit 568d813
Show file tree
Hide file tree
Showing 20 changed files with 281 additions and 267 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew build
117 changes: 117 additions & 0 deletions .github/workflows/promote.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# Copyright 2021 EPAM Systems
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Promote

on:
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: true

env:
REPOSITORY_URL: 'https://maven.pkg.github.com'
UPSTREAM_REPOSITORY_URL: 'https://oss.sonatype.org'
PACKAGE_SUFFIXES: '-javadoc.jar,-javadoc.jar.asc,-sources.jar,-sources.jar.asc,.jar,.jar.asc,.pom,.pom.asc'
PACKAGE: 'com.epam.reportportal'


jobs:
build:
runs-on: ubuntu-latest

steps:

- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Get variables
run: |
echo "ARTIFACT=`echo ${{ github.repository }} | cut -d/ -f2- | awk '{print tolower($0)}'`" >> $GITHUB_ENV
echo "PACKAGE_PATH=`echo ${{ env.PACKAGE }} | sed 's/\./\//g'`" >> $GITHUB_ENV
- name: Upload package
run: |
IFS=',' read -a files <<< '${{ env.PACKAGE_SUFFIXES }}'
for f in ${files[@]}; do
export URL="${{ env.REPOSITORY_URL }}/${{ github.repository }}/${PACKAGE_PATH}/${ARTIFACT}/${{ github.event.inputs.version }}/${ARTIFACT}-${{ github.event.inputs.version }}${f}"
echo "Downloading artifact: ${URL}"
curl -f -u ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} -s -O -L "${URL}"
done
files=($(ls))
echo 'Files downloaded:'
echo "${files[@]}"
echo 'Bundle generation'
export BUNDLE_FILE="bundle.jar"
jar -cvf ${BUNDLE_FILE} "${files[@]}"
echo 'Bundle upload'
curl -u ${{ secrets.SONATYPE_USER }}:${{ secrets.SONATYPE_PASSWORD }} -L \
--request POST '${{ env.UPSTREAM_REPOSITORY_URL }}/service/local/staging/bundle_upload' \
--form "file=@${BUNDLE_FILE}" >response.json
response_type=`jq type response.json || echo ''`
if [ -z "$response_type" ]; then
echo 'ERROR: Response is not JSON!' 1>&2
cat response.json 1>&2
exit 1
fi
repo=`jq -r '.repositoryUris[0]' response.json`
if [ -z "$repo" ]; then
echo 'Unable to upload bundle' 1>&2
cat response.json 1>&2
exit 1
fi
echo "NEXUS_REPOSITORY=${repo}" >> $GITHUB_ENV
- name: Get repository variables
run: |
echo "NEXUS_REPOSITORY_NAME=`echo ${NEXUS_REPOSITORY} | sed -E 's/(.+)\/([^\/]+)$/\2/'`" >> $GITHUB_ENV
- name: Promote package
env:
ATTEMPTS: 60
SLEEP_TIME: 10
run: |
verified=false
for i in `seq 0 ${ATTEMPTS}`; do
sleep $SLEEP_TIME
curl -f -s -u ${{ secrets.SONATYPE_USER }}:${{ secrets.SONATYPE_PASSWORD }} -L \
--header 'Accept: application/json' \
${{ env.UPSTREAM_REPOSITORY_URL }}/service/local/staging/repository/${NEXUS_REPOSITORY_NAME} >result.json
is_closed=`jq -r '.type' result.json`
is_transitioning=`jq -r '.transitioning' result.json`
echo "Current repository status: $is_closed; transitioning: $is_transitioning"
if [[ "$is_closed" == "closed" && "$is_transitioning" == "false" ]]; then
verified=true
break
fi
done
if $verified; then
echo "A bundle was verified, releasing"
curl -f -u ${{ secrets.SONATYPE_USER }}:${{ secrets.SONATYPE_PASSWORD }} -L \
--header 'Content-Type: application/json' \
--data-raw "{\"data\":{\"stagedRepositoryIds\":[\"${NEXUS_REPOSITORY_NAME}\"], \"description\":\"Releasing ${{ github.event.inputs.version }}\"}}" \
--request POST ${{ env.UPSTREAM_REPOSITORY_URL }}/service/local/staging/bulk/promote
else
echo 'Verification failed, please check the bundle' 1>&2
exit 1
fi
22 changes: 13 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ on:
env:
VERSION_FILE: gradle.properties
VERSION_EXTRACT_PATTERN: '(?<=version=).+'
GH_USER_NAME: github.actor
REPOSITORY_URL: 'https://maven.pkg.github.com/'
CHANGE_LOG_FILE: CHANGELOG.md
CHANGE_LOG_TMP_FILE: CHANGELOG_updated.md
README_FILE: README.md
Expand All @@ -42,7 +42,7 @@ jobs:
uses: actions/checkout@v2

- name: Generate versions
uses: HardNorth/github-version-generate@v1.0.2
uses: HardNorth/github-version-generate@v1.1.1
with:
version-source: file
version-file: ${{ env.VERSION_FILE }}
Expand All @@ -61,14 +61,18 @@ jobs:
with:
name: 'reportportal.io'
email: '[email protected]'
token: ${{ secrets.GH_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Release with Gradle
id: release
run: |
./gradlew release -PreleaseMode -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=${{env.RELEASE_VERSION}} \
-Prelease.newVersion=${{env.NEXT_VERSION}} -PbintrayUser=${{secrets.BINTRAY_USER}} -PbintrayApiKey=${{secrets.BINTRAY_API_KEY}} \
-PgithubUserName=${{env.GH_USER_NAME}} -PgithubToken=${{secrets.GITHUB_TOKEN}}
./gradlew release -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=${{ env.RELEASE_VERSION }} \
-Prelease.newVersion=${{ env.NEXT_VERSION }} -PpublishRepo=${{ env.REPOSITORY_URL }}${{ github.repository }} \
-PgithubUserName=${{ github.actor }} -PgithubToken=${{ secrets.GITHUB_TOKEN }} \
-PgpgPassphrase=${{ secrets.GPG_PASSPHRASE }} -PgpgPrivateKey="$(cat <<'EOF'
${{ secrets.GPG_PRIVATE_KEY }}
EOF
)"
- name: Update README.md
id: readmeUpdate
Expand Down Expand Up @@ -102,7 +106,7 @@ jobs:
id: createRelease
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_VERSION }}
release_name: Release ${{ env.RELEASE_VERSION }}
Expand All @@ -111,15 +115,15 @@ jobs:
prerelease: false

- name: Checkout develop branch
if: ${{github.ref}} == 'master'
if: ${{ github.ref }} == 'master'
uses: actions/checkout@v2
with:
ref: 'develop'
fetch-depth: 0

- name: Merge release branch into develop
id: mergeIntoDevelop
if: ${{github.ref}} == 'master'
if: ${{ github.ref }} == 'master'
run: |
git merge -m 'Merge master branch into develop after a release' origin/master
git status | (! grep -Fq 'both modified:') || git status | grep -F 'both modified:' \
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Changelog

## [Unreleased]
### Changed
- Client version updated on [5.1.0-RC-6](https://github.com/reportportal/client-java/releases/tag/5.1.0-RC-6)
- Version changed on 5.1.0

## [5.1.0-ALPHA-1]
### Changed
- Client version updated on [5.1.0-ALPHA-5](https://github.com/reportportal/client-java/releases/tag/5.1.0-ALPHA-5)

## [5.0.0]
### Added
Expand Down
73 changes: 10 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
> after a successful launch start. This information might help us to improve both ReportPortal backend and client sides. It is used by the
> ReportPortal team only and is not supposed for sharing with 3rd parties.
[![Maven Central](https://img.shields.io/maven-central/v/com.epam.reportportal/agent-java-junit.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-junit%22)
![CI Build](https://github.com/reportportal/agent-java-junit/workflows/CI%20Build/badge.svg?branch=develop)
[ ![Download](https://api.bintray.com/packages/epam/reportportal/agent-java-junit/images/download.svg) ](https://bintray.com/epam/reportportal/agent-java-junit/_latestVersion)
[![Join Slack chat!](https://reportportal-slack-auto.herokuapp.com/badge.svg)](https://reportportal-slack-auto.herokuapp.com)
[![stackoverflow](https://img.shields.io/badge/reportportal-stackoverflow-orange.svg?style=flat)](http://stackoverflow.com/questions/tagged/reportportal)
[![Build with Love](https://img.shields.io/badge/build%20with-❤%EF%B8%8F%E2%80%8D-lightgrey.svg)](http://reportportal.io?style=flat)

#### Overview: How to Add ReportPortal Logging to Your JUnit Java Project
Report Portal supports JUnit 4 tests. The integration is built on top of [JUnit Foundation](https://github.com/sbabcoc/JUnit-Foundation) framework by [Scott Babcock](https://github.com/sbabcoc).

1. [Configuration](#configuration): Create/update the **_reportportal.properties_** configuration file
2. [Logback Framework](#logback-framework): For the Logback framework:
Expand Down Expand Up @@ -89,18 +90,7 @@ In your project, create or update a file named logback.xml in the src/main/resou
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
</properties>

<repositories>
<repository>
<id>bintray</id>
<url>http://dl.bintray.com/epam/reportportal</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>


<dependencies>
<dependency>
<groupId>ch.qos.logback</groupId>
Expand Down Expand Up @@ -189,17 +179,6 @@ In your project, create or update a file named logback.xml in the src/main/resou
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
</properties>

<repositories>
<repository>
<id>bintray</id>
<url>http://dl.bintray.com/epam/reportportal</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>

<dependencies>
<dependency>
Expand Down Expand Up @@ -293,9 +272,6 @@ description = 'ReportPortal JUnit 4 example'
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'https://jitpack.io' }
maven { url "http://dl.bintray.com/epam/reportportal" }
}
dependencies {
Expand Down Expand Up @@ -414,22 +390,7 @@ We’ll assume that Report Portal is installed and running on <http://localhost:

#### Step 2 - Configure pom.xml

##### 2.1 Add following repositories:

```xml
<repositories>
<repository>
<id>bintray</id>
<url>http://dl.bintray.com/epam/reportportal</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
```

##### 2.2 Add following dependencies:
##### 2.1 Add following dependencies:

*Report Portal agent implementation for JUnit 4*
```xml
Expand All @@ -440,11 +401,11 @@ We’ll assume that Report Portal is installed and running on <http://localhost:
<scope>test</scope>
</dependency>
```
Note that `agent-java-junit` brings in `JUnit 4.12` and the `JUnit Foundation` library as transitive dependencies, so these don't need to be declared explicitly in your project.
Note that `agent-java-junit` brings in `JUnit` and the `JUnit Foundation` library as transitive dependencies, so these don't need to be declared explicitly in your project.

> Latest version of the agent, could be found [here](https://bintray.com/epam/reportportal/agent-java-junit)
> Latest version of the agent, could be found [here](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-junit%22)
##### 2.3 Add Report Portal dedicated logger wrapper
##### 2.2 Add Report Portal dedicated logger wrapper

If you prefer using **Logback** logging library, add following dependencies:

Expand All @@ -456,7 +417,7 @@ If you prefer using **Logback** logging library, add following dependencies:
<version>5.0.3</version>
</dependency>
```
> Up to date version could be found [here](https://bintray.com/epam/reportportal/logger-java-logback)
> Up to date version could be found [here](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22logger-java-logback%22)
*The logback itself*
```xml
Expand All @@ -477,7 +438,7 @@ If you prefer using **Log4j** logging library, add following dependencies:
<version>5.0.3</version>
</dependency>
```
> Up to date version could be found [here](https://bintray.com/epam/reportportal/logger-java-log4j)
> Up to date version could be found [here](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22logger-java-log4j%22)
*The log4j itself*
```xml
Expand Down Expand Up @@ -697,17 +658,6 @@ in this case - add a `maven dependency plugin` dependency explicitly, like this:
<artifactId>myProject</artifactId>
<version>1.0-SNAPSHOT</version>

<repositories>
<repository>
<id>bintray</id>
<url>http://dl.bintray.com/epam/reportportal</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>com.epam.reportportal</groupId>
Expand Down Expand Up @@ -819,7 +769,7 @@ You can put the jar directly in the project tree or use the one, that Maven down
On MAC OS system the path to maven downloaded junit-foundation.jar would have the following format:

```shell
/Users/<user_name>/.m2/repository/com/nordstrom/tools/junit-foundation/9.4.3/junit-foundation-9.4.3.jar
/Users/<user_name>/.m2/repository/com/nordstrom/tools/junit-foundation/12.5.3/junit-foundation-12.5.3.jar
```

When you are done adding local run configuration, simply go to *Run* -> *Run '<test_run_name>'* and that test run results will be sent to Report Portal
Expand All @@ -844,9 +794,6 @@ targetCompatibility = 1.8
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'https://jitpack.io' }
maven { url "http://dl.bintray.com/epam/reportportal" }
}
dependencies {
Expand Down
Loading

0 comments on commit 568d813

Please sign in to comment.