From 03ce4f07fdcc8f2ac0fbb862f56c761cb6fb9804 Mon Sep 17 00:00:00 2001 From: Fuat Guzel Date: Wed, 22 Oct 2025 12:25:27 +0300 Subject: [PATCH 1/6] Update Jenkinsfile to allow publishing when building a tag in addition to the existing publish parameter. --- Jenkinsfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3b130c5..fee83e3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -230,7 +230,10 @@ pipeline { stage('Publish') { when { - expression { params.PUBLISH == true } + anyOf { + expression { params.PUBLISH == true } + buildingTag() + } } steps { sh '''#!/bin/bash From c14081fad9e8ac3d8f77a80796d176113d4726fd Mon Sep 17 00:00:00 2001 From: Fuat Guzel Date: Wed, 22 Oct 2025 12:26:55 +0300 Subject: [PATCH 2/6] 2.7.6-alpha.4 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index ff257a8..3745926 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@appcircle/cli", - "version": "2.7.6-alpha.3", + "version": "2.7.6-alpha.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@appcircle/cli", - "version": "2.7.6-alpha.3", + "version": "2.7.6-alpha.4", "license": "MIT", "dependencies": { "axios": "^1.3.4", diff --git a/package.json b/package.json index db7bad0..e6d9082 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@appcircle/cli", - "version": "2.7.6-alpha.3", + "version": "2.7.6-alpha.4", "description": "CLI tool for running Appcircle services from the command line", "main": "bin/appcircle.js", "bin": { From 8b8ae676c920e2f535319a959c2d8a26f03c39e4 Mon Sep 17 00:00:00 2001 From: Fuat Guzel Date: Thu, 23 Oct 2025 00:41:01 +0300 Subject: [PATCH 3/6] Refactor Jenkinsfile to introduce an 'Auto Publish Alpha' stage that automatically bumps the alpha version and pushes a tag when changes are made to the 'develop' branch or specific test branches, while excluding commits with '[skip ci]'. This enhances the CI/CD workflow by streamlining the versioning process. --- Jenkinsfile | 69 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 62 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fee83e3..392150f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,8 +1,5 @@ pipeline { agent { label 'agent'} - parameters { - booleanParam(name: 'PUBLISH', defaultValue: false, description: 'Trigger publish stage') - } environment { NPM_AUTH_TOKEN = credentials('Appcircle-CLI-NPM-Cred') GITHUB_PAT = credentials('ozer-github-pat') @@ -228,11 +225,15 @@ pipeline { } } - stage('Publish') { + stage('Auto Publish Alpha') { when { - anyOf { - expression { params.PUBLISH == true } - buildingTag() + allOf { + anyOf { + branch 'develop' + branch pattern: 'pipeline/test-.*', comparator: 'REGEXP' + } + not { changelog '.*\\[skip ci\\].*' } + not { buildingTag() } } } steps { @@ -241,6 +242,60 @@ pipeline { set -x set -euo pipefail + echo "πŸš€ Starting Auto Alpha Version Publish πŸš€" + echo "===========================================" + + # Configuration + REPO="appcircleio/appcircle-cli" + GIT_USER_EMAIL="ozer@appcircle.io" + GIT_USER_NAME="Γ–zer from Jenkins" + + # Install dependencies if needed + echo "πŸ“¦ Installing dependencies..." + [ ! -d "node_modules" ] && yarn install + + # Build the project + echo "βš™οΈ Building project..." + npm run build + + # Run tests + echo "πŸ§ͺ Running tests..." + npm test + + # Configure git + git config user.email "$GIT_USER_EMAIL" + git config user.name "$GIT_USER_NAME" + + # Bump alpha version + echo "πŸ“ˆ Bumping alpha version..." + npm run bump:version:alpha + + # Get the new version and tag + NEW_VERSION=$(node -p "require('./package.json').version") + TAG="v${NEW_VERSION}" + echo "πŸ“Œ New version: ${TAG}" + + # Push tag to trigger publish stage + echo "πŸ“€ Pushing tag ${TAG} to remote..." + git push "https://${GITHUB_PAT}@github.com/${REPO}.git" "$TAG" + + echo "βœ… Alpha version ${TAG} created and pushed!" + echo "🎯 This will trigger the Publish stage automatically." + echo "===========================================" + ''' + } + } + + stage('Publish') { + when { + buildingTag() + } + steps { + sh '''#!/bin/bash + # shellcheck shell=bash + set -x + set -euo pipefail + node --version git fetch --tags --force From 6fdaa4763e7bfdf2d0726ec0efc69bf78c16bb48 Mon Sep 17 00:00:00 2001 From: Fuat Guzel Date: Thu, 23 Oct 2025 00:53:59 +0300 Subject: [PATCH 4/6] Add build info logging to Jenkinsfile for better visibility during auto publish --- Jenkinsfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 392150f..adfd4fa 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -244,6 +244,11 @@ pipeline { echo "πŸš€ Starting Auto Alpha Version Publish πŸš€" echo "===========================================" + echo "πŸ“‹ Build Info:" + echo " Branch: ${GIT_BRANCH}" + echo " Build Number: ${BUILD_NUMBER}" + echo " Commit: ${GIT_COMMIT:0:8}" + echo "===========================================" # Configuration REPO="appcircleio/appcircle-cli" From 3a7ce98ec737c90cafbbfc1f5a5f467fcfa3e7dc Mon Sep 17 00:00:00 2001 From: Fuat Guzel Date: Thu, 23 Oct 2025 07:43:11 +0300 Subject: [PATCH 5/6] fix: enable auto publish alpha stage for pull requests targeting develop --- Jenkinsfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index adfd4fa..f674a39 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -231,6 +231,10 @@ pipeline { anyOf { branch 'develop' branch pattern: 'pipeline/test-.*', comparator: 'REGEXP' + allOf { + changeRequest() + changeRequest target: 'develop' + } } not { changelog '.*\\[skip ci\\].*' } not { buildingTag() } From 0cddcb476fbb04da8fd926d5d210a913baa7f9ad Mon Sep 17 00:00:00 2001 From: Fuat Guzel Date: Thu, 23 Oct 2025 07:45:17 +0300 Subject: [PATCH 6/6] fix: enable auto publish alpha for all PRs and fixes branches --- Jenkinsfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f674a39..01abc57 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -231,10 +231,8 @@ pipeline { anyOf { branch 'develop' branch pattern: 'pipeline/test-.*', comparator: 'REGEXP' - allOf { - changeRequest() - changeRequest target: 'develop' - } + branch pattern: 'fixes/.*', comparator: 'REGEXP' + changeRequest() } not { changelog '.*\\[skip ci\\].*' } not { buildingTag() }