-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ci: configure gulp * ci: read package version directly * ci: skip release commits * ci: enable github releases * ci: remove changelog
- Loading branch information
Showing
218 changed files
with
662 additions
and
1,713 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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+4.07 MB
.yarn/cache/@octokit-openapi-types-npm-22.2.0-ce9f704019-a45bfc7356.zip
Binary file not shown.
Binary file added
BIN
+170 KB
.yarn/cache/@octokit-plugin-paginate-rest-npm-11.3.3-026da2ef31-f1fd41e0ae.zip
Binary file not shown.
Binary file added
BIN
+7.89 KB
.yarn/cache/@octokit-plugin-request-log-npm-5.3.1-86ca827f31-2f959934b8.zip
Binary file not shown.
Binary file added
BIN
+1.19 MB
.yarn/cache/@octokit-plugin-rest-endpoint-methods-npm-13.2.4-b65b83dae6-7a63b37bb1.zip
Binary file not shown.
Binary file added
BIN
+7.94 KB
.yarn/cache/@octokit-request-error-npm-6.1.4-87357742f1-899668b1cd.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+22 KB
.yarn/cache/@types-conventional-changelog-core-npm-4.2.8-e3204b9a88-e7ab4074f5.zip
Binary file not shown.
Binary file added
BIN
+8.23 KB
.yarn/cache/@types-conventional-changelog-npm-3.1.5-a3ee08d14d-a2b4d9d316.zip
Binary file not shown.
Binary file added
BIN
+17.3 KB
.yarn/cache/@types-conventional-changelog-writer-npm-4.0.10-c0c45277b0-b5bcad254b.zip
Binary file not shown.
Binary file added
BIN
+9.86 KB
.yarn/cache/@types-conventional-recommended-bump-npm-9.0.3-27c17ef189-65c5708103.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+7.38 KB
.yarn/cache/@types-git-raw-commits-npm-2.0.4-f7b89979e6-7355fd7011.zip
Binary file not shown.
Binary file added
BIN
+5.6 KB
.yarn/cache/@types-git-semver-tags-npm-7.0.0-e1cd949ad3-e1c139d6e5.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+6.8 KB
.yarn/cache/@types-undertaker-registry-npm-1.0.4-01a279f5f4-e82af1f586.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-22.4 KB
.yarn/cache/conventional-changelog-angular-npm-1.6.6-74cb417a79-ae5a5b2b56.zip
Binary file not shown.
Binary file removed
BIN
-17.6 KB
.yarn/cache/conventional-changelog-atom-npm-2.0.8-ab61571c15-1c7e971e8b.zip
Binary file not shown.
Binary file removed
BIN
-15.2 KB
.yarn/cache/conventional-changelog-cli-npm-5.0.0-538331cf7f-b64ac6e46f.zip
Binary file not shown.
Binary file removed
BIN
-16.7 KB
.yarn/cache/conventional-changelog-codemirror-npm-2.0.8-342d72f6a3-467c8c0dae.zip
Binary file not shown.
Binary file removed
BIN
-40.5 KB
.yarn/cache/conventional-changelog-core-npm-3.2.3-cf0d84850a-3dc75b3c61.zip
Binary file not shown.
Binary file removed
BIN
-20.3 KB
.yarn/cache/conventional-changelog-ember-npm-2.0.9-2276834930-bc37a1ec32.zip
Binary file not shown.
Binary file removed
BIN
-20.1 KB
.yarn/cache/conventional-changelog-eslint-npm-3.0.9-62c523a901-340b3be510.zip
Binary file not shown.
Binary file removed
BIN
-14.4 KB
.yarn/cache/conventional-changelog-express-npm-2.0.6-8a37ff0369-11a0286884.zip
Binary file not shown.
Binary file removed
BIN
-11.3 KB
.yarn/cache/conventional-changelog-jquery-npm-0.1.0-ea2a1f0bc6-3000c1a466.zip
Binary file not shown.
Binary file removed
BIN
-9.56 KB
.yarn/cache/conventional-changelog-jscs-npm-0.1.0-4d5b5d21a6-3680c3117b.zip
Binary file not shown.
Binary file removed
BIN
-20.3 KB
.yarn/cache/conventional-changelog-jshint-npm-2.0.9-ef6b791bee-3048c3a02b.zip
Binary file not shown.
Binary file removed
BIN
-32.9 KB
.yarn/cache/conventional-changelog-npm-2.0.3-7271ec1182-935cf1f972.zip
Binary file not shown.
Binary file removed
BIN
-13.8 KB
.yarn/cache/conventional-changelog-preset-loader-npm-2.3.4-a907f2e49a-a978bcd5fc.zip
Binary file not shown.
Binary file removed
BIN
-62.3 KB
.yarn/cache/conventional-changelog-writer-npm-4.1.0-a660c822b9-6917eef68b.zip
Binary file not shown.
Binary file removed
BIN
-12.8 KB
.yarn/cache/conventional-commits-filter-npm-2.0.7-8762ee3bfa-df06fb2928.zip
Binary file not shown.
Binary file removed
BIN
-59 KB
.yarn/cache/conventional-commits-parser-npm-3.2.4-d1ebb48cf6-122d7d7f99.zip
Binary file not shown.
Binary file removed
BIN
-27.7 KB
.yarn/cache/conventional-github-releaser-npm-3.1.5-9755546099-eaecb46be5.zip
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-6.61 KB
.yarn/cache/currently-unhandled-npm-0.4.1-38eddab665-32d197689e.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-6.84 KB
.yarn/cache/decode-uri-component-npm-0.2.2-e22e2aa917-1f4fa54eb7.zip
Binary file not shown.
Binary file removed
BIN
-4.34 KB
.yarn/cache/decompress-response-npm-3.3.0-6e7b6375c3-5ffaf1d744.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-3.6 KB
.yarn/cache/git-remote-origin-url-npm-2.0.0-319debe0d1-3a846ce98e.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-19.9 KB
.yarn/cache/has-symbol-support-x-npm-1.4.2-185b8a260c-993f0e1a7a.zip
Binary file not shown.
Binary file removed
BIN
-17.5 KB
.yarn/cache/has-to-string-tag-x-npm-1.4.1-205861f243-e7197e830f.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-33.3 KB
.yarn/cache/http-cache-semantics-npm-3.8.1-9d037f563e-8925daec00.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-7.66 KB
.yarn/cache/json-parse-better-errors-npm-1.0.2-7f37637d19-2f1287a7c8.zip
Binary file not shown.
Binary file removed
BIN
-14.3 KB
.yarn/cache/json-stringify-safe-npm-5.0.1-064ddd6ab4-7dbf35cd04.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-4.02 KB
.yarn/cache/lodash._reinterpolate-npm-3.0.0-3c62ca439e-cdf592374b.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-13.5 KB
.yarn/cache/lodash.templatesettings-npm-4.2.0-15fbdebcf4-2609fea36e.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-28.4 KB
.yarn/cache/normalize-package-data-npm-2.5.0-af0345deed-357cb1646d.zip
Binary file not shown.
Binary file removed
BIN
-29.6 KB
.yarn/cache/normalize-package-data-npm-3.0.3-1a49056685-e5d0f739ba.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-5.58 KB
.yarn/cache/parse-github-repo-url-npm-1.4.1-a6f5f1254e-9170f591cd.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+3.9 KB
...regex-npm-2.0.0-218c804009-6b02b142ec.zip → ...regex-npm-4.0.5-9917344f87-c270eda133.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
|
@@ -27,6 +27,12 @@ | |
}, | ||
{ | ||
"path": "../docs" | ||
}, | ||
{ | ||
"path": "../ci" | ||
}, | ||
{ | ||
"path": "../ci-github-release" | ||
} | ||
] | ||
} |
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,30 @@ | ||
{ | ||
"name": "@wroud/ci-github-release", | ||
"private": true, | ||
"version": "0.0.1", | ||
"type": "module", | ||
"packageManager": "[email protected]", | ||
"devDependencies": { | ||
"@tsconfig/node20": "^20", | ||
"@types/conventional-changelog": "^3", | ||
"@types/conventional-changelog-core": "^4", | ||
"@types/conventional-changelog-writer": "^4", | ||
"@types/conventional-commits-parser": "^5", | ||
"@types/git-semver-tags": "^7", | ||
"@types/node": "^20", | ||
"@types/semver": "^7", | ||
"@wroud/tsconfig": "workspace:^", | ||
"typescript": "^5" | ||
}, | ||
"exports": { | ||
".": "./lib/github-release.js" | ||
}, | ||
"dependencies": { | ||
"@octokit/rest": "^21", | ||
"conventional-changelog": "^6", | ||
"conventional-changelog-conventionalcommits": "^8", | ||
"git-semver-tags": "^8", | ||
"semver": "^7", | ||
"semver-regex": "^4" | ||
} | ||
} |
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,4 @@ | ||
export interface IAuthOptions { | ||
type: "token" | "oauth"; | ||
token: string; | ||
} |
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,6 @@ | ||
import * as gitSemverTags from "git-semver-tags"; | ||
|
||
declare module "git-semver-tags" { | ||
const p = gitSemverTags.default; | ||
export { p as getSemverTags }; | ||
} |
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,122 @@ | ||
import conventionalChangelog from "conventional-changelog"; | ||
import { getSemverTags } from "git-semver-tags"; | ||
import { Octokit } from "@octokit/rest"; | ||
import semver from "semver"; | ||
import { Transform } from "stream"; | ||
import { transform } from "./transform.js"; | ||
|
||
import type { | ||
Context, | ||
GitRawCommitsOptions, | ||
ParserOptions, | ||
WriterOptions, | ||
} from "conventional-changelog-core"; | ||
import type { Context as WriterContext } from "conventional-changelog-writer"; | ||
import type { Commit } from "conventional-commits-parser"; | ||
import type { IAuthOptions } from "./IAuthOptions.js"; | ||
|
||
function log(message: string, ...args: any[]) { | ||
console.log(`[ci-github-releaser] ${message}`, ...args); | ||
} | ||
|
||
type Options< | ||
TCommit extends Commit = Commit, | ||
TContext extends WriterContext = WriterContext, | ||
> = conventionalChangelog.Options<TCommit, TContext>; | ||
|
||
/** | ||
* Create a GitHub release for the latest version in the repository. | ||
* | ||
* @param auth - The authentication options for the GitHub API. | ||
* @param changelogOpts - Options for the changelog generation. | ||
* @param context - The context object with owner and repository. | ||
* @param gitRawCommitsOpts - Options for git-raw-commits. | ||
* @param parserOpts - Options for the parser. | ||
* @param writerOpts - Options for the writer. | ||
*/ | ||
export async function githubRelease< | ||
TCommit extends Commit = Commit, | ||
TContext extends WriterContext = Context, | ||
>( | ||
auth: IAuthOptions, | ||
changelogOpts: Options<TCommit, TContext> = {}, | ||
context: Partial<TContext> = {}, | ||
gitRawCommitsOpts: GitRawCommitsOptions = {}, | ||
parserOpts: ParserOptions = {}, | ||
writerOpts: WriterOptions<TCommit, TContext> = {}, | ||
) { | ||
const { owner, repository } = context; | ||
if (!owner || !repository) { | ||
throw new Error("Expected context object with 'owner' and 'repository'"); | ||
} | ||
|
||
log(`Creating GitHub release for ${owner}/${repository}`); | ||
// Initialize Octokit with authentication | ||
const octokit = new Octokit({ auth: auth.token }); | ||
|
||
changelogOpts = { | ||
transform, | ||
releaseCount: 1, | ||
...changelogOpts, | ||
}; | ||
|
||
writerOpts.includeDetails = true; | ||
writerOpts.headerPartial = writerOpts.headerPartial || ""; | ||
|
||
const tags = await getSemverTags({ | ||
tagPrefix: changelogOpts.tagPrefix, | ||
}); | ||
|
||
if (!tags?.length) { | ||
throw new Error("No semver tags found"); | ||
} | ||
|
||
const { releaseCount = 1 } = changelogOpts; | ||
if (releaseCount !== 0) { | ||
gitRawCommitsOpts = { from: tags[releaseCount], ...gitRawCommitsOpts }; | ||
} | ||
|
||
gitRawCommitsOpts.to = gitRawCommitsOpts.to || tags[0]; | ||
|
||
await new Promise((resolve, reject) => { | ||
conventionalChangelog( | ||
changelogOpts, | ||
context, | ||
gitRawCommitsOpts, | ||
parserOpts, | ||
writerOpts, | ||
) | ||
.on("error", reject) | ||
.on("end", resolve) | ||
.pipe( | ||
new Transform({ | ||
objectMode: true, | ||
transform(chunk, enc, callback) { | ||
if (!chunk.keyCommit) { | ||
log("Skipping chunk without keyCommit"); | ||
} | ||
const version = chunk.keyCommit?.version; | ||
if (!version) { | ||
callback(); | ||
return; | ||
} | ||
|
||
const options = { | ||
owner, | ||
repo: repository, | ||
tag_name: version, | ||
name: version, | ||
body: chunk.log, | ||
draft: false, | ||
prerelease: (semver.parse(version)?.prerelease || []).length > 0, | ||
}; | ||
|
||
octokit.repos | ||
.createRelease(options) | ||
.then(() => callback()) | ||
.catch(callback); | ||
}, | ||
}), | ||
); | ||
}); | ||
} |
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 @@ | ||
import type { Commit } from "conventional-commits-parser"; | ||
import type { Options } from "conventional-changelog-core"; | ||
import semverRegex from "semver-regex"; | ||
|
||
export function transform<T extends Commit = Commit>( | ||
chunk: Commit, | ||
cb: Options.Transform.Callback<T>, | ||
) { | ||
chunk = { ...chunk }; | ||
|
||
const gitTags = chunk["gitTags"]; | ||
if (typeof gitTags === "string") { | ||
chunk["version"] = (gitTags.match(semverRegex()) || [])[0]; | ||
} | ||
|
||
if (chunk["committerDate"]) { | ||
// Format the date using toISOString and extract the date part in 'yyyy-mm-dd' format | ||
chunk["committerDate"] = new Date(chunk["committerDate"]) | ||
.toISOString() | ||
.split("T")[0]; | ||
} | ||
|
||
cb(null, chunk as T); | ||
} |
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,14 @@ | ||
{ | ||
"extends": "@wroud/tsconfig/tsconfig.json", | ||
"compilerOptions": { | ||
"tsBuildInfoFile": "./lib/.tsbuildinfo", | ||
"rootDir": "src", | ||
"rootDirs": ["src"], | ||
"outDir": "lib", | ||
"types": ["node"], | ||
"incremental": true, | ||
"composite": true | ||
}, | ||
"include": ["src"], | ||
"references": [] | ||
} |
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 |
---|---|---|
|
@@ -3,20 +3,24 @@ | |
"private": true, | ||
"type": "module", | ||
"packageManager": "[email protected]", | ||
"bin": { | ||
"get-version": "./bin/getVersion.js" | ||
}, | ||
"devDependencies": { | ||
"@tsconfig/node20": "^20" | ||
"@tsconfig/node20": "^20", | ||
"@types/conventional-changelog": "^3", | ||
"@types/conventional-changelog-core": "^4", | ||
"@types/conventional-changelog-writer": "^4", | ||
"@types/conventional-commits-parser": "^5", | ||
"@types/gulp": "^4", | ||
"@types/node": "^20", | ||
"@wroud/tsconfig": "workspace:^", | ||
"typescript": "^5" | ||
}, | ||
"exports": { | ||
"./gulp": "./gulp/index.js" | ||
"./gulp": "./lib/gulp/index.js" | ||
}, | ||
"dependencies": { | ||
"@wroud/ci-github-release": "workspace:^", | ||
"conventional-changelog": "^6", | ||
"conventional-changelog-cli": "^5", | ||
"conventional-changelog-conventionalcommits": "^8", | ||
"conventional-github-releaser": "^3", | ||
"conventional-recommended-bump": "^10", | ||
"execa": "^9", | ||
"gulp": "^5", | ||
|
5 changes: 5 additions & 0 deletions
5
packages/ci/src/conventional-changelog-conventionalcommits.d.ts
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,5 @@ | ||
declare module "conventional-changelog-conventionalcommits" { | ||
export type Preset = import("conventional-changelog-core").Options.Config; | ||
|
||
export default function createPreset(options?: any): Promise<Preset>; | ||
} |
17 changes: 15 additions & 2 deletions
17
packages/ci/gulp/RestrictEmptyCommits.js → packages/ci/src/gulp/RestrictEmptyCommits.ts
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
4 changes: 2 additions & 2 deletions
4
packages/ci/gulp/combineStreams.js → packages/ci/src/gulp/combineStreams.ts
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
File renamed without changes.
Oops, something went wrong.