Skip to content

Commit

Permalink
ci: fix git-cliff usage in publish-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Aug 24, 2024
1 parent 368d51e commit 2d4bf65
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion scripts/docs/ci-publish-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ async function main() {
newVersion = tag.slice(1)
metaId = 'stable_version'
} else if (tag === 'beta' || tag === 'next') {
newVersion = await execa('git-cliff', ['--bumped-version']).then(r =>
const gitCliffBin = './scripts/versions/node_modules/.bin/git-cliff'

newVersion = await execa(gitCliffBin, ['--bumped-version']).then(r =>
r.stdout.replace(/^v/, ''),
)

if (tag === 'next') {
newVersion += '-alpha'
// Compare against the last alpha version.
Expand Down
7 changes: 4 additions & 3 deletions scripts/versions/src/publishVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ export async function publishVersion(args: {
deployKey?: string
nightlyDeployKey?: string
}) {
const gitCliffBin = './scripts/versions/node_modules/.bin/git-cliff'
const octokit = new Octokit({ auth: args.radashiBotToken })

// Determine the last stable version
const { stdout: stableVersion } = await execa('npm', [
'view',
Expand All @@ -38,6 +35,8 @@ export async function publishVersion(args: {

log(`Last stable version: ${stableVersion}`)

const gitCliffBin = './scripts/versions/node_modules/.bin/git-cliff'

// Determine the next version
let newVersion = await execa(gitCliffBin, ['--bumped-version'], {
env: { GITHUB_TOKEN: args.gitCliffToken },
Expand Down Expand Up @@ -208,6 +207,8 @@ export async function publishVersion(args: {
stdio: 'inherit',
})

const octokit = new Octokit({ auth: args.radashiBotToken })

log('Dispatching publish-docs workflow')
await octokit.actions.createWorkflowDispatch({
owner: 'radashi-org',
Expand Down

0 comments on commit 2d4bf65

Please sign in to comment.