Skip to content

Commit 34afd75

Browse files
authored
chore: add workflow and README (#1)
## Summary Adding release workflows and README.md for public ADaaS library. ## Work-item https://app.devrev.ai/devrev/works/ISS-100394
1 parent 4afea48 commit 34afd75

35 files changed

+7371
-126
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
dist

.eslintrc.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
root: true,
3+
extends: 'airbnb-typescript/base',
4+
extends: [
5+
'plugin:@typescript-eslint/recommended',
6+
'plugin:prettier/recommended', // Makes ESLint and Prettier play nicely together
7+
],
8+
ignorePatterns: ['**/dist/*'],
9+
parser: '@typescript-eslint/parser',
10+
parserOptions: {
11+
project: './tsconfig.eslint.json',
12+
},
13+
plugins: ['@typescript-eslint', 'prettier'],
14+
};

.github/scripts/version-patch.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Get the current version from the package.json
2+
currentVersion=$(node -p "require('../../package.json').version")
3+
4+
if npm view @devrev/ts-adaas versions | grep -q "'$currentVersion'"; then
5+
echo "Version $currentVersion already exists"
6+
else
7+
echo "Version $currentVersion does not exist."
8+
npm version patch
9+
fi

.github/workflows/ci.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Validate Pull Request
2+
run-name: Validate Pull Request
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
name: Build
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
18+
- name: Install dependencies
19+
run: npm install
20+
21+
- name: Build
22+
run: npm run build
23+
test:
24+
name: Run Tests
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v3
30+
31+
- name: Install dependencies
32+
run: npm install
33+
34+
- name: Run tests and get coverage
35+
run: npm run test
36+
37+
- name: Upload coverage to Coveralls
38+
uses: coverallsapp/github-action@v2
39+
with:
40+
github-token: ${{ secrets.GITHUB_TOKEN }}
41+
path-to-lcov: ./coverage/lcov.info
42+
43+
44+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Publish ADaaS Library
2+
run-name: "Release ${{ inputs.release-type }} by ${{ github.actor }}"
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
publish-npm:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
packages: write
13+
contents: write
14+
steps:
15+
- uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 2 # Fetch the current and the previous commit
18+
- name: Setup Node
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: 18.17
22+
registry-url: https://registry.npmjs.org/
23+
scope: '@devrev'
24+
token: ${{ secrets.NPMJS_NPM_TOKEN }}
25+
26+
- run: npm ci
27+
- run: npm run build
28+
- run: |
29+
CURRENT_VERSION=$(jq -r .version package.json)
30+
PREVIOUS_VERSION=$(git show HEAD^:package.json | jq -r .version)
31+
if [ "$CURRENT_VERSION" != "$PREVIOUS_VERSION" ]; then
32+
echo "Version changed from $PREVIOUS_VERSION to $CURRENT_VERSION"
33+
echo "version_bumped=true" >> "$GITHUB_ENV"
34+
else
35+
echo "Version $CURRENT_VERSION has not been changed"
36+
echo "version_bumped=false" >> "$GITHUB_ENV"
37+
fi
38+
- name: Publish to registry
39+
if: ${{ env.version_bumped == 'true' }}
40+
run: npm publish --verbose --access public
41+
env:
42+
NODE_AUTH_TOKEN: ${{secrets.NPMJS_NPM_TOKEN}}

.github/workflows/pull_request.yaml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/release.yaml

Lines changed: 0 additions & 102 deletions
This file was deleted.

.gitignore

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
.pnpm-debug.log*
9+
10+
# Diagnostic reports (https://nodejs.org/api/report.html)
11+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
12+
13+
# Runtime data
14+
pids
15+
*.pid
16+
*.seed
17+
*.pid.lock
18+
19+
# Directory for instrumented libs generated by jscoverage/JSCover
20+
lib-cov
21+
22+
# Coverage directory used by tools like istanbul
23+
coverage
24+
*.lcov
25+
26+
# nyc test coverage
27+
.nyc_output
28+
29+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30+
.grunt
31+
32+
# Bower dependency directory (https://bower.io/)
33+
bower_components
34+
35+
# node-waf configuration
36+
.lock-wscript
37+
38+
# Compiled binary addons (https://nodejs.org/api/addons.html)
39+
build/Release
40+
41+
# Dependency directories
42+
node_modules/
43+
jspm_packages/
44+
45+
# Snowpack dependency directory (https://snowpack.dev/)
46+
web_modules/
47+
48+
# TypeScript cache
49+
*.tsbuildinfo
50+
51+
# Optional npm cache directory
52+
.npm
53+
54+
# Optional eslint cache
55+
.eslintcache
56+
57+
# Optional stylelint cache
58+
.stylelintcache
59+
60+
# Microbundle cache
61+
.rpt2_cache/
62+
.rts2_cache_cjs/
63+
.rts2_cache_es/
64+
.rts2_cache_umd/
65+
66+
# Optional REPL history
67+
.node_repl_history
68+
69+
# Output of 'npm pack'
70+
*.tgz
71+
72+
# Yarn Integrity file
73+
.yarn-integrity
74+
75+
# dotenv environment variable files
76+
.env
77+
.env.development.local
78+
.env.test.local
79+
.env.production.local
80+
.env.local
81+
82+
# parcel-bundler cache (https://parceljs.org/)
83+
.cache
84+
.parcel-cache
85+
86+
# Next.js build output
87+
.next
88+
out
89+
90+
# Nuxt.js build / generate output
91+
.nuxt
92+
dist
93+
94+
# Gatsby files
95+
.cache/
96+
# Comment in the public line in if your project uses Gatsby and not Next.js
97+
# https://nextjs.org/blog/next-9-1#public-directory-support
98+
# public
99+
100+
# vuepress build output
101+
.vuepress/dist
102+
103+
# vuepress v2.x temp and cache directory
104+
.temp
105+
.cache
106+
107+
# Docusaurus cache and generated files
108+
.docusaurus
109+
110+
# Serverless directories
111+
.serverless/
112+
113+
# FuseBox cache
114+
.fusebox/
115+
116+
# DynamoDB Local files
117+
.dynamodb/
118+
119+
# TernJS port file
120+
.tern-port
121+
122+
# Stores VSCode versions used for testing VSCode extensions
123+
.vscode-test
124+
125+
# yarn v2
126+
.yarn/cache
127+
.yarn/unplugged
128+
.yarn/build-state.yml
129+
.yarn/install-state.gz
130+
.pnp.*
131+
132+
.npmrc

.prettierrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"printWidth": 80,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": true,
7+
"trailingComma": "es5",
8+
"bracketSpacing": true,
9+
"jsxSingleQuote": false,
10+
"arrowParens": "always",
11+
"proseWrap": "never",
12+
"htmlWhitespaceSensitivity": "strict",
13+
"endOfLine": "lf",
14+
"organizeImportsSkipDestructiveCodeActions": true
15+
}

0 commit comments

Comments
 (0)