Skip to content

Commit

Permalink
release test 5 (#10)
Browse files Browse the repository at this point in the history
* release test 3

* test release 4

* test release 5
  • Loading branch information
michaelangeloio authored Nov 7, 2023
1 parent f314f1d commit c42734d
Showing 1 changed file with 4 additions and 2 deletions.
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

0 comments on commit c42734d

Please sign in to comment.