Skip to content

Commit

Permalink
Merge pull request #4 from sourabpramanik/feat/ci
Browse files Browse the repository at this point in the history
Fix/ci
  • Loading branch information
sourabpramanik authored Jul 24, 2024
2 parents 10f0dd8 + 3cf9851 commit 784bf71
Show file tree
Hide file tree
Showing 6 changed files with 2,177 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v3
with:
version: 9
- uses: actions/setup-node@v2
with:
node-version: '20.x'
Expand Down
76 changes: 76 additions & 0 deletions .release-it.beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
git:
requireCleanWorkingDir: true
requireUpstream: true
requireCommits: true
addUntrackedFiles: false
commit: true
commitMessage: "chore: beta release v${version}-beta.${increment}"
tag: true
tagName: "v${version}-beta.${increment}"
push: true

npm:
publish: true
publishPath: "."
publishConfig:
registry: "https://registry.npmjs.org/"

skipChecks: true

github:
release: true

releaseName: "Beta Release ${version}-beta.${increment}"
releaseNotes: "auto-generate"

hooks:
before:init:
- git fetch --all
- |
if [ "$(git symbolic-ref --short HEAD)" != "beta" ]; then
echo "Not on beta branch"
exit 1
fi
- git pull origin beta

- pnpm install
- pnpm build


plugins:
'@release-it/conventional-changelog':
infile: './CHANGELOG.md'
preset:
name: 'conventionalcommits'

types:

- { type: 'feat', section: 'Features' }
- { type: 'feature', section: 'Features' }
- { type: 'fix', section: 'Bug Fixes' }
- { type: 'docs', section: 'Documentation' }
- { type: 'chore', section: 'Chores' }
- { type: 'ref', section: 'Refactor' }
writerOpts:
commitGroupsSort: |
(a, b) => {
const groupOrder = ['Features', 'Bug Fixes', 'Chores', 'Documentation', 'Refactor'];
return groupOrder.indexOf(a.title) - groupOrder.indexOf(b.title);
}
commitsSort: |
(a, b) => {
if (a.scope || b.scope) {
if (!a.scope) return -1;
if (!b.scope) return 1;
return a.scope === b.scope
? a.subject.localeCompare(b.subject)
: a.scope.localeCompare(b.scope);
}
return a.subject.localeCompare(b.subject);
}
increment:
release: 'beta'


65 changes: 65 additions & 0 deletions .release-it.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
git:
requireCleanWorkingDir: true
requireUpstream: true
requireCommits: true
addUntrackedFiles: false
commit: true
commitMessage: "chore: release v${version}"
tag: true
tagName: "v${version}"
push: true

npm:
publish: true
publishPath: "."
publishConfig:
registry: "https://registry.npmjs.org/"
skipChecks: true

github:
release: true
releaseName: "Release ${version}"
releaseNotes: "auto-generate"

hooks:
before:init:
- git fetch --all
- |
if [ "$(git symbolic-ref --short HEAD)" != "main" ]; then
echo "Not on main branch"
exit 1
fi
- git pull origin main
- pnpm install
- pnpm build

plugins:
'@release-it/conventional-changelog':
infile: './CHANGELOG.md'
preset:
name: 'conventionalcommits'
types:
- { type: 'feat', section: 'Features' }
- { type: 'feature', section: 'Features' }
- { type: 'fix', section: 'Bug Fixes' }
- { type: 'docs', section: 'Documentation' }
- { type: 'chore', section: 'Chores' }
- { type: 'ref', section: 'Refactor' }
writerOpts:
commitGroupsSort: |
(a, b) => {
const groupOrder = ['Features', 'Bug Fixes', 'Chores', 'Documentation', 'Refactor'];
return groupOrder.indexOf(a.title) - groupOrder.indexOf(b.title);
}
commitsSort: |
(a, b) => {
if (a.scope || b.scope) {
if (!a.scope) return -1;
if (!b.scope) return 1;
return a.scope === b.scope
? a.subject.localeCompare(b.subject)
: a.scope.localeCompare(b.scope);
}
return a.subject.localeCompare(b.subject);
}
Empty file added CHANGELOG.md
Empty file.
16 changes: 13 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@payloadcms/payload-plugin-oauth",
"version": "0.1.0",
"version": "0.0.0",
"type": "module",
"author": "Sourab Pramanik<[email protected]>",
"license": "MIT",
"homepage:": "https://github.com/sourabpramanik/plugin-payload-oauth",
Expand Down Expand Up @@ -40,6 +41,8 @@
"dev": "cd dev && cross-env NODE_OPTIONS=--no-deprecation next dev",
"build": "rm -rf dist && rm -rf tsconfig.tsbuildinfo && pnpm build:types && pnpm build:esbuild",
"build:esbuild": "node esbuild.mjs",
"build": "rm -rf dist && rm -rf tsconfig.tsbuildinfo && pnpm build:types && pnpm build:esbuild",
"build:esbuild": "node esbuild.js",
"build:types": "tsc --emitDeclarationOnly --outDir dist",
"test": "cd test && jest --config=./jest.config.js",
"lint": "eslint src",
Expand All @@ -48,7 +51,12 @@
"generate:types": "payload generate:types",
"lint:fix": "eslint --fix --ext .ts,.tsx src",
"clean": "rm -rf dist && rm -rf dev/pnpm-lock.yaml",
"prepublish": "yarn lint:fix && yarn clean && yarn build"
"release:dry": "release-it --dry-run",
"release:beta": "release-it pre --preReleaseId=beta --npm.tag=beta --config .release-it.beta.yml",
"release:beta:dry": "release-it pre --dry-run --preReleaseId=beta --npm.tag=beta --config .release-it.beta.yml",
"release:major": "release-it major",
"release:minor": "release-it minor",
"release:patch": "release-it patch"
},
"peerDependencies": {
"payload": "^3.0.0-beta.60"
Expand All @@ -59,6 +67,7 @@
"@payloadcms/next": "^3.0.0-beta.67",
"@payloadcms/richtext-lexical": "^3.0.0-beta.67",
"@payloadcms/ui": "^3.0.0-beta.67",
"@release-it/conventional-changelog": "^8.0.1",
"@swc/jest": "^0.2.36",
"@types/jest": "^29.5.11",
"@types/jsonwebtoken": "^9.0.6",
Expand All @@ -79,6 +88,7 @@
"payload": "^3.0.0-beta.67",
"prettier": "^2.7.1",
"react": "^19.0.0-rc-85acf2d195-20240711",
"release-it": "^17.6.0",
"sharp": "^0.33.4",
"typescript": "^5.4.2"
},
Expand All @@ -87,4 +97,4 @@
"oauth4webapi": "^2.11.1",
"react-dom": "^19.0.0-rc-85acf2d195-20240711"
}
}
}
Loading

0 comments on commit 784bf71

Please sign in to comment.