Skip to content

Commit

Permalink
update release
Browse files Browse the repository at this point in the history
  • Loading branch information
tachibana-shin committed Oct 15, 2022
1 parent 3e38917 commit 6a1ab32
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions scripts/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ import { exit } from "process"

import { bold, green, red } from "kleur"
import prompts from "prompts"
import semver, {
valid as isValidVersion,
SemVer,
} from "semver"
import semver, { valid as isValidVersion, SemVer } from "semver"

async function bumppAndroid() {
const androidDir = resolve(__dirname, "../src-capacitor/android")
Expand Down Expand Up @@ -97,10 +94,10 @@ async function bumppAndroid() {
const value =
name === "next"
? semver.parse(currentVersionName)?.prerelease?.length
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
? semver.inc(currentVersionName, "prerelease")!
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
: semver.inc(currentVersionName, "patch")!
? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
semver.inc(currentVersionName, "prerelease")!
: // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
semver.inc(currentVersionName, "patch")!
: new SemVer(currentVersionName).inc(name)

return { title: `${name.padStart(PADDING, " ")} ${value}`, value }
Expand Down Expand Up @@ -142,12 +139,20 @@ async function bumppAndroid() {
)

writeFileSync(resolve(androidDir, "app/build.gradle"), newBuildGradle)

spawn("git", ["add", `${resolve(androidDir, "app/build.gradle")}`])
spawn("git", [
"commit",
`chore: release ${newVersionName} build ${newVersionCode}`,
])
// spawn("git", ["push"])
await spawn("git", ["add", `${resolve(androidDir, "app/build.gradle")}`], {
stdio: "inherit",
})
await spawn(
"git",
[
"commit",
"-m",
`chore: release ${newVersionName} build ${newVersionCode}`,
],
{ stdio: "inherit" }
)
await spawn("git", ["tag", `v${currentVersionName}`])
await spawn("git", ["push"], { stdio: "inherit" })
await spawn("git", ["push", "--tags"])
}
bumppAndroid()

0 comments on commit 6a1ab32

Please sign in to comment.