From 7ba61508bc3f70cd7e687b209a235d8d27164861 Mon Sep 17 00:00:00 2001 From: Sarbagya Dhaubanjar <72559674+sarbagya-acme@users.noreply.github.com> Date: Mon, 31 Mar 2025 15:33:12 +0545 Subject: [PATCH] Added support for flavor (#7) (#8) Co-authored-by: Abhishek-Khanal <45957287+Abhishek-Khanal@users.noreply.github.com> --- action.yml | 10 +++++++++- scripts/build.sh | 7 +++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 838aed3..062c71f 100644 --- a/action.yml +++ b/action.yml @@ -17,6 +17,8 @@ inputs: description: Build Name build-number: description: Build Number + flavor: + description: App Flavor base-href: description: Base Href dart-define-file: @@ -56,7 +58,13 @@ runs: - name: Build Archive run: | ${{ inputs.pre }} - $GITHUB_ACTION_PATH/scripts/build.sh --platform=${{ inputs.platform }} --build-name=${{ inputs.build-name }} --build-number=${{ inputs.build-number }} --base-href=${{ inputs.base-href }} --env-file=${{ inputs.dart-define-file }} --tree-shake=${{ inputs.tree-shake-icons }} + $GITHUB_ACTION_PATH/scripts/build.sh --platform=${{ inputs.platform }} \ + --build-name=${{ inputs.build-name }} \ + --build-number=${{ inputs.build-number }} \ + --base-href=${{ inputs.base-href }} \ + --env-file=${{ inputs.dart-define-file }} \ + --tree-shake=${{ inputs.tree-shake-icons }} \ + --flavor=${{ inputs.flavor }} shell: bash working-directory: ${{ inputs.working-directory }} diff --git a/scripts/build.sh b/scripts/build.sh index 7bc389a..2794636 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -32,6 +32,9 @@ while [[ $# -gt 0 ]]; do --base-href=*) baseHref="${1#*=}" ;; + --flavor=*) + flavor="${1#*=}" + ;; --env-file=*) envFile="${1#*=}" ;; @@ -82,6 +85,10 @@ else buildCommand="$buildCommand --build-name=$buildName --build-number=$buildNumber" fi +if [ "$flavor" != "" ]; then + buildCommand="$buildCommand --flavor=$flavor" +fi + if [ "$treeShake" != "true" ]; then buildCommand="$buildCommand --no-tree-shake-icons" fi