From 48bb4f0307c2ccb5d5f1df8db6971cea40818815 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Fri, 11 Jun 2021 18:24:18 +0200 Subject: [PATCH] test ci --- .github/scripts/run_ci.sh | 76 ++++++++++++-------------------- packages/tools/release-server.ts | 14 +----- 2 files changed, 30 insertions(+), 60 deletions(-) diff --git a/.github/scripts/run_ci.sh b/.github/scripts/run_ci.sh index cb9918aa1..da01b6320 100755 --- a/.github/scripts/run_ci.sh +++ b/.github/scripts/run_ci.sh @@ -12,26 +12,6 @@ IS_DEV_BRANCH=0 IS_LINUX=0 IS_MACOS=0 - - - - - - - -GIT_TAG_NAME=server-v2.0.7 - - - - - - - - - - - - if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then IS_PULL_REQUEST=1 fi @@ -79,26 +59,26 @@ npm install # want it to randomly fail when trying to create a desktop release. # ============================================================================= -# if [ "$IS_PULL_REQUEST" == "1" ] || [ "$IS_DEV_BRANCH" = "1" ]; then -# npm run test-ci -# testResult=$? -# if [ $testResult -ne 0 ]; then -# exit $testResult -# fi -# fi +if [ "$IS_PULL_REQUEST" == "1" ] || [ "$IS_DEV_BRANCH" = "1" ]; then + npm run test-ci + testResult=$? + if [ $testResult -ne 0 ]; then + exit $testResult + fi +fi # ============================================================================= # Run linter for pull requests only. We also don't want this to make the desktop # release randomly fail. # ============================================================================= -# if [ "$IS_PULL_REQUEST" != "1" ]; then -# npm run linter-ci ./ -# testResult=$? -# if [ $testResult -ne 0 ]; then -# exit $testResult -# fi -# fi +if [ "$IS_PULL_REQUEST" != "1" ]; then + npm run linter-ci ./ + testResult=$? + if [ $testResult -ne 0 ]; then + exit $testResult + fi +fi # ============================================================================= # Validate translations - this is needed as some users manually edit .po files @@ -106,15 +86,15 @@ npm install # for Linux only is sufficient. # ============================================================================= -# if [ "$IS_PULL_REQUEST" == "1" ]; then -# if [ "$IS_LINUX" == "1" ]; then -# node packages/tools/validate-translation.js -# testResult=$? -# if [ $testResult -ne 0 ]; then -# exit $testResult -# fi -# fi -# fi +if [ "$IS_PULL_REQUEST" == "1" ]; then + if [ "$IS_LINUX" == "1" ]; then + node packages/tools/validate-translation.js + testResult=$? + if [ $testResult -ne 0 ]; then + exit $testResult + fi + fi +fi # ============================================================================= # Find out if we should run the build or not. Electron-builder gets stuck when @@ -123,11 +103,11 @@ npm install # https://github.com/electron-userland/electron-builder/issues/4263 # ============================================================================= -# if [ "$IS_PULL_REQUEST" == "1" ]; then -# if [ "$IS_MACOS" == "1" ]; then -# exit 0 -# fi -# fi +if [ "$IS_PULL_REQUEST" == "1" ]; then + if [ "$IS_MACOS" == "1" ]; then + exit 0 + fi +fi # ============================================================================= # Prepare the Electron app and build it diff --git a/packages/tools/release-server.ts b/packages/tools/release-server.ts index 4f236ed5e..5b1aed315 100644 --- a/packages/tools/release-server.ts +++ b/packages/tools/release-server.ts @@ -11,18 +11,8 @@ async function main() { process.chdir(serverDir); const version = (await execCommand2('npm version patch')).trim(); - // const versionShort = version.substr(1); - // const imageVersion = versionShort + (isPreRelease ? '-beta' : ''); - const tagName = `server-${version}`; - - // process.chdir(rootDir); - // console.info(`Running from: ${process.cwd()}`); - - // await execCommand2(`docker build -t "joplin/server:${imageVersion}" -f Dockerfile.server .`); - // await execCommand2(`docker tag "joplin/server:${imageVersion}" "joplin/server:latest"`); - // await execCommand2(`docker push joplin/server:${imageVersion}`); - - // if (!isPreRelease) await execCommand2('docker push joplin/server:latest'); + const versionSuffix = isPreRelease ? '-beta' : ''; + const tagName = `server-${version}${versionSuffix}`; const changelogPath = `${rootDir}/readme/changelog_server.md`; await completeReleaseWithChangelog(changelogPath, version, tagName, 'Server', isPreRelease);