Skip to content

Commit

Permalink
Merge pull request #232 from OntimizeWeb/release/8.2.0
Browse files Browse the repository at this point in the history
Release 8.2.0
  • Loading branch information
daniel-grana committed May 19, 2023
2 parents c8e9995 + fab8178 commit 80ab3b5
Show file tree
Hide file tree
Showing 401 changed files with 18,840 additions and 2,842 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/build-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build CI

on:
pull_request:
types: [closed]
branches: [8.x.x, hotfix/8.*]
paths: ['src/**']

jobs:
build:
if: github.event_name == 'pull_request' && github.event.pull_request.merged == true
runs-on: ubuntu-20.04

steps:
- name: 'Checkout code'
uses: actions/checkout@v2

- name: 'Cache node modules'
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Node 12.x
uses: actions/setup-node@v1
with:
node-version: 12.13.0

- name: npm install and npm run build
run: |
npm i
npm run build
82 changes: 82 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
name: Build Release

on:
pull_request:
types: [closed]
branches: [master]
workflow_dispatch:
inputs:
BASELINE:
description: 'Release branch'
required: true
default: 'master'

env:
NPM_REGISTRY: https://registry.npmjs.org/
CI_EMAIL: ontimize-web@imatia.com
CI_USERNAME: ontimize-web
DEVELOP_BRANCH: 8.x.x

jobs:
build:
runs-on: ubuntu-20.04
if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release'))

steps:
- name: Get input parameters
run: |
echo "BASELINE_BRANCH=${{ github.event.inputs.BASELINE || github.ref }}" >> $GITHUB_ENV
- name: Checkout merge commit
uses: actions/checkout@v3
with:
ref: ${{ env.BASELINE_BRANCH }}
fetch-depth: 0

- name: Node 12.x
uses: actions/setup-node@v3
with:
node-version: 12.13.0
registry-url: ${{ env.NPM_REGISTRY }}

- name: obtain package.json version
id: project
run: |
echo ::set-output name=version::$(node -pe "require('./package.json')['version']")
- name: abort if SNAPSHOT
if: "contains(steps.project.outputs.version, 'SNAPSHOT')"
run: |
echo "Version ${{ steps.project.outputs.version }} is not a properly named for RELEASE"
exit 1
- name: GitHub Release / Create release
uses: ncipollo/release-action@2792aea87063cfd0d27953ac38e3ab45afacc154
with:
tag: ${{ steps.project.outputs.version }}
name: ${{ steps.project.outputs.version }}
token: ${{ secrets.OWEB_GH_TOKEN_PUSH }}
body: |
Released version ${{ steps.project.outputs.version }} of Playground
- name: Prepare git information
run: |
git config user.name "$CI_USERNAME"
git config user.email "$CI_EMAIL"
- name: Create sync branch
run: |
version=${{ steps.project.outputs.version }}
git checkout -b sync/release-$version-to-develop
npm version $(npm version minor --no-git-tag-version)-SNAPSHOT-0 --no-git-tag-version
git add .
git commit --allow-empty -m "Prepare next development iteration"
git push origin sync/release-$version-to-develop
- name: Create pull request
env:
GITHUB_TOKEN: ${{ secrets.OWEB_GH_TOKEN_PUSH }}
run: |
version=${{ steps.project.outputs.version }}
gh pr create -B ${{ env.DEVELOP_BRANCH }} -H sync/release-$version-to-develop --title "Sync release $version to develop" --body "Automated pull request for synchronizing released version into develop branch"
112 changes: 112 additions & 0 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
---
name: Prepare Release

on:
workflow_dispatch:
inputs:
RELEASE_TYPE:
description: 'Release type'
required: true
default: 'minor'
type: choice
options:
- 'minor'
- 'hotfix'

env:
NPM_REGISTRY: https://registry.npmjs.org/
CI_EMAIL: ontimize-web@imatia.com
CI_USERNAME: ontimize-web
MAIN_BRANCH: master
DEVELOP_BRANCH: 8.x.x

jobs:
build:
runs-on: ubuntu-20.04

steps:
- name: Get input parameters
id: parameters
run: |
if [ "${{ github.event.inputs.RELEASE_TYPE }}" = "hotfix" ]; then
BASELINE_BRANCH=${{ env.MAIN_BRANCH }}
isHotfix=1
else
BASELINE_BRANCH=${{ env.DEVELOP_BRANCH }}
isHotfix=0
fi
echo "BASELINE_BRANCH=$BASELINE_BRANCH" >> $GITHUB_ENV
echo "isHotfix=$isHotfix" >> $GITHUB_OUTPUT
- name: Checkout merge commit
uses: actions/checkout@v3
with:
ref: ${{ env.BASELINE_BRANCH }}
fetch-depth: 0

- name: Node 12.x
uses: actions/setup-node@v3
with:
node-version: 12.13.0
registry-url: ${{ env.NPM_REGISTRY }}

- name: obtain package.json version
id: project
run: |
echo "version=$(node -pe "require('./package.json')['version']")" >> $GITHUB_OUTPUT
- name: Prepare git information
run: |
git config user.name "$CI_USERNAME"
git config user.email "$CI_EMAIL"
## MINOR
- name: bumping minor version in package.json
if: ${{ steps.parameters.outputs.isHotfix == false }}
run: |
version=$(echo "${{ steps.project.outputs.version }}" | sed 's/-SNAPSHOT-[0-9]//')
npm version $version --no-git-tag-version
echo "RELEASE_VERSION=$(node -pe "require('./package.json')['version']")" >> $GITHUB_ENV
## HOTFIX
- name: bumping hotfix version in package.json
if: ${{ steps.parameters.outputs.isHotfix == true }}
run: |
npm version patch --no-git-tag-version
echo "RELEASE_VERSION=$(node -pe "require('./package.json')['version']")" >> $GITHUB_ENV
- name: Create release branch
if: ${{ steps.parameters.outputs.isHotfix == false }}
run: |
version=${{ env.RELEASE_VERSION }}
git checkout -b release/$version
git add .
git commit -m "Prepare release $version"
git push origin release/$version
- name: Create hotfix branch
if: ${{ steps.parameters.outputs.isHotfix == true }}
run: |
version=${{ env.RELEASE_VERSION }}
git checkout -b hotfix/$version
git add .
git commit -m "Prepare hotfix $version"
git push origin hotfix/$version
- name: Create Release pull request
if: ${{ steps.parameters.outputs.isHotfix == false }}
env:
GITHUB_TOKEN: ${{ secrets.OWEB_GH_TOKEN_PUSH }}
run: |
version=${{ env.RELEASE_VERSION }}
gh pr create -B ${{ env.MAIN_BRANCH }} -H release/$version --title "Release $version" --body "" --draft --label "release"
- name: Create Hotfix pull request
if: ${{ steps.parameters.outputs.isHotfix == true }}
env:
GITHUB_TOKEN: ${{ secrets.OWEB_GH_TOKEN_PUSH }}
run: |
version=${{ env.RELEASE_VERSION }}
gh pr create -B ${{ env.MAIN_BRANCH }} -H hotfix/$version --title "Hotfix $version" --body "" --draft --label "release"
45 changes: 45 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Sonar
on:
push:
branches:
- main
- 8.x.x
- hotfix/8.*
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: 'Cache node modules'
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Node 12.x
uses: actions/setup-node@v1
with:
node-version: 12.13.0

- name: npm install and npm run build
run: |
npm i
npm run test-ci
- name: coverage .lcov workaround
run: |
sed -i 's+/home/runner/work/ontimize-web-ngx-playground/ontimize-web-ngx-playground+/github/workspace+g' coverage/ontimize-web-ngx-playground/lcov.info
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ testem.log
# System Files
.DS_Store
Thumbs.db
reports/ut_report.xml
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

5 changes: 2 additions & 3 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@
}
],
"styles": [
"node_modules/highlight.js/styles/solarized-light.css",
"node_modules/ontimize-web-ngx/ontimize.scss",
"src/assets/css/app.scss",
"node_modules/ontimize-web-ngx-charts/styles.scss",
"src/styles.scss"
],
"scripts": []
Expand Down Expand Up @@ -101,7 +100,7 @@
"src/assets"
],
"styles": [
"src/styles.css"
"src/styles.scss"
],
"scripts": []
}
Expand Down
13 changes: 11 additions & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ module.exports = function (config) {
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
require('@angular-devkit/build-angular/plugins/karma'),
require('karma-sonarqube-unit-reporter')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
Expand All @@ -20,7 +21,15 @@ module.exports = function (config) {
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
sonarQubeUnitReporter: {
sonarQubeVersion: 'LATEST',
outputFile: './reports/ut_report.xml',
overrideTestDescription: true,
testPaths: ['./src'],
testFilePattern: '.spec.ts',
useBrowserName: false
},
reporters: ['progress', 'kjhtml', 'sonarqubeUnit'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
Expand Down

0 comments on commit 80ab3b5

Please sign in to comment.