Skip to content

Commit

Permalink
chore: fix branch name for public release builds (#385)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrehan27 authored Feb 18, 2025
1 parent 529522a commit 59ead6e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/build-release-sample-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,20 @@ on:
workflow_dispatch:
inputs:
sdk_version:
description: "SDK version to build sample apps with (optional, defaults to latest)"
description: "SDK version to build sample app with (optional, e.g., 4.1.0, defaults to latest)"
required: false
type: string

jobs:
determine-branch:
runs-on: ubuntu-latest
outputs:
branch_name: ${{ steps.get_branch.outputs.branch }}
steps:
- name: Extract Branch Name
id: get_branch
run: echo "branch=$(echo $GITHUB_REF_NAME)" >> $GITHUB_OUTPUT

determine-sdk-version:
runs-on: ubuntu-latest
outputs:
Expand All @@ -26,10 +35,11 @@ jobs:
fi
build-sample-app:
needs: determine-sdk-version
needs: [determine-branch, determine-sdk-version]
uses: ./.github/workflows/build-sample-app.yml
with:
app_name: "APN"
branch_name: ${{ needs.determine-branch.outputs.branch_name }}
cio-workspace-name: "Mobile: React Native"
sdk_version: ${{ needs.determine-sdk-version.outputs.resolved_version }}
secrets: inherit
11 changes: 10 additions & 1 deletion .github/workflows/build-sample-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
description: "Name of the sample app to build"
required: true
type: string
branch_name:
description: "Branch name for versioning"
required: false
type: string
cio-workspace-name:
description: "Name of the Customer.io workspace to use"
required: true
Expand Down Expand Up @@ -97,7 +101,12 @@ jobs:
with:
subdirectory: Apps/${{ inputs.app_name }}
lane: "generate_new_version"
options: '{"branch_name":"${{ github.ref_name }}", "pull_request_number":"${{ github.event.pull_request.number }}", "sdk_version":"${{ inputs.sdk_version }}"}'
options: >
{
"branch_name": "${{ inputs.branch_name || github.ref_name }}",
"pull_request_number": "${{ github.event.pull_request.number }}",
"sdk_version": "${{ inputs.sdk_version }}"
}
- name: Export App and SDK Version Info
id: export-vars
Expand Down
2 changes: 2 additions & 0 deletions Apps/fastlane/helpers/version_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
branch_name = github.pr_source_branch
elsif github.is_commit_pushed
branch_name = github.push_branch
else
branch_name = options[:branch_name] || "manual-release"
end

# Replace '/' with '-' to avoid issues with unsupported characters in version name
Expand Down

0 comments on commit 59ead6e

Please sign in to comment.