Skip to content

Commit

Permalink
chore: tweak release script
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsorban44 committed Jul 13, 2022
1 parent f4c7401 commit d9534d8
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 40 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@
"pretty-quick": "^3.1.2",
"semver": "7.3.5",
"stream-to-array": "2.3.0",
"ts-node": "10.5.0",
"ts-node": "10.8.2",
"turbo": "1.3.1",
"type-fest": "2.16.0",
"typescript": "^4.5.2"
},
"engines": {
Expand Down
35 changes: 22 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 1 addition & 10 deletions scripts/release/analyze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import type {
import { debug, pkgJson, execSync } from "./utils"
import semver from "semver"
import parseCommit from "@commitlint/parse"
// @ts-ignore
import gitLog from "git-log-parser"
// @ts-ignore
import streamToArray from "stream-to-array"

export async function analyze(options: {
Expand All @@ -18,14 +16,12 @@ export async function analyze(options: {
BREAKING_COMMIT_MSG: string
RELEASE_COMMIT_MSG: string
RELEASE_COMMIT_TYPES: string[]
SKIP_RELEASE_MSG: string
}): Promise<PackageToRelease[]> {
const {
packages,
BREAKING_COMMIT_MSG,
RELEASE_COMMIT_MSG,
RELEASE_COMMIT_TYPES,
SKIP_RELEASE_MSG,
} = options

const packageFolders = Object.values(options.packages)
Expand Down Expand Up @@ -69,12 +65,7 @@ export async function analyze(options: {
)

const lastCommit = commitsSinceLatestTag[0]
if (lastCommit?.parsed.raw.includes(SKIP_RELEASE_MSG)) {
console.log(
`Last commit contained ${SKIP_RELEASE_MSG}, skipping release...`
)
return []
}

if (lastCommit?.parsed.raw === RELEASE_COMMIT_MSG) {
debug("Already released...")
return []
Expand Down
3 changes: 1 addition & 2 deletions scripts/release/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ export const config = {
"@next-auth/typeorm-legacy-adapter": "packages/adapter-typeorm-legacy",
},
rootDir: process.cwd(),
RELEASE_COMMIT_MSG: "chore(release): bump version",
BREAKING_COMMIT_MSG: "BREAKING CHANGE:",
SKIP_RELEASE_MSG: "[skip release]",
RELEASE_COMMIT_MSG: "chore(release): bump package version(s) [skip ci]",
RELEASE_COMMIT_TYPES: ["feat", "fix"],
dryRun:
!process.env.CI ||
Expand Down
1 change: 0 additions & 1 deletion scripts/release/publish.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { createHash } from "crypto"
import type { Commit, PackageToRelease } from "./types"

import { debug, pkgJson, execSync } from "./utils"
Expand Down
17 changes: 4 additions & 13 deletions scripts/release/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
{
"compilerOptions": {
"target": "ES2018",
"module": "commonjs",
"target": "ESNext",
"module": "NodeNext",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitAny": true,
"skipLibCheck": true,
"checkJs": true,
"resolveJsonModule": true
"skipDefaultLibCheck": true
},
"ts-node": {
"transpileOnly": true,
"files": true,
"compilerOptions": {
"sourceMap": true,
"inlineSources": true
}
"swc": true
}
}

0 comments on commit d9534d8

Please sign in to comment.