Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 5.0.0 #13

Merged
merged 16 commits into from
Feb 15, 2024
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
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# editorconfig.org

root = true

[*]
end_of_line = lf
insert_final_newline = true

[*.ts]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.idea/
node_modules/*
package.json
package-lock.json
build/
39 changes: 39 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"env": {
"es6": true,
"node": true
},
"extends": [
"airbnb-typescript/base",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:import/recommended"
],
"plugins": ["prettier"],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"project": "./tsconfig.eslint.json"
},
"rules": {
"no-plusplus": 0,
"prettier/prettier": 2,
"class-methods-use-this": 0,
"no-else-return": 0,
"lines-between-class-members": 0,
"import/no-extraneous-dependencies": 0,
"func-names": 0,
"import/prefer-default-export": 0,
"@typescript-eslint/ban-ts-ignore": 0,
"@typescript-eslint/ban-ts-comment": 0,
"@typescript-eslint/no-implied-eval": 0,
"dot-notation": 0,
"@typescript-eslint/naming-convention": 0,
"@typescript-eslint/no-explicit-any": 1
}
}
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 2024 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
- '!main'
paths-ignore:
- README.md
- CHANGELOG.md
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install of node dependencies
run: npm install
- name: Build the source code
run: npm run build
- name: Run lint
run: npm run lint
#- name: Run tests and check coverage
# run: npm run test:coverage
74 changes: 74 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Copyright 2024 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@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install of node dependencies
run: npm install
- name: Build the source code
run: npm run build
- name: Run lint
run: npm run lint
#- name: Run tests and 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@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- name: Install of node dependencies
run: npm install
- name: Build the source code
run: npm run build
- 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@v3
with:
node-version: 20
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.GITHUB_TOKEN }}
159 changes: 159 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
# Copyright 2024 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:
- main
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@v3
- 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@v3
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: '12'
- 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 main
- 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 main
- 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 main -Xtheirs --allow-unrelated-histories
echo "${{ steps.bumpSnapshotVersion.outputs.next-version }}-SNAPSHOT" > ${{ env.versionFileName }}
echo "patch" > ${{ env.versionFragmentFileName }}
git status
git add ${{ env.versionFileName }}
git add ${{ env.versionFragmentFileName }}
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@v3
- name: Create Release
id: createRelease
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_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.GITHUB_TOKEN }}
event-type: version-released
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# ide
.idea/

# dependencies
node_modules/

# reports
reports/

# logs
*.log

# compiled
/build
/coverage

.npmrc
.env
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"arrowParens": "always",
"singleQuote": true,
"trailingComma": "all",
"printWidth": 100
}
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
### Added
- Basic reporting for ReportPortal API version 5.* (see [ReportPortal releases](https://github.com/reportportal/reportportal/releases))
Loading
Loading