From 807b531853636c32ceb69f3b7005e5cd9d2c0165 Mon Sep 17 00:00:00 2001 From: Andy Pixley <3723676+pixman20@users.noreply.github.com> Date: Mon, 15 Dec 2025 20:29:03 -0500 Subject: [PATCH] Making an example for dev_mode --- .github/workflows/build-desktop.yml | 33 ++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-desktop.yml b/.github/workflows/build-desktop.yml index 0bc34fc7056..9e7b0ce9752 100644 --- a/.github/workflows/build-desktop.yml +++ b/.github/workflows/build-desktop.yml @@ -83,6 +83,7 @@ jobs: hotfix_branch_exists: ${{ steps.branch-check.outputs.hotfix_branch_exists }} node_version: ${{ steps.retrieve-node-version.outputs.node_version }} has_secrets: ${{ steps.check-secrets.outputs.has_secrets }} + dev_mode: ${{ steps.check-dev-mode.outputs.dev_mode }} defaults: run: working-directory: apps/desktop @@ -155,6 +156,28 @@ jobs: has_secrets=${{ secrets.AZURE_CLIENT_ID != '' }} echo "has_secrets=$has_secrets" >> "$GITHUB_OUTPUT" + - name: Check dev mode + id: check-dev-mode + run: | + EVENT_NAME="${GITHUB_EVENT_NAME}" + REF="${GITHUB_REF}" + DEV_MODE=true + + if [[ "$EVENT_NAME" == "push" ]]; then + BRANCH="${REF#refs/heads/}" + case "$BRANCH" in + main|rc|hotfix-rc-desktop) + DEV_MODE=false + ;; + *) + DEV_MODE=true + ;; + esac + fi + + echo "dev_mode=$DEV_MODE" >> "$GITHUB_OUTPUT" + echo "dev_mode set to $DEV_MODE (event=$EVENT_NAME ref=$REF)" + linux: name: Linux Build # Note, before updating the ubuntu version of the workflow, ensure the snap base image @@ -589,7 +612,7 @@ jobs: - name: Build env: - BUILD_MODE: ${{ github.event_name == 'workflow_call' && 'build' || 'build:dev' }} + BUILD_MODE: ${{ needs.setup.outputs.dev_mode == 'true' && 'build:dev' || 'build' }} run: npm run "$env:BUILD_MODE" - name: Pack @@ -856,7 +879,7 @@ jobs: - name: Build env: - BUILD_MODE: ${{ github.event_name == 'workflow_call' && 'build' || 'build:dev' }} + BUILD_MODE: ${{ needs.setup.outputs.dev_mode == 'true' && 'build:dev' || 'build' }} run: npm run "$env:BUILD_MODE" - name: Pack @@ -1216,7 +1239,7 @@ jobs: - name: Build application (dev) env: - BUILD_MODE: ${{ github.event_name == 'workflow_call' && 'build' || 'build:dev' }} + BUILD_MODE: ${{ needs.setup.outputs.dev_mode == 'true' && 'build:dev' || 'build' }} run: npm run "$BUILD_MODE" browser-build: @@ -1443,7 +1466,7 @@ jobs: - name: Build if: steps.build-cache.outputs.cache-hit != 'true' env: - BUILD_MODE: ${{ github.event_name == 'workflow_call' && 'build' || 'build:dev' }} + BUILD_MODE: ${{ needs.setup.outputs.dev_mode == 'true' && 'build:dev' || 'build' }} run: npm run "$BUILD_MODE" - name: Download Browser artifact @@ -1728,7 +1751,7 @@ jobs: - name: Build if: steps.build-cache.outputs.cache-hit != 'true' env: - BUILD_MODE: ${{ github.event_name == 'workflow_call' && 'build' || 'build:dev' }} + BUILD_MODE: ${{ needs.setup.outputs.dev_mode == 'true' && 'build:dev' || 'build' }} run: npm run "$BUILD_MODE" - name: Download Browser artifact