Skip to content

Commit

Permalink
Merge pull request #28 from reportportal/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
HardNorth authored Sep 23, 2021
2 parents 24cff0b + 696365c commit da535a7
Show file tree
Hide file tree
Showing 7 changed files with 175 additions and 64 deletions.
37 changes: 23 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,34 @@ name: CI Build
on:
push:
branches:
- '*'
- '!master'
- '!v4-hotfix'
- '*'
- '!master'
- '!v4-hotfix'
paths-ignore:
- README.md
- README_TEMPLATE.md
- gradle.properties
- CHANGELOG.md

pull_request:
branches:
- master
- v4-hotfix
- master
- v4-hotfix

jobs:
build:
runs-on: ubuntu-latest

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
- 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
38 changes: 22 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
branches:
- master
- v4-hotfix

paths-ignore:
- '.github/**'
- README.md
Expand All @@ -27,9 +28,10 @@ on:

env:
VERSION_FILE: gradle.properties
GH_USER_NAME: github.actor
VERSION_EXTRACT_PATTERN: '(?<=version=).+'
CHANGE_LOG_FILE: CHANGELOG.md
CHANGE_LOG_TMP_FILE: CHANGELOG_updated.md
REPOSITORY_URL: 'https://maven.pkg.github.com/'

jobs:
release:
Expand All @@ -39,11 +41,11 @@ jobs:
uses: actions/checkout@v2

- name: Generate versions
uses: HardNorth/github-version-generate@v1.0.1
uses: HardNorth/github-version-generate@v1.1.0
with:
version-source: file
version-file: gradle.properties
version-file-extraction-pattern: '(?<=version=).+'
version-file: ${{ env.VERSION_FILE }}
version-file-extraction-pattern: ${{ env.VERSION_EXTRACT_PATTERN }}

- name: Set up JDK 1.8
uses: actions/setup-java@v1
Expand All @@ -54,7 +56,7 @@ jobs:
run: chmod +x gradlew

- name: Setup git credentials
uses: oleksiyrudenko/gha-git-credentials@v1
uses: oleksiyrudenko/gha-git-credentials@v2
with:
name: 'reportportal.io'
email: '[email protected]'
Expand All @@ -63,16 +65,13 @@ jobs:
- 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}}
- name: Read changelog Entry
id: readChangelogEntry
uses: mindsers/[email protected]
with:
version: 'Unreleased'
path: ./${{ env.CHANGE_LOG_FILE }}
./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 CHANGELOG.md
id: changelogUpdate
Expand All @@ -88,11 +87,18 @@ jobs:
git commit -m "Changelog update"
git push
- name: Read changelog Entry
id: readChangelogEntry
uses: mindsers/[email protected]
with:
version: ${{ env.RELEASE_VERSION }}
path: ./${{ env.CHANGE_LOG_FILE }}

- name: Create Release
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 Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Changelog

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

## [5.0.3]
### Changed
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# logger-java-logback
[ ![Download](https://api.bintray.com/packages/epam/reportportal/logger-java-logback/images/download.svg) ](https://bintray.com/epam/reportportal/logger-java-logback/_latestVersion)

[![Maven Central](https://img.shields.io/maven-central/v/com.epam.reportportal/logger-java-logback.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22logger-java-logback%22)
[![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)
[![UserVoice](https://img.shields.io/badge/uservoice-vote%20ideas-orange.svg?style=flat)](https://rpp.uservoice.com/forums/247117-report-portal)
Expand Down Expand Up @@ -65,7 +64,7 @@ In this case a log message should have next format:

#### Grayscale images
There is a client parameter into `reportportal.properties` with `boolean` type value for screenshots sending in `grayscale` or `color`
view. By default it is set as `true` and all pictures for Report Portal will be in `grayscale` format.
view. By default, it is set as `true` and all pictures for Report Portal will be in `grayscale` format.

**reportportal.properties**
```properties
Expand Down
34 changes: 5 additions & 29 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,47 +15,23 @@
*/
apply plugin: 'java-library'

project.ext.releaseMode = project.hasProperty('releaseMode')

def branch = releaseMode ? '5.0.0' : 'develop'
apply from: "https://raw.githubusercontent.com/reportportal/gradle-scripts/$branch/release-commons.gradle"
apply from: "https://raw.githubusercontent.com/reportportal/gradle-scripts/$branch/build-quality.gradle"
apply from: "${project.scripts_url}/${project.scripts_branch}/build-quality.gradle"
apply from: "${project.scripts_url}/${project.scripts_branch}/release-commons.gradle"
apply from: "${project.scripts_url}/${project.scripts_branch}/signing.gradle"

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

repositories {
jcenter()
mavenLocal()
releaseMode ? maven { url "http://dl.bintray.com/epam/reportportal" } : maven { url "https://jitpack.io" }
}

project.ext.githubUserName = project.hasProperty('githubUserName') ? githubUserName : ""
project.ext.githubToken = project.hasProperty('githubToken') ? githubToken : ""

publishing {
repositories {
maven {
name = "Logback GitHub Packages"
url = uri("https://maven.pkg.github.com/reportportal/logger-java-logback")
credentials {
username = githubUserName
password = githubToken
}
}
}
mavenCentral()
}

dependencies {
implementation 'com.epam.reportportal:client-java:5.0.6'
implementation 'com.epam.reportportal:client-java:5.1.0-RC-12'
implementation 'com.epam.reportportal:commons-model:5.0.0'
implementation 'ch.qos.logback:logback-classic:1.2.3'
}

wrapper {
gradleVersion = '5.4.1'
}

def releaseDependencies = [bintrayUpload, publish]
releaseDependencies.addAll(afterReleaseBuild.getDependsOn())
afterReleaseBuild.setDependsOn(releaseDependencies)
6 changes: 4 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
version=5.0.4-SNAPSHOT
description=EPAM Report portal. Logback Integration
version=5.1.0-RC-1-SNAPSHOT
description=EPAM Report portal. Logback Integration
scripts_url=https://raw.githubusercontent.com/reportportal/gradle-scripts
scripts_branch=develop

0 comments on commit da535a7

Please sign in to comment.