Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into merge-remote-pass…
Browse files Browse the repository at this point in the history
…word-strength-meter-2024-08-04
  • Loading branch information
geoffreykwan committed Aug 4, 2024
2 parents a3c5c7a + a632c58 commit 3037570
Show file tree
Hide file tree
Showing 62 changed files with 7,542 additions and 5,690 deletions.
33 changes: 6 additions & 27 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,23 @@
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"tsconfig.json",
"e2e/tsconfig.json"
],
"createDefaultProgram": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/component-selector": [
"error",
{
"prefix": "app",
"style": "kebab-case",
"type": "element"
}
],
"@angular-eslint/directive-selector": [
"error",
{
"prefix": "app",
"style": "camelCase",
"type": "attribute"
}
]
}
"rules": {}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended"
"plugin:@angular-eslint/template/recommended",
"plugin:@angular-eslint/template/accessibility"
],
"rules": {}
}
]
}
}
43 changes: 43 additions & 0 deletions .github/workflows/ci-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish NPM Package
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
publish:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.13.0]

steps:
- name: Checkout 🛎️
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci

# TODO - find better approch to install the peer dependencies for local developement
- name: Link lib
run: npm link ./projects/password-strength-meter

- name: Build - Lib
run: npm run build:lib:prod

- name: Get package version
id: package-version
uses: martinbeentjes/npm-get-version-action@master

- name: Publish to npm
run: npm publish dist/password-strength-meter/
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
61 changes: 15 additions & 46 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

strategy:
matrix:
node-version: [16.14.2]
node-version: [18.13.0]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand All @@ -30,14 +30,21 @@ jobs:
- name: Install dependencies
run: npm ci

# TODO - find better approch to install the peer dependencies for local developement
- name: Link lib
run: npm link ./projects/password-strength-meter

- name: Lint
run: npm run lint

- name: Build
run: npm run build:lib:prod

- name: Unit Test - Lib
run: npm run test:lib -- -- --watch=false --browsers=ChromeHeadless

- name: Unit Test - App
run: npm run build:lib:prod && npm run test:app -- -- --watch=false --browsers=ChromeHeadless
run: npm run test:app -- -- --watch=false --browsers=ChromeHeadless

- name: Coveralls
uses: coverallsapp/github-action@1.1.3
Expand All @@ -52,7 +59,7 @@ jobs:

strategy:
matrix:
node-version: [16.14.2]
node-version: [18.13.0]

steps:
- name: Checkout 🛎️
Expand All @@ -67,6 +74,10 @@ jobs:
- name: Install dependencies
run: npm ci

# TODO - find better approch to install the peer dependencies for local developement
- name: Link lib
run: npm link ./projects/password-strength-meter

- name: Build - Lib
run: npm run build:lib:prod

Expand All @@ -77,46 +88,4 @@ jobs:
uses: JamesIves/github-pages-deploy-action@v4.3.0
with:
branch: gh-pages # The branch the action should deploy to.
folder: docs # The folder the action should deploy.

publish:
needs: deploy
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.14.2]

steps:
- name: Checkout 🛎️
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci

- name: Build - Lib
run: npm run build:lib:prod

- name: Get package version
id: package-version
uses: martinbeentjes/npm-get-version-action@master

- name: Create release
uses: ncipollo/release-action@v1
with:
tag: v${{ steps.package-version.outputs.current-version}}
commit: ${{ github.sha }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to npm
run: npm publish dist/password-strength-meter/
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
folder: docs/browser # The folder the action should deploy.
Loading

0 comments on commit 3037570

Please sign in to comment.