Skip to content

Commit

Permalink
Merge pull request #40 from reportportal/develop
Browse files Browse the repository at this point in the history
Release 5.0.0
  • Loading branch information
AmsterGet authored Mar 8, 2021
2 parents 6c3851f + ae8c623 commit 3e33432
Show file tree
Hide file tree
Showing 26 changed files with 8,522 additions and 1,068 deletions.
28 changes: 2 additions & 26 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
"no-case-declarations": "error",
"no-div-regex": "error",
"no-else-return": "error",
"no-empty-function": "error",
"no-empty-pattern": "error",
"no-eq-null": "error",
"no-eval": "error",
Expand Down Expand Up @@ -114,7 +113,6 @@
"no-void": "error",
"no-warning-comments": "off",
"no-with": "error",
"prefer-object-spread": "error",
"prefer-promise-reject-errors": "error",
"radix": "error",
"require-await": "error",
Expand All @@ -129,8 +127,7 @@
"no-restricted-globals": "error",
"no-shadow": "off",
"no-shadow-restricted-names": "error",
"no-undef": "error",
"no-undef-init": "error",
"no-undef": "off",
"no-undefined": "off",
"no-unused-vars": "error",

Expand Down Expand Up @@ -270,29 +267,9 @@
"object-curly-newline": "off",
"object-curly-spacing": ["error", "always"],
"object-property-newline": "off",
"one-var": ["error", "consecutive"],
"one-var-declaration-per-line": "error",
"operator-assignment": "error",
"operator-linebreak": ["error", "after"],
"padded-blocks": ["error", "never"],
"padding-line-between-statements": [
"error",
{
"blankLine": "always",
"prev": "*",
"next": "return"
},
{
"blankLine": "always",
"prev": ["const", "let", "var"],
"next": "*"
},
{
"blankLine": "any",
"prev": ["const", "let", "var"],
"next": ["const", "let", "var"]
}
],
"quote-props": ["error", "as-needed"],
"quotes": ["error", "single"],
"require-jsdoc": "warn",
Expand Down Expand Up @@ -337,13 +314,12 @@
"no-useless-constructor": "error",
"no-useless-rename": "error",
"no-var": "off",
"object-shorthand": ["error", "consistent-as-needed"],
"object-shorthand": "off",
"prefer-arrow-callback": "off",
"prefer-const": "off",
"prefer-destructuring": "off",
"prefer-numeric-literals": "off",
"prefer-rest-params": "off",
"prefer-spread": "error",
"prefer-template": "off",
"require-yield": "error",
"rest-spread-spacing": "error",
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/CI-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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: CI-pipeline

on:
push:
branches:
- develop
- '!master'
paths-ignore:
- README.md
- CHANGELOG.md
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Clean install of node dependencies
run: npm ci
- name: Run lint
run: npm run lint
- name: Run tests
run: npm test
- name: Check coverage
run: npm run test:coverage
72 changes: 72 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# 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: publish

on:
repository_dispatch:
types: [version-released]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Clean install of node dependencies
run: npm ci
- name: Run lint
run: npm run lint
- name: Run tests
run: npm test
- name: Check coverage
run: npm run test:coverage

publish-to-npm-and-gpr:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
registry-url: 'https://registry.npmjs.org'
- name: Clean install of node dependencies
run: npm ci
- name: Publish to NPM
run: |
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
npm config list
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
registry-url: 'https://npm.pkg.github.com'
scope: '@reportportal'
- name: Publish to GPR
run: |
npm config set //npm.pkg.github.com/:_authToken=$NODE_AUTH_TOKEN
npm config set scope '@reportportal'
npm config list
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GH_TOKEN }}
153 changes: 153 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
# 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: release

on:
push:
branches:
- master
paths-ignore:
- '.github/**'
- README.md
- CHANGELOG.md

env:
versionFileName: 'VERSION'
versionFragmentFileName: 'version_fragment'
changelogFileName: 'CHANGELOG.md'
jobs:
calculate-version:
runs-on: ubuntu-latest
outputs:
releaseVersion: ${{ steps.exposeVersion.outputs.releaseVersion }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Read version
id: readVersion
run: |
read -r version < ${{ env.versionFileName }}
echo "Snapshot version: $version";
version=$(echo $version | sed 's/-SNAPSHOT//');
echo $version;
echo "::set-output name=version::$version"
read -r versionFragment < ${{ env.versionFragmentFileName }}
echo $versionFragment
if [[ "$versionFragment" == "minor" ]]; then
versionFragment=feature
echo "Minor version will be used"
elif [[ "$versionFragment" == "major" ]]; then
echo "Major version will be used"
else
versionFragment=patch
echo "Patch version will be used"
fi
echo "::set-output name=versionFragment::$versionFragment"
- name: Bump release version if needed according to version fragment
if: steps.readVersion.outputs.versionFragment != 'patch'
id: bumpVersion
uses: christian-draeger/increment-semantic-version@1.0.1
with:
current-version: ${{ steps.readVersion.outputs.version }}
version-fragment: ${{ steps.readVersion.outputs.versionFragment }}
- name: Expose release version
id: exposeVersion
run: |
versionFragment=${{ steps.readVersion.outputs.versionFragment }}
if [[ "$versionFragment" != "patch" ]]; then
echo "::set-output name=releaseVersion::${{ steps.bumpVersion.outputs.next-version }}"
else
echo "::set-output name=releaseVersion::${{ steps.readVersion.outputs.version }}"
fi
create-tag:
needs: calculate-version
runs-on: ubuntu-latest
outputs:
versionInfo: ${{ steps.readChangelogEntry.outputs.log_entry }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Configure git
run: |
git config --global user.email "reportportal.io"
git config --global user.name "reportportal.io"
git remote set-url origin https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
- name: Update VERSION file
run: |
echo "${{ needs.calculate-version.outputs.releaseVersion }}" > ${{ env.versionFileName }}
git status
git add ${{ env.versionFileName }}
git commit -m "Update VERSION file with ${{ needs.calculate-version.outputs.releaseVersion }}"
- name: Create tag
run: |
git tag -a v${{ needs.calculate-version.outputs.releaseVersion }} -m ${{ needs.calculate-version.outputs.releaseVersion }}
npm version from-git
git push origin master
- name: Update version in changelog file
run: |
releaseDate=$(date +'%Y-%m-%d')
echo "Release date: $releaseDate"
versionInfo="## [${{ needs.calculate-version.outputs.releaseVersion }}] - $releaseDate"
sed -i '1s/^/\n'"$versionInfo"'\n/' ${{ env.changelogFileName }}
git status
git add ${{ env.changelogFileName }}
git commit -m "Mention ${{ needs.calculate-version.outputs.releaseVersion }} version in changelog file"
git push origin master
- name: Read changelog Entry
id: readChangelogEntry
uses: mindsers/changelog-reader-action@v1.1.0
with:
version: ${{ needs.calculate-version.outputs.releaseVersion }}
path: ./${{ env.changelogFileName }}
- name: Bump snapshot version
id: bumpSnapshotVersion
uses: christian-draeger/increment-semantic-version@1.0.1
with:
current-version: ${{ needs.calculate-version.outputs.releaseVersion }}
version-fragment: 'bug'
- name: Update develop with snapshot version
run: |
git fetch
git checkout develop
git merge master -Xtheirs --allow-unrelated-histories
echo "${{ steps.bumpSnapshotVersion.outputs.next-version }}-SNAPSHOT" > ${{ env.versionFileName }}
git status
git add ${{ env.versionFileName }}
git commit -m "${{ needs.calculate-version.outputs.releaseVersion }} -> ${{ steps.bumpSnapshotVersion.outputs.next-version }}-SNAPSHOT"
git push origin develop
create-release:
needs: [calculate-version, create-tag]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Create Release
id: createRelease
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
tag_name: v${{ needs.calculate-version.outputs.releaseVersion }}
release_name: Release v${{ needs.calculate-version.outputs.releaseVersion }}
body: ${{ needs.create-tag.outputs.versionInfo }}
draft: false
prerelease: false
- name: Trigger the publish workflow
if: success()
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.GH_TOKEN }}
event-type: version-released
24 changes: 5 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,9 @@ typings/
# dotenv environment variables file
.env

# parcel-bundler cache (https://parceljs.org/)
.cache
# IDE
.vscode/
.idea/

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless

# FuseBox cache
.fusebox/

# VS code
.vscode/
# Npm configuration file
.npmrc
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
coverage
.gitignore
.editorconfig
.github/
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

Loading

0 comments on commit 3e33432

Please sign in to comment.