-
-
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.
- Loading branch information
Showing
282 changed files
with
2,767 additions
and
63 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 |
---|---|---|
|
@@ -52,6 +52,8 @@ jobs: | |
git config user.email [email protected] | ||
- name: Run ci:prepublish | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: yarn workspaces foreach -A --no-private run ci:prepublish | ||
|
||
- name: Release | ||
|
Binary file not shown.
Binary file added
BIN
+7.57 KB
.yarn/cache/@gulpjs-to-absolute-glob-npm-4.0.0-e28e1619ba-acddf10466.zip
Binary file not shown.
Binary file added
BIN
+21.6 KB
.yarn/cache/@sec-ant-readable-stream-npm-0.4.1-12d52145e0-64e9e9cf16.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+12.4 KB
.yarn/cache/@sindresorhus-merge-streams-npm-4.0.0-28e7c03ac1-482ee54362.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 added
BIN
+22.4 KB
.yarn/cache/conventional-changelog-angular-npm-1.6.6-74cb417a79-ae5a5b2b56.zip
Binary file not shown.
Binary file added
BIN
+17.6 KB
.yarn/cache/conventional-changelog-atom-npm-2.0.8-ab61571c15-1c7e971e8b.zip
Binary file not shown.
Binary file added
BIN
+16.7 KB
.yarn/cache/conventional-changelog-codemirror-npm-2.0.8-342d72f6a3-467c8c0dae.zip
Binary file not shown.
Binary file added
BIN
+40.5 KB
.yarn/cache/conventional-changelog-core-npm-3.2.3-cf0d84850a-3dc75b3c61.zip
Binary file not shown.
Binary file added
BIN
+20.3 KB
.yarn/cache/conventional-changelog-ember-npm-2.0.9-2276834930-bc37a1ec32.zip
Binary file not shown.
Binary file added
BIN
+20.1 KB
.yarn/cache/conventional-changelog-eslint-npm-3.0.9-62c523a901-340b3be510.zip
Binary file not shown.
Binary file added
BIN
+14.4 KB
.yarn/cache/conventional-changelog-express-npm-2.0.6-8a37ff0369-11a0286884.zip
Binary file not shown.
Binary file added
BIN
+11.3 KB
.yarn/cache/conventional-changelog-jquery-npm-0.1.0-ea2a1f0bc6-3000c1a466.zip
Binary file not shown.
Binary file added
BIN
+9.56 KB
.yarn/cache/conventional-changelog-jscs-npm-0.1.0-4d5b5d21a6-3680c3117b.zip
Binary file not shown.
Binary file added
BIN
+20.3 KB
.yarn/cache/conventional-changelog-jshint-npm-2.0.9-ef6b791bee-3048c3a02b.zip
Binary file not shown.
Binary file added
BIN
+32.9 KB
.yarn/cache/conventional-changelog-npm-2.0.3-7271ec1182-935cf1f972.zip
Binary file not shown.
Binary file added
BIN
+13.8 KB
.yarn/cache/conventional-changelog-preset-loader-npm-2.3.4-a907f2e49a-a978bcd5fc.zip
Binary file not shown.
Binary file added
BIN
+62.3 KB
.yarn/cache/conventional-changelog-writer-npm-4.1.0-a660c822b9-6917eef68b.zip
Binary file not shown.
Binary file added
BIN
+12.8 KB
.yarn/cache/conventional-commits-filter-npm-2.0.7-8762ee3bfa-df06fb2928.zip
Binary file not shown.
Binary file added
BIN
+59 KB
.yarn/cache/conventional-commits-parser-npm-3.2.4-d1ebb48cf6-122d7d7f99.zip
Binary file not shown.
Binary file added
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 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.
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.
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 added
BIN
+7.66 KB
.yarn/cache/json-parse-better-errors-npm-1.0.2-7f37637d19-2f1287a7c8.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 added
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 added
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 not shown.
Binary file not shown.
Binary file added
BIN
+28.4 KB
.yarn/cache/normalize-package-data-npm-2.5.0-af0345deed-357cb1646d.zip
Binary file not shown.
Binary file added
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 not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
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 not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+5.26 KB
.yarn/cache/remove-trailing-separator-npm-1.1.0-16d7231316-3568f9f8f5.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
+5.2 KB
.yarn/cache/semver-greatest-satisfied-range-npm-2.0.0-8755d94c12-7376dd0a56.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 added
BIN
+11.4 KB
.yarn/cache/supports-preserve-symlinks-flag-npm-1.0.0-f17c4d0028-6c40323407.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.
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
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,35 @@ | ||
import { Bumper } from "conventional-recommended-bump"; | ||
|
||
export class RestrictEmptyCommits extends Bumper { | ||
loadPreset(preset) { | ||
this.preset = preset; | ||
|
||
this.whatBump = async (commits) => { | ||
const { whatBump } = await this.getPreset(); | ||
|
||
return whatBump(commits); | ||
}; | ||
|
||
this.tagGetter = async () => { | ||
const { tags } = await this.getPreset(); | ||
|
||
return this.getLastSemverTag(tags); | ||
}; | ||
|
||
this.commitsGetter = async function* commitsGetter() { | ||
const { commits, parser } = await this.getPreset(); | ||
|
||
yield* this.getCommits(commits, parser); | ||
}; | ||
|
||
return this; | ||
} | ||
bump(whatBump = this.whatBump) { | ||
return super.bump((commits) => { | ||
if (commits.length === 0) { | ||
return null; | ||
} | ||
return whatBump(commits); | ||
}); | ||
} | ||
} |
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,26 @@ | ||
import { PassThrough } from "stream"; | ||
|
||
// Function to create a combined readable stream from two streams | ||
export function combineStreams(...streams) { | ||
const passThrough = new PassThrough(); | ||
let currentStreamIndex = 0; | ||
|
||
function pipeNext() { | ||
if (currentStreamIndex < streams.length) { | ||
const currentStream = streams[currentStreamIndex]; | ||
currentStream.pipe(passThrough, { end: false }); | ||
currentStream.on("end", () => { | ||
currentStreamIndex++; | ||
pipeNext(); | ||
}); | ||
currentStream.on("error", (error) => { | ||
passThrough.emit("error", error); | ||
}); | ||
} else { | ||
passThrough.end(); | ||
} | ||
} | ||
|
||
pipeNext(); | ||
return passThrough; | ||
} |
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 @@ | ||
import "./prepublish.js"; |
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,100 @@ | ||
import { task } from "gulp"; | ||
import { execa } from "execa"; | ||
import { temporaryFile } from "tempy"; | ||
import { rename } from "fs/promises"; | ||
import conventionalGithubReleaser from "conventional-github-releaser"; | ||
import conventionalChangelog from "conventional-changelog"; | ||
import createPreset from "conventional-changelog-conventionalcommits"; | ||
import { RestrictEmptyCommits } from "./RestrictEmptyCommits.js"; | ||
import { pipeline } from "stream/promises"; | ||
import { combineStreams } from "./combineStreams.js"; | ||
import { createReadStream, createWriteStream } from "fs"; | ||
|
||
const tagPrefix = "di-v"; | ||
const commitPath = "."; | ||
const changeLogFile = "CHANGELOG.md"; | ||
// print output of commands into the terminal | ||
const stdio = "inherit"; | ||
|
||
async function bumpVersion(preset) { | ||
const bumper = new RestrictEmptyCommits(process.cwd()) | ||
.loadPreset(preset) | ||
.tag({ | ||
prefix: tagPrefix, | ||
}) | ||
.commits({ path: commitPath }); | ||
|
||
const recommendation = await bumper.bump(); | ||
|
||
if (!recommendation.releaseType) { | ||
return null; | ||
} | ||
|
||
await execa("yarn", ["version", recommendation.releaseType], { | ||
stdio, | ||
}); | ||
|
||
const { stdout } = await execa`grep '"version"' package.json` | ||
.pipe`awk -F '"' '{print $4}'`; | ||
return stdout; | ||
} | ||
|
||
async function changelog(preset, version) { | ||
const changelogStream = conventionalChangelog( | ||
{ | ||
config: preset, | ||
tagPrefix, | ||
}, | ||
undefined, | ||
{ path: commitPath }, | ||
); | ||
|
||
const combinedStream = combineStreams( | ||
changelogStream, | ||
createReadStream(changeLogFile), | ||
); | ||
|
||
const tmp = temporaryFile(); | ||
|
||
await pipeline(combinedStream, createWriteStream(tmp, { flags: "w" })); | ||
await rename(tmp, changeLogFile); | ||
|
||
return version; | ||
} | ||
|
||
async function commitTagPush(version) { | ||
const commitMsg = `chore: release ${version}`; | ||
await execa("git", ["add", "package.json", "CHANGELOG.md"], { stdio }); | ||
await execa("git", ["commit", "--message", commitMsg], { stdio }); | ||
await execa("git", ["tag", `${tagPrefix}${version}`], { stdio }); | ||
await execa("git", ["push", "--follow-tags"], { stdio }); | ||
} | ||
|
||
async function githubRelease() { | ||
await new Promise((resolve, reject) => { | ||
conventionalGithubReleaser( | ||
{ type: "oauth", token: process.env.GITHUB_TOKEN }, | ||
{ preset, tagPrefix, commitPath }, | ||
(err, success) => { | ||
if (err) { | ||
reject(err); | ||
} else { | ||
resolve(success); | ||
} | ||
}, | ||
); | ||
}); | ||
} | ||
|
||
task("ci:prepublish", async () => { | ||
const preset = createPreset(); | ||
const version = await bumpVersion(preset); | ||
|
||
if (version === null) { | ||
return; | ||
} | ||
|
||
await changelog(preset, version); | ||
await commitTagPush(version); | ||
await githubRelease(); | ||
}); |
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
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 @@ | ||
import "@wroud/ci/gulp"; |
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
Oops, something went wrong.