Skip to content

Commit

Permalink
chore: update feature branch release pipeline (#32)
Browse files Browse the repository at this point in the history
* fix: clear un-used imports

* fix: update github actions yml

* fix: update github actions yml
  • Loading branch information
dylannnn committed Jul 23, 2023
1 parent a0e3c13 commit caa73ca
Show file tree
Hide file tree
Showing 34 changed files with 2,814 additions and 3,464 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: BETA - Publish Library

on:
push:
branches: [ beta ]

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.JS
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- name: Cache NPM packages
id: cache-npm-packages
uses: actions/cache@v3
env:
cache-name: cache-npm-packages
with:
path: ./node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
- if: ${{ steps.cache-npm-packages.outputs.cache-hit != 'true' }}
run: npm ci --ignore-scripts
- name: Lint
run: npm run mkh:lint
- name: Test
run: npm run mkh:test
- name: Build
run: npm run mkh:build
- name: Semantic Release
run: npx semantic-release --ci
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
41 changes: 41 additions & 0 deletions .github/workflows/feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: FEATURE - Lint, Test, Build

on:
push:
branches: [ 'feature/**' ]

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.JS
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- name: Cache NPM packages
id: cache-npm-packages
uses: actions/cache@v3
env:
cache-name: cache-npm-packages
with:
path: ./node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
- if: ${{ steps.cache-npm-packages.outputs.cache-hit != 'true' }}
run: npm ci --ignore-scripts
- name: Lint
run: npm run mkh:lint
- name: Test
run: npm run mkh:test
- name: Versioning
run: npx standard-version --prerelease ${{ github.ref_name }} --dry-run
- name: Build
run: npm run mkh:build
- name: Publish
run: echo "Publishing..."

3 changes: 2 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Test and Build

on:
pull_request:
branches: [ develop, beta ]
branches: [ develop, beta, next ]

jobs:
test:
Expand All @@ -14,6 +14,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- name: Clean Install
run: npm ci
- name: Lint
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- name: Clean Install
run: npm ci
Expand Down Expand Up @@ -45,6 +46,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
registry-url: https://registry.npmjs.org
- name: Config Git User
run: |
Expand Down
11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ Thumbs.db
.angular

# Verdaccio
verdaccio/conf/auth/**/*
!verdaccio/conf/auth/.keepme
verdaccio/conf/storage/**/*
!verdaccio/conf/storage/.keepme
docker/verdaccio/conf/auth/**/*
!docker/verdaccio/conf/auth/.keepme
docker/verdaccio/conf/storage/**/*
!docker/verdaccio/conf/storage/.keepme

# Storybook
build-storybook.log
5 changes: 5 additions & 0 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
default: true

MD013: false
MD024:
allow_different_nesting: true
6 changes: 4 additions & 2 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { StorybookConfig } from '@storybook/core-webpack';

export const rootMain: StorybookConfig = {
stories: [],
addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-interactions', '@storybook/addon-a11y']
};

export const framework = {
name: '@storybook/angular',
options: {}
};

export const docs = {
autodocs: true
};
export const addons = ['@storybook/addon-mdx-gfm'];
};
2 changes: 1 addition & 1 deletion .versionrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"header": "Release Notes Of NGX Multi Keywords Highlighter",
"header": "# Release Notes Of NGX Multi Keywords Highlighter",
"commitUrlFormat": "https://github.com/dylannnn/ngx-multi-keywords-highlighter/commit/{{hash}}",
"compareUrlFormat": "https://github.com/dylannnn/ngx-multi-keywords-highlighter/compare/{{previousTag}}...{{currentTag}}",
"releaseCommitMessageFormat": "chore(release): {{currentTag}}",
Expand Down
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,12 @@
"scss.lint.unknownAtRules": "ignore",
"files.associations": {
"*.scss": "scss"
},
"[markdown]": {
"editor.formatOnSave": true,
"editor.formatOnPaste": true
},
"editor.codeActionsOnSave": {
"source.fixAll.markdownlint": true
}
}
32 changes: 1 addition & 31 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,31 +1 @@
# 1.0.0 (2023-07-16)


### Features

* migration to ng16, storybook v7 ([#17](https://github.com/dylannnn/ngx-multi-keywords-highlighter/issues/17)) ([2b95a2a](https://github.com/dylannnn/ngx-multi-keywords-highlighter/commit/2b95a2a10464c82ed82c119ca518dc652d99cc4e))
* migration to ng16, storybook v7 ([#18](https://github.com/dylannnn/ngx-multi-keywords-highlighter/issues/18)) ([01e17d2](https://github.com/dylannnn/ngx-multi-keywords-highlighter/commit/01e17d25a8b0c66135f292dc3bc319fa525a16ab))

# 1.0.0 (2023-07-16)


### Features

* migration to ng16, storybook v7 ([#17](https://github.com/dylannnn/ngx-multi-keywords-highlighter/issues/17)) ([2b95a2a](https://github.com/dylannnn/ngx-multi-keywords-highlighter/commit/2b95a2a10464c82ed82c119ca518dc652d99cc4e))
* migration to ng16, storybook v7 ([#18](https://github.com/dylannnn/ngx-multi-keywords-highlighter/issues/18)) ([01e17d2](https://github.com/dylannnn/ngx-multi-keywords-highlighter/commit/01e17d25a8b0c66135f292dc3bc319fa525a16ab))

# 1.0.0 (2023-07-16)


### Features

* migration to ng16, storybook v7 ([#17](https://github.com/dylannnn/ngx-multi-keywords-highlighter/issues/17)) ([2b95a2a](https://github.com/dylannnn/ngx-multi-keywords-highlighter/commit/2b95a2a10464c82ed82c119ca518dc652d99cc4e))
* migration to ng16, storybook v7 ([#18](https://github.com/dylannnn/ngx-multi-keywords-highlighter/issues/18)) ([01e17d2](https://github.com/dylannnn/ngx-multi-keywords-highlighter/commit/01e17d25a8b0c66135f292dc3bc319fa525a16ab))

# 1.0.0 (2023-03-07)

### Bug Fixes

* github actions release config ([7284a62](https://github.com/dylannnn/ngx-multi-keywords-highlighter/commit/7284a629231ab67e786822e5e5089021cc7c8a9b))
* update package-lock.json file ([dc5f9f4](https://github.com/dylannnn/ngx-multi-keywords-highlighter/commit/dc5f9f4f5f31b0c24bf0b3cd6a8f01f383c41e38))
* update release config ([2e91cf3](https://github.com/dylannnn/ngx-multi-keywords-highlighter/commit/2e91cf3ed37d357c724a0dc46951424c592782e1))
# Release Notes Of NGX Multi Keywords Highlighter
74 changes: 71 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

[![ngx-multi-keywords-highlighter-e2e](https://img.shields.io/endpoint?url=https://cloud.cypress.io/badge/simple/2dbycs&style=flat&logo=cypress)](https://cloud.cypress.io/projects/2dbycs/runs)

<!-- TODO Fix this badge -->
[![Publish NGX Multi Keywords Highlighter](https://github.com/dylannnn/ngx-multi-keywords-highlighter/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/dylannnn/ngx-multi-keywords-highlighter/actions/workflows/npm-publish.yml)

## How to use

Add `"node_modules/@amfrontender/ngx-multi-keywords-highlighter/themes/index.scss"` or `"node_modules/@amfrontender/ngx-multi-keywords-highlighter/themes/themes.scss"` to your angular.json to the build options of styles.
Add `"node_modules/@amfrontender/ngx-multi-keywords-highlighter/themes/index.scss"` or `"node_modules/@amfrontender/ngx-multi-keywords-highlighter/themes/themes.scss"` to your `angular.json` or `project.json` if you use NX to the build options of styles.

Import the `NgxMultiKeywordsHighlighterModule` to your app.module.ts
Import the `NgxMultiKeywordsHighlighterModule` to your `app.module.ts`

```typescript
import { LABEL_POSITION, MATERIAL_COLOR, NgxMultiKeywordsHighlighterModule } from '@amfrontender/ngx-multi-keywords-highlighter';
Expand Down Expand Up @@ -62,4 +63,71 @@ For more advanced usages, please check the storybook or the demo app
| revert | A revert commit |
| style | UI/UX CHANGES |
| test | Adding missing tests |
<!-- prettier-ignore-end -->
<!-- prettier-ignore-end -->

## Branches

### Feature Branches

#### Release locally with Vadaccio to test

```sh
docker compose up --build -d
```

#### CI Tasks

- Lint all
- Unit Test all
- E2E Test all
- Chromatic Test (TBD)
- Build

### Beta Branch

Beta branch is for pre-release

#### CI Tasks

- Lint all
- Unit Test all
- E2E Test all
- Chromatic Test (TBD)
- Build

### Next Branch

Any new feature, major version update branch

#### CI Tasks

- Lint all
- Unit Test all
- E2E Test all
- Chromatic Test (TBD)
- Build
-

### Develop Branch

Before release, for testing

#### CI Tasks

- Lint all
- Unit Test all
- E2E Test all
- Chromatic Test (TBD)
- Build

### Main Branch

Production ready branch

#### CI Tasks

- Lint all
- Unit Test all
- E2E Test all
- Chromatic Test (TBD)
- Build
1 change: 1 addition & 0 deletions apps/demo-e2e/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default defineConfig({
e2e: {
...nxE2EPreset(__dirname),
baseUrl: 'http://localhost:4200',
projectId: '2dbycs',
},
experimentalStudio: true,
});
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import createBundler from '@bahmutov/cypress-esbuild-preprocessor';
export default defineConfig({
e2e: {
...nxE2EStorybookPreset(__dirname),
projectId: '2dbycs',
specPattern: 'src/cucumber/**/*.feature',
async setupNodeEvents(
on: Cypress.PluginEvents,
Expand Down
5 changes: 3 additions & 2 deletions apps/ngx-multi-keywords-highlighter-e2e/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineConfig } from 'cypress';
import { nxE2EStorybookPreset } from '@nx/storybook/presets/cypress';
import { defineConfig } from "cypress";
import { nxE2EStorybookPreset } from "@nx/storybook/presets/cypress";

export default defineConfig({
e2e: nxE2EStorybookPreset(__dirname),
projectId: "2dbycs",
});
41 changes: 12 additions & 29 deletions apps/ngx-multi-keywords-highlighter-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,20 @@
"sourceRoot": "apps/ngx-multi-keywords-highlighter-e2e/src",
"projectType": "application",
"targets": {
"e2e:watch": {
"e2e": {
"executor": "@nx/cypress:cypress",
"options": {
"cypressConfig": "apps/ngx-multi-keywords-highlighter-e2e/cypress.config.ts",
"devServerTarget": "ngx-multi-keywords-highlighter:storybook",
"testingType": "e2e",
"headed": true,
"watch": true
},
"configurations": {
"ci": {
"devServerTarget": "ngx-multi-keywords-highlighter:storybook:ci"
}
}
},
"e2e:ci": {
"executor": "@nx/cypress:cypress",
"options": {
"cypressConfig": "apps/ngx-multi-keywords-highlighter-e2e/cypress.config.ts",
"devServerTarget": "ngx-multi-keywords-highlighter:storybook",
"testingType": "e2e"
},
"configurations": {
"ci": {
"headed": false,
"watch": false,
"record": true,
"devServerTarget": "ngx-multi-keywords-highlighter:storybook:ci"
}
}
Expand All @@ -39,22 +30,14 @@
"testingType": "e2e"
},
"configurations": {
"watch": {
"headed": true,
"watch": true
},
"ci": {
"devServerTarget": "ngx-multi-keywords-highlighter:storybook:ci"
}
}
},
"e2e:cucumber:watch": {
"executor": "@nx/cypress:cypress",
"options": {
"cypressConfig": "apps/ngx-multi-keywords-highlighter-e2e/cypress.config.cucumber.ts",
"devServerTarget": "ngx-multi-keywords-highlighter:storybook",
"testingType": "e2e",
"headed": true,
"watch": true
},
"configurations": {
"ci": {
"headed": false,
"watch": false,
"record": true,
"devServerTarget": "ngx-multi-keywords-highlighter:storybook:ci"
}
}
Expand Down
Loading

0 comments on commit caa73ca

Please sign in to comment.