From 39f0d9d53ce44f9321cc2f8f940a5d2dea589c26 Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Thu, 5 Mar 2026 12:11:45 -0500 Subject: [PATCH] refactor(ci): update product options to be more specific MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🔄 Changed product option values: - worker → worker-mobile-app - client → client-mobile-app 📝 Updated Files: - .github/workflows/hotfix-branch-creation.yml - .github/workflows/product-release.yml - .github/scripts/extract-version.sh - .github/scripts/extract-release-notes.sh - .github/scripts/create-release-summary.sh - .github/scripts/generate-tag-name.sh 🎯 Key Changes: - Product dropdown options now more specific - All conditional checks updated to use new values - Tag/branch names remain clean (strips -mobile-app suffix) - Tag format unchanged: krow-withus-worker-mobile/prod-v0.1.0 - Branch format unchanged: hotfix/krow-withus-worker-mobile-v0.1.0 Benefits: ✅ Clearer product selection (distinguishes mobile from future web/backend) ✅ Backward compatible tag format ✅ Maintains clean naming conventions --- .github/scripts/create-release-summary.sh | 2 +- .github/scripts/extract-release-notes.sh | 2 +- .github/scripts/extract-version.sh | 6 ++-- .github/scripts/generate-tag-name.sh | 6 +++- .github/workflows/hotfix-branch-creation.yml | 29 +++++++++++++------- .github/workflows/product-release.yml | 6 ++-- 6 files changed, 32 insertions(+), 19 deletions(-) diff --git a/.github/scripts/create-release-summary.sh b/.github/scripts/create-release-summary.sh index 54499bfc..ddefb1d9 100755 --- a/.github/scripts/create-release-summary.sh +++ b/.github/scripts/create-release-summary.sh @@ -16,7 +16,7 @@ if [ -z "$APP" ] || [ -z "$ENV" ] || [ -z "$VERSION" ] || [ -z "$TAG_NAME" ]; th fi # Determine display names -if [ "$APP" = "worker" ]; then +if [ "$APP" = "worker-mobile-app" ]; then APP_DISPLAY="Worker Product" APP_EMOJI="👷" else diff --git a/.github/scripts/extract-release-notes.sh b/.github/scripts/extract-release-notes.sh index 292bbd65..f29530fe 100755 --- a/.github/scripts/extract-release-notes.sh +++ b/.github/scripts/extract-release-notes.sh @@ -17,7 +17,7 @@ if [ -z "$APP" ] || [ -z "$VERSION" ] || [ -z "$ENV" ] || [ -z "$TAG_NAME" ] || fi # Determine CHANGELOG path and app name -if [ "$APP" = "worker" ]; then +if [ "$APP" = "worker-mobile-app" ]; then CHANGELOG_PATH="apps/mobile/apps/staff/CHANGELOG.md" APP_NAME="Staff Product (Worker)" else diff --git a/.github/scripts/extract-version.sh b/.github/scripts/extract-version.sh index dc1eed76..88d97dd8 100755 --- a/.github/scripts/extract-version.sh +++ b/.github/scripts/extract-version.sh @@ -1,19 +1,19 @@ #!/bin/bash # Extract version from version file for products # Usage: ./extract-version.sh -# app: worker or client +# app: worker-mobile-app or client-mobile-app set -e APP=$1 if [ -z "$APP" ]; then - echo "❌ Error: App parameter required (worker or client)" + echo "❌ Error: App parameter required (worker-mobile-app or client-mobile-app)" exit 1 fi # Determine pubspec path -if [ "$APP" = "worker" ]; then +if [ "$APP" = "worker-mobile-app" ]; then PUBSPEC_PATH="apps/mobile/apps/staff/pubspec.yaml" APP_NAME="Staff Product (Worker)" else diff --git a/.github/scripts/generate-tag-name.sh b/.github/scripts/generate-tag-name.sh index 3784c5af..c779b542 100755 --- a/.github/scripts/generate-tag-name.sh +++ b/.github/scripts/generate-tag-name.sh @@ -14,5 +14,9 @@ if [ -z "$APP" ] || [ -z "$ENV" ] || [ -z "$VERSION" ]; then exit 1 fi -TAG_NAME="krow-withus-${APP}-mobile/${ENV}-v${VERSION}" +# Strip -mobile-app suffix from app name for cleaner tag names +# worker-mobile-app -> worker, client-mobile-app -> client +APP_TAG=$(echo "$APP" | sed 's/-mobile-app$//') + +TAG_NAME="krow-withus-${APP_TAG}-mobile/${ENV}-v${VERSION}" echo "$TAG_NAME" diff --git a/.github/workflows/hotfix-branch-creation.yml b/.github/workflows/hotfix-branch-creation.yml index 2732b458..4a1a9e45 100644 --- a/.github/workflows/hotfix-branch-creation.yml +++ b/.github/workflows/hotfix-branch-creation.yml @@ -8,8 +8,8 @@ on: required: true type: choice options: - - worker - - client + - worker-mobile-app + - client-mobile-app tag: description: '🏷️ Current Tag (e.g., krow-withus-worker-mobile/prod-v0.1.0 or dev/stage)' required: true @@ -78,7 +78,10 @@ jobs: APP="${{ github.event.inputs.app }}" VERSION="${{ steps.hotfix_version.outputs.hotfix_version }}" - BRANCH_NAME="hotfix/krow-withus-${APP}-mobile-v${VERSION}" + # Strip -mobile-app suffix for cleaner branch names + APP_CLEAN=$(echo "$APP" | sed 's/-mobile-app$//') + + BRANCH_NAME="hotfix/krow-withus-${APP_CLEAN}-mobile-v${VERSION}" echo "branch_name=${BRANCH_NAME}" >> $GITHUB_OUTPUT echo "🌿 Branch to create: $BRANCH_NAME" @@ -115,7 +118,7 @@ jobs: APP="${{ github.event.inputs.app }}" HOTFIX_VERSION="${{ steps.hotfix_version.outputs.hotfix_version }}" - if [ "$APP" = "worker" ]; then + if [ "$APP" = "worker-mobile-app" ]; then PUBSPEC_PATH="apps/mobile/apps/staff/pubspec.yaml" CHANGELOG_PATH="apps/mobile/apps/staff/CHANGELOG.md" APP_NAME="Staff Product" @@ -148,7 +151,7 @@ jobs: HOTFIX_VERSION="${{ steps.hotfix_version.outputs.hotfix_version }}" ISSUE="${{ github.event.inputs.issue_description }}" - if [ "$APP" = "worker" ]; then + if [ "$APP" = "worker-mobile-app" ]; then CHANGELOG_PATH="apps/mobile/apps/staff/CHANGELOG.md" APP_NAME="Staff Product" else @@ -215,7 +218,10 @@ From tag: ${{ github.event.inputs.tag }}" ISSUE="${{ github.event.inputs.issue_description }}" APP="${{ github.event.inputs.app }}" - if [ "$APP" = "worker" ]; then + # Strip -mobile-app suffix for cleaner tag names + APP_CLEAN=$(echo "$APP" | sed 's/-mobile-app$//') + + if [ "$APP" = "worker-mobile-app" ]; then APP_DISPLAY="Worker Product" else APP_DISPLAY="Client Product" @@ -264,8 +270,8 @@ git push origin $BRANCH # Tag and release git checkout main git pull origin main -git tag -a krow-withus-${APP}-mobile/prod-v${HOTFIX_VERSION} -m \"HOTFIX: ${ISSUE}\" -git push origin krow-withus-${APP}-mobile/prod-v${HOTFIX_VERSION} +git tag -a krow-withus-${APP_CLEAN}-mobile/prod-v${HOTFIX_VERSION} -m \"HOTFIX: ${ISSUE}\" +git push origin krow-withus-${APP_CLEAN}-mobile/prod-v${HOTFIX_VERSION} \`\`\` --- @@ -285,6 +291,9 @@ git push origin krow-withus-${APP}-mobile/prod-v${HOTFIX_VERSION} - name: 📊 Hotfix Summary run: | + # Strip -mobile-app suffix for cleaner tag names + APP_CLEAN=$(echo "${{ github.event.inputs.app }}" | sed 's/-mobile-app$//') + echo "## 🚨 Hotfix Branch Created" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "**App:** ${{ github.event.inputs.app }}" >> $GITHUB_STEP_SUMMARY @@ -312,8 +321,8 @@ git push origin krow-withus-${APP}-mobile/prod-v${HOTFIX_VERSION} echo " \`\`\`bash" >> $GITHUB_STEP_SUMMARY echo " git checkout main" >> $GITHUB_STEP_SUMMARY echo " git pull origin main" >> $GITHUB_STEP_SUMMARY - echo " git tag -a krow-withus-${{ github.event.inputs.app }}-mobile/prod-v${{ steps.hotfix_version.outputs.hotfix_version }} -m \"HOTFIX: ${{ github.event.inputs.issue_description }}\"" >> $GITHUB_STEP_SUMMARY - echo " git push origin krow-withus-${{ github.event.inputs.app }}-mobile/prod-v${{ steps.hotfix_version.outputs.hotfix_version }}" >> $GITHUB_STEP_SUMMARY + echo " git tag -a krow-withus-${APP_CLEAN}-mobile/prod-v${{ steps.hotfix_version.outputs.hotfix_version }} -m \"HOTFIX: ${{ github.event.inputs.issue_description }}\"" >> $GITHUB_STEP_SUMMARY + echo " git push origin krow-withus-${APP_CLEAN}-mobile/prod-v${{ steps.hotfix_version.outputs.hotfix_version }}" >> $GITHUB_STEP_SUMMARY echo " \`\`\`" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/product-release.yml b/.github/workflows/product-release.yml index c66a80ca..a72d35e5 100644 --- a/.github/workflows/product-release.yml +++ b/.github/workflows/product-release.yml @@ -8,8 +8,8 @@ on: required: true type: choice options: - - worker - - client + - worker-mobile-app + - client-mobile-app environment: description: '🌍 Environment' required: true @@ -111,7 +111,7 @@ jobs: VERSION="${{ steps.version.outputs.version }}" # Generate release title - if [ "$APP" = "worker" ]; then + if [ "$APP" = "worker-mobile-app" ]; then APP_DISPLAY="Worker Mobile Application" else APP_DISPLAY="Client Mobile Application"