Skip to content

Commit

Permalink
push builds to public group
Browse files Browse the repository at this point in the history
  • Loading branch information
mrehan27 committed Jan 13, 2025
1 parent 00bfc4b commit 49e6fdb
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/build-sample-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,23 @@ jobs:
- uses: actions/checkout@v4

- name: Set Default Firebase Distribution Groups
shell: bash
env:
# Distribution group constants
ALL_BUILDS_GROUP: all-builds
FEATURE_BUILDS_GROUP: feature-branch
NEXT_BUILDS_GROUP: next
PUBLIC_BUILDS_GROUP: public
# Input variables
CURRENT_BRANCH: ${{ github.ref }}
run: |
# Define all the possible distribution groups
ALL_BUILDS_GROUP="all-builds"
FEATURE_BUILDS_GROUP="feature-branch"
STABLE_BUILDS_GROUP="next"
# Initialize with the default distribution group
distribution_groups=("$ALL_BUILDS_GROUP")
# Determine current app type and Git context
current_branch="${GITHUB_REF}"
# Append distribution groups based on branch and context
[[ "$current_branch" == "refs/heads/feature/"* ]] && distribution_groups+=("$FEATURE_BUILDS_GROUP")
[[ "$current_branch" == "refs/heads/main" ]] && distribution_groups+=("$STABLE_BUILDS_GROUP")
[[ "$CURRENT_BRANCH" == "refs/heads/feature/"* ]] && distribution_groups+=("$FEATURE_BUILDS_GROUP")
[[ "$CURRENT_BRANCH" == "refs/heads/main" ]] && distribution_groups+=("NEXT_BUILDS_GROUP")
[[ "$CURRENT_BRANCH" == "refs/heads/main" ]] && distribution_groups+=("PUBLIC_BUILDS_GROUP")
# Export the groups as an environment variable
echo "firebase_distribution_groups=$(IFS=','; echo "${distribution_groups[*]}")" >> $GITHUB_ENV
Expand Down

0 comments on commit 49e6fdb

Please sign in to comment.