forked from segmentio/analytics-node
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(release): pulling release/2.0.0 into master
chore(release): pulling release/2.0.0 into master
- Loading branch information
Showing
36 changed files
with
39,940 additions
and
14,101 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
WRITE_KEY= | ||
DATAPLANE_URL= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
Oops, something went wrong.