Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release test 5 #10

Merged
merged 4 commits into from
Nov 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/auto/crate-plugin.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Auto, execPromise, IPlugin, SEMVER } from '@auto-it/core'
import { readFile, writeFile } from 'fs/promises'
import { join } from 'path'
import { join, resolve } from 'path'
import { inc, ReleaseType } from 'semver'
import { parse as parseToml } from 'toml'
/** Get the parsed cargo.toml for the crate */
Expand All @@ -23,7 +23,8 @@ export async function getWorkspaceMembers(): Promise<
> {
const { toml } = await getCargoConfig()
return toml.workspace.members.map(async (member: string) => {
const packagePath = join(process.cwd() || process.env.GITHUB_WORKSPACE || '', member, 'Cargo.toml')
const packagePath = resolve(process.cwd() || process.env.GITHUB_WORKSPACE || '', member, 'Cargo.toml')
console.log('\x1b[36m%s\x1b[0m', packagePath)
const packageContent = (await readFile(packagePath)).toString()
const packageToml = parseToml(packageContent.toString())
return {
Expand All @@ -39,6 +40,7 @@ export async function bumpVersions(bumpBy: SEMVER) {
const workspaceMembers = await getWorkspaceMembers()
const promises = workspaceMembers.map(async (member) => {
const { packagePath, packageContent, packageToml } = member
console.log('\x1b[36m%s\x1b[0m', packageContent, packagePath, packageToml)
const versionOld = packageToml.package.version
const versionNew = inc(versionOld, bumpBy as ReleaseType)

Expand Down
Loading