-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: JOIN-19248 configure semantic release (#52)
* feat!: Configure semantic release
- Loading branch information
1 parent
425754b
commit b0e0acd
Showing
32 changed files
with
4,435 additions
and
5,889 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,64 +1,100 @@ | ||
version: 2.1 | ||
|
||
docker-auth: &docker-auth | ||
auth: | ||
username: ${DOCKER_LOGIN} | ||
password: ${DOCKER_PASSWORD} | ||
|
||
defaults: &defaults | ||
working_directory: /home/circleci/pubsub | ||
working_directory: ~/pubsub | ||
docker: | ||
- image: node:14.17.2 | ||
version: 2 | ||
- image: cimg/node:16.14.1 | ||
<<: *docker-auth | ||
|
||
references: | ||
auth_with_registry: &auth_with_registry | ||
run: | ||
name: Authenticate with registry | ||
command: echo "//registry.npmjs.org/:_authToken=$npm_TOKEN" > .npmrc | ||
|
||
remove_auth_with_registry: &remove_auth_with_registry | ||
run: | ||
name: Remove authentication with registry | ||
command: rm .npmrc | ||
|
||
yarn_install: &yarn_install | ||
run: | ||
name: yarn install | ||
command: yarn --frozen-lockfile --cache-folder ~/.cache/yarn | ||
|
||
yarn_cache_key: &yarn_cache_key yarn-lock-{{ checksum "yarn.lock" }} | ||
|
||
save_yarn_cache: &save_yarn_cache | ||
save_cache: | ||
name: 'Saving Yarn Cache' | ||
key: *yarn_cache_key | ||
paths: | ||
- ~/.cache/yarn | ||
|
||
restore_yarn_cache: &restore_yarn_cache | ||
restore_cache: | ||
name: Restoring Yarn Cache | ||
key: *yarn_cache_key | ||
|
||
jobs: | ||
build: | ||
lint: | ||
<<: *defaults | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
key: v1-yarn-lock-cache-{{ checksum "yarn.lock" }} | ||
- *restore_yarn_cache | ||
- *auth_with_registry | ||
- *yarn_install | ||
- run: | ||
name: yarn install | ||
command: yarn install | ||
- save_cache: | ||
key: v1-yarn-lock-cache-{{ checksum "yarn.lock" }} | ||
paths: | ||
- node_modules | ||
name: lint | ||
command: yarn lint | ||
- *save_yarn_cache | ||
- *remove_auth_with_registry | ||
|
||
test: | ||
<<: *defaults | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
key: v1-yarn-lock-cache-{{ checksum "yarn.lock" }} | ||
- run: | ||
name: yarn install | ||
command: yarn install | ||
- *restore_yarn_cache | ||
- *auth_with_registry | ||
- *yarn_install | ||
- run: | ||
name: test | ||
command: yarn lerna run test | ||
- store_test_results: | ||
path: log | ||
- store_artifacts: | ||
path: log | ||
destination: log | ||
lint: | ||
command: yarn test | ||
- *save_yarn_cache | ||
- *remove_auth_with_registry | ||
|
||
release: | ||
<<: *defaults | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
key: v1-yarn-lock-cache-{{ checksum "yarn.lock" }} | ||
- run: | ||
name: yarn install | ||
command: yarn install | ||
- *restore_yarn_cache | ||
- *auth_with_registry | ||
- *yarn_install | ||
- run: | ||
name: lint | ||
command: yarn lerna run lint | ||
- store_test_results: | ||
path: log | ||
- store_artifacts: | ||
path: log | ||
destination: log | ||
name: release | ||
command: yarn release | ||
- *remove_auth_with_registry | ||
|
||
workflows: | ||
version: 2 | ||
build_test_deploy: | ||
jobs: | ||
- build | ||
- test: | ||
requires: | ||
- build | ||
- lint: | ||
context: Global | ||
- test: | ||
context: Global | ||
- release: | ||
context: Global | ||
filters: | ||
branches: | ||
only: | ||
- master | ||
- alpha | ||
requires: | ||
- build | ||
- lint | ||
- test |
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,3 @@ | ||
module.exports = { | ||
extends: ['@join-private/backend/typescript', '@join-private/backend/jest'], | ||
} |
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,12 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: 'npm' | ||
directory: '/' | ||
schedule: | ||
interval: 'monthly' | ||
allow: | ||
- dependency-type: 'production' | ||
rebase-strategy: 'disabled' | ||
commit-message: | ||
prefix: "build" | ||
include: "scope" |
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,24 @@ | ||
name: 'Lint PR title' | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
jobs: | ||
lint: | ||
name: lint-pr-title | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: semantic-pull-request | ||
uses: amannn/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_PAT }} | ||
with: | ||
subjectPattern: ^((JOIN-\d+([, ]JOIN-\d+)*)|TECH|bump) (?![A-Z]).+$ | ||
subjectPatternError: | | ||
The subject "{subject}" found in the pull request title "{title}" | ||
didn't match the configured pattern. Please ensure that the subject | ||
doesn't start with an uppercase character and includes jira ticket. |
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,3 @@ | ||
#!/bin/sh | ||
|
||
yarn lint |
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 |
---|---|---|
@@ -1 +1 @@ | ||
14.17.2 | ||
16.14.1 |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
*.md | ||
*.yaml |
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
{ | ||
"semi": false, | ||
"printWidth": 120, | ||
"singleQuote": true, | ||
"parser": "typescript", | ||
"trailingComma": "none", | ||
"trailingComma": "all", | ||
"arrowParens": "avoid" | ||
} |
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,46 @@ | ||
{ | ||
"branches": [ | ||
{ "name": "main" }, | ||
{ "name": "master" }, | ||
{ "name": "alpha", "prerelease": true } | ||
], | ||
"plugins": [ | ||
[ | ||
"@semantic-release/commit-analyzer", | ||
{ | ||
"preset": "conventionalcommits", | ||
"releaseRules": [ | ||
{ "type": "build", "scope": "deps", "release": "patch" } | ||
] | ||
} | ||
], | ||
[ | ||
"@semantic-release/release-notes-generator", | ||
{ | ||
"preset": "conventionalcommits", | ||
"presetConfig": { | ||
"types": [ | ||
{ "type": "feat", "section": "Features" }, | ||
{ "type": "fix", "section": "Bug Fixes" }, | ||
{ "type": "build", "section": "Dependencies" }, | ||
{ "type": "chore", "hidden": true }, | ||
{ "type": "docs", "hidden": true }, | ||
{ "type": "style", "hidden": true }, | ||
{ "type": "refactor", "hidden": true }, | ||
{ "type": "perf", "hidden": true }, | ||
{ "type": "test", "hidden": true } | ||
] | ||
} | ||
} | ||
], | ||
"@semantic-release/npm", | ||
[ | ||
"@semantic-release/github", | ||
{ | ||
"labels": false, | ||
"releasedLabels": false, | ||
"successComment": false | ||
} | ||
] | ||
] | ||
} |
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 @@ | ||
registry "https://registry.npmjs.org/" |
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 |
---|---|---|
@@ -1,41 +1,25 @@ | ||
{ | ||
"name": "@join-com/pubsub", | ||
"version": "0.0.20", | ||
"description": "Google Cloud PubSub wrapper", | ||
"main": "lib/index.js", | ||
"types": "./lib/index.d.ts", | ||
"repository": "github:join-com/pubsub", | ||
"author": "JOIN AG", | ||
"license": "UNLICENSED", | ||
"private": true, | ||
"workspaces": [ | ||
"packages/*" | ||
"packages/pubsub" | ||
], | ||
"scripts": { | ||
"makepretty": "prettier --write '**/*.ts'" | ||
"build": "yarn workspaces run build", | ||
"lint": "yarn workspaces run lint", | ||
"test": "yarn workspaces run test", | ||
"release": "yarn workspaces run semantic-release -e semantic-release-monorepo -d", | ||
"postinstall": "if [ -d .git ]; then git config core.hooksPath .hooks; fi" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "lerna run build && lint-staged" | ||
} | ||
"engines": { | ||
"node": ">=14.0.0" | ||
}, | ||
"lint-staged": { | ||
"*.{ts}": [ | ||
"yarn prettier --write" | ||
], | ||
"src/**/*.ts": [ | ||
"npm run lint --fix" | ||
] | ||
}, | ||
"keywords": [ | ||
"pubsub", | ||
"gcloud" | ||
], | ||
"devDependencies": { | ||
"husky": "^4.3.6", | ||
"lerna": "^3.22.1", | ||
"lint-staged": "^10.5.3", | ||
"prettier": "^2.2.1" | ||
"conventional-changelog-conventionalcommits": "^5.0.0", | ||
"semantic-release": "^19.0.3", | ||
"semantic-release-monorepo": "^7.0.5" | ||
}, | ||
"dependencies": {} | ||
"resolutions": { | ||
"@semantic-release/npm": "8.0.3" | ||
} | ||
} |
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,3 @@ | ||
dist/ | ||
generated/ | ||
node_modules/ |
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,3 @@ | ||
const baseConfig = require('../../.eslintrc.js') | ||
|
||
module.exports = baseConfig |
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 @@ | ||
coverage/ | ||
node_modules/ | ||
src/ | ||
.eslintignore | ||
.eslintrc.js | ||
.npmignore | ||
jest.config.js | ||
tsconfig.prod.tsbuildinfo | ||
tsconfig.prod.json | ||
tsconfig.json |
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 |
---|---|---|
@@ -1,14 +1,12 @@ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
testPathIgnorePatterns: ['/node_modules/', '/support/'], | ||
watchPlugins: [ | ||
'jest-watch-typeahead/filename', | ||
'jest-watch-typeahead/testname' | ||
], | ||
setupFilesAfterEnv: ['jest-extended/all'], | ||
testPathIgnorePatterns: ['/node_modules/', 'generated', 'support'], | ||
watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'], | ||
globals: { | ||
'ts-jest': { | ||
diagnostics: false | ||
} | ||
} | ||
diagnostics: false, | ||
}, | ||
}, | ||
} |
Oops, something went wrong.