From 99208709c686d256036ce997184f40ea67dd0439 Mon Sep 17 00:00:00 2001 From: sualko Date: Sun, 24 Jul 2022 14:06:59 +0200 Subject: [PATCH] chore: update release scripts --- scripts/build-release.js | 5 +++-- scripts/publish-release.js | 22 +++++++++------------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/scripts/build-release.js b/scripts/build-release.js index 288b15f..75c3c5d 100644 --- a/scripts/build-release.js +++ b/scripts/build-release.js @@ -5,8 +5,7 @@ const path = require('path'); const libxml = require('libxmljs'); const https = require('https'); const archiver = require('archiver'); -const execa = require('execa'); -const simpleGit = require('simple-git/promise'); +const simpleGit = require('simple-git'); const inquirer = require('inquirer'); const { exec } = require('child_process'); const { generateChangelog, hasChangeLogEntry } = require('./imports/changelog'); @@ -69,6 +68,8 @@ async function createRelease(appId) { console.log('✔ repo is clean'.green); } + const execa = (await import('execa')).execaCommand; + await execa('yarn', ['composer:install:dev']); console.log('✔ composer dev dependencies installed'.green); diff --git a/scripts/publish-release.js b/scripts/publish-release.js index 3f0947a..2203629 100644 --- a/scripts/publish-release.js +++ b/scripts/publish-release.js @@ -3,13 +3,14 @@ const colors = require('colors'); const fs = require('fs'); const path = require('path'); const https = require('https'); -const execa = require('execa'); -const simpleGit = require('simple-git/promise'); +const simpleGit = require('simple-git'); const inquirer = require('inquirer'); const dotenv = require('dotenv'); const { Octokit } = require('@octokit/rest'); const { getChangelogEntry, hasChangeLogEntry } = require('./imports/changelog'); +const getExeca = async () => (await import('execa')).execaCommand; + // eslint-disable-next-line @typescript-eslint/no-var-requires const packageInfo = require('../package.json'); @@ -63,19 +64,11 @@ async function stageAllFiles() { return; } - const gitProcess = execa('git', ['add', '-u']); - - gitProcess.stdout.pipe(process.stdout); - - return gitProcess; + await git.raw('add', '-u'); } -function showStagedDiff() { - const gitProcess = execa('git', ['diff', '--staged']); - - gitProcess.stdout.pipe(process.stdout); - - return gitProcess; +async function showStagedDiff() { + console.log(await git.raw('diff', '--staged')); } async function keypress() { @@ -141,6 +134,7 @@ async function createGithubRelease(changeLog) { name: `BigBlueButton Integration ${tagName}`, body: changeLog.replace(/^## [^\n]+\n/, ''), prerelease: !/^\d+\.\d+\.\d+$/.test(packageInfo.version), + draft: true, }; if (isDryRun) { @@ -251,6 +245,8 @@ async function uploadToNextcloudStore(archiveUrl) { } async function run() { + const execa = await getExeca(); + await pull(); console.log('✔ pulled latest changes'.green);