Skip to content

Commit

Permalink
chore(release): pulling release/2.0.0 into master
Browse files Browse the repository at this point in the history
chore(release): pulling release/2.0.0 into master
  • Loading branch information
MoumitaM authored Jan 6, 2023
2 parents a8b8f4f + 37627fc commit c79910a
Show file tree
Hide file tree
Showing 36 changed files with 39,940 additions and 14,101 deletions.
7 changes: 0 additions & 7 deletions .buildscript/circle.sh

This file was deleted.

13 changes: 0 additions & 13 deletions .buildscript/e2e.sh

This file was deleted.

2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
WRITE_KEY=
DATAPLANE_URL=
10 changes: 10 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.husky/
lib/
node_modules/
reports/
stats/
*.json
*.md
*.d.ts
.nyc_output
examples/
26 changes: 0 additions & 26 deletions .eslintrc.js

This file was deleted.

41 changes: 41 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"env": {
"browser": true,
"es2020": true,
"jest": true
},
"extends": ["airbnb-base", "plugin:sonarjs/recommended", "prettier", "plugin:compat/recommended"],
"plugins": ["unicorn", "compat"],
"parser": "@babel/eslint-parser",
"globals": {},
"parserOptions": {
"ecmaVersion": 11,
"sourceType": "module"
},
"rules": {
"import/prefer-default-export": "off",
"unicorn/filename-case": [
"error",
{ "cases": { "camelCase": true, "pascalCase": true, "kebabCase": true } }
],
"unicorn/no-instanceof-array": "error",
"unicorn/no-static-only-class": "error",
"unicorn/consistent-destructuring": "error",
"unicorn/better-regex": "error",
"unicorn/no-for-loop": "error",
"unicorn/prefer-array-some": "error",
"unicorn/explicit-length-check": "error",
"unicorn/prefer-array-find": "error",
"unicorn/no-lonely-if": "error",
"unicorn/prefer-includes": "error",
"unicorn/prefer-array-flat-map": "error",
"unicorn/no-useless-spread": "error",
"unicorn/no-useless-length-check": "error",
"unicorn/prefer-export-from": "error",
"sonarjs/prefer-immediate-return": "off",
"sonarjs/no-nested-template-literals": "off",
"sonarjs/max-switch-cases": "off",
"sonarjs/cognitive-complexity": ["error", 40],
"compat/compat": "warn"
}
}
38 changes: 0 additions & 38 deletions .github/workflows/actions.yml

This file was deleted.

40 changes: 40 additions & 0 deletions .github/workflows/build-and-quality-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build & Code Quality Checks

on:
pull_request:
branches: ['master', 'develop']
types: ['opened', 'reopened', 'synchronize']

jobs:
build:
name: Build & Code Quality Checks
runs-on: ubuntu-latest

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

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies
env:
HUSKY: 0
run: |
npm ci
- name: Execute quality checks
run: |
npm run check:circular
npm run check:duplicates
- name: Execute security checks
run: |
npm run check:security
- name: Generate build
run: |
npm run build
17 changes: 17 additions & 0 deletions .github/workflows/check_pr_title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Check PR title

on:
pull_request:
branches: ['master', 'develop']
types: ['opened', 'reopened', 'edited', 'synchronize']

jobs:
check_pr_title:
name: Check PR title
runs-on: ubuntu-latest
steps:
- name: Checkout source branch
uses: actions/checkout@v3

- name: Check PR title
uses: rudderlabs/github-action-check-pr-title@v1.0.7
82 changes: 82 additions & 0 deletions .github/workflows/deploy-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Deploy to NPM

on:
workflow_dispatch:
pull_request:
branches:
- master
types:
- closed

permissions:
id-token: write # allows the JWT to be requested from GitHub's OIDC provider
contents: read # This is required for actions/checkout

jobs:
deploy-tag:
name: Deploy to NPM
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/master') || github.event.pull_request.merged == true
steps:
- name: Checkout source branch
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Build files
env:
HUSKY: 0
run: |
npm ci
npm run build
- name: Publish package to NPM
env:
HUSKY: 0
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
cd lib
npm publish
- name: Get new version number
run: |
current_version=$(jq -r .version package.json)
echo "CURRENT_VERSION_VALUE=$current_version" >> $GITHUB_ENV
echo "DATE=$(date)" >> $GITHUB_ENV
- name: Send message to Slack channel
id: slack
uses: slackapi/slack-github-action@v1.23.0
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
PROJECT_NAME: 'Node SDK'
NPM_PACKAGE_URL: 'https://www.npmjs.com/package/@rudderstack/rudder-sdk-node'
with:
channel-id: ${{ secrets.SLACK_RELEASE_CHANNEL_ID }}
payload: |
{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "New release: ${{ env.PROJECT_NAME }}"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Release: <${{ env.NPM_PACKAGE_URL }}|${{ env.CURRENT_VERSION_VALUE }}>*\n${{ env.DATE }}"
}
}
]
}
40 changes: 40 additions & 0 deletions .github/workflows/housekeeping.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Handle stale PRs

on:
schedule:
- cron: '42 1 * * *'

jobs:
prs:
name: Clean up stale prs
runs-on: ubuntu-latest

permissions:
issues: write
pull-requests: write

steps:
- uses: actions/stale@v7
with:
repo-token: ${{ github.token }}
operations-per-run: 200
stale-pr-message: 'This PR is considered to be stale. It has been open 30 days with no further activity thus it is going to be closed in 10 days. To avoid such a case please consider removing the stale label manually or add a comment to the PR.'
days-before-pr-stale: 30
days-before-pr-close: 10
stale-pr-label: 'Stale'

branches:
name: Cleanup old branches
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Run delete-old-branches-action
uses: beatlabs/delete-old-branches-action@v0.0.9
with:
repo_token: ${{ github.token }}
date: '2 months ago'
dry_run: false
delete_tags: false
extra_protected_branch_regex: ^(main|master|develop)$
exclude_open_pr_branches: true
55 changes: 55 additions & 0 deletions .github/workflows/notion-pr-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Notion PR Sync

on:
issues:
types:
[
opened,
edited,
deleted,
transferred,
pinned,
unpinned,
closed,
reopened,
assigned,
unassigned,
labeled,
unlabeled,
locked,
unlocked,
milestoned,
demilestoned,
]
pull_request:
types:
[
assigned,
unassigned,
labeled,
unlabeled,
opened,
edited,
closed,
reopened,
synchronize,
converted_to_draft,
ready_for_review,
locked,
unlocked,
review_requested,
review_request_removed,
auto_merge_enabled,
auto_merge_disabled,
]

jobs:
request:
runs-on: ubuntu-latest
steps:
- name: Sync GitHub PRs to Notion
uses: sivashanmukh/github-notion-pr-sync@1.0.0
with:
notionKey: ${{ secrets.NOTION_BOT_KEY }}
notionDatabaseId: ${{ secrets.NOTION_PR_DB_ID }}
githubKey: ${{ secrets.PAT }}
Loading

0 comments on commit c79910a

Please sign in to comment.