i'm not getting the "inputs" options when I select my git tab from the "Build Tag" option but works fine when I use the "Build Branch" option #3204
-
If you are looking for help, please confirm the following...
Which mobile framework are you using?Flutter (Dart) Steps to reproducei'm using this codemagic yaml file : definitions:
env_versions: &env_versions_v1
flutter: 3.32.7
java: 17
xcode: 16.2
vars:
GRADLE_OPTS: "-Dorg.gradle.jvmargs='-Xmx4g -XX:MaxMetaspaceSize=2g'"
artifacts: &artifacts_v1
- build/app/outputs/**/*.apk
- build/app/outputs/**/*.aab
- build/ios/**/mapping.txt
- build/ios/ipa/*.ipa
- /tmp/xcodebuild_logs/*.log
- flutter_drive.log
cache_paths: &cache_paths_v1
- $HOME/.gradle/caches
- $HOME/.pub-cache
# triggering: &triggering_v1
# events:
# - push
# - tag
# branch_patterns:
# - pattern: main
# include: true
# - pattern: develop
# include: true
# tag_patterns:
# - pattern: release-*
# cancel_previous_builds: true
slack: &slack_v1
channel: "#your-builds-channel" # MASKED
notify_on_build_start: false
notify:
success: true
scripts:
- &load_current_build_number
name: Get current build number
script: |
VERSION=$(grep 'version:' pubspec.yaml | sed 's/version: //g' | tr -d ' ')
BUILD_NUMBER=$(echo $VERSION | cut -d '+' -f2)
if [ -z "$BUILD_NUMBER" ]; then
BUILD_NUMBER=1
else
BUILD_NUMBER=$((BUILD_NUMBER + 1))
fi
echo "Next build number is $BUILD_NUMBER"
echo "BUILD_NUMBER=$BUILD_NUMBER" >> $CM_ENV
echo "VERSION=$(echo $VERSION | cut -d '+' -f1)" >> $CM_ENV
- &update_build_number
name: Update build number
script: |
sed -i.bak "s/^version: .*/version: $VERSION+$BUILD_NUMBER/" pubspec.yaml
rm pubspec.yaml.bak
- &flutter_pub_get
name: Get Flutter packages
script: |
flutter packages pub get
- &build_runner_build
name: Run Build Runner build
script: |
dart run build_runner build
- &set_environment_specific_icon
name: Set environment-specific icons
script: |
if [ "${{ inputs.environment_type }}" = "uat" ]; then
echo "Using UAT app icons"
dart run flutter_launcher_icons -f flutter_launcher_icons_uat.yaml
else
echo "Using PROD app icons"
flutter pub run flutter_launcher_icons -f flutter_launcher_icons_prod.yaml
fi
workflows:
android-prod-aab-release:
name: Android Prod AAB Release Build
labels:
- android
- environment_type prod
- release
instance_type: mac_mini_m1
max_build_duration: 30
environment:
<<: *env_versions_v1
android_signing:
- Your-Play-Upload-Key # MASKED
cache:
cache_paths: *cache_paths_v1
scripts:
- *flutter_pub_get
- *build_runner_build
# - *load_current_build_number
# - *update_build_number
- name: Set prod app icon
script: |
flutter pub run flutter_launcher_icons -f flutter_launcher_icons_prod.yaml
- name: Flutter build release apk
script: |
flutter build appbundle --release --dart-define-from-file=".env.prod"
- name: Rename AAB artifact
script: |
find build/ -name "*.aab" | xargs echo
ENVIRONMENT="prod"
VERSION=$(grep 'version:' pubspec.yaml | sed 's/version: //g' | cut -d '+' -f1)
BUILD_NUMBER=$(grep 'version:' pubspec.yaml | sed 's/version: //g' | cut -d '+' -f2)
OLD_PATH="build/app/outputs/bundle/release/app-release.aab"
NEW_PATH="build/app/outputs/bundle/release/mom_${VERSION}_${BUILD_NUMBER}_${ENVIRONMENT}.aab"
echo "Renaming $OLD_PATH to $NEW_PATH"
if [ -f "$OLD_PATH" ]; then
mv "$OLD_PATH" "$NEW_PATH"
else
echo "WARNING: $OLD_PATH not found."
fi
artifacts: *artifacts_v1
publishing:
slack:
<<: *slack_v1
# triggering:
# events:
# - tag
# tag_patterns:
# - pattern: release-*
android-release:
inputs:
environment_type:
description: Either UAT or PROD environment to use
type: choice
options: ["uat", "prod"]
default: uat
test_controls:
description: Enables Testing controls (true for UAT)
type: boolean
default: false
name: Android Release Build
labels:
- android
- environment_type ${{ inputs.environment_type }}
- testing_controls ${{ inputs.test_controls }}
- release
instance_type: mac_mini_m1
max_build_duration: 30
environment:
<<: *env_versions_v1
android_signing:
- Your-Play-Upload-Key # MASKED
cache:
cache_paths: *cache_paths_v1
scripts:
- *flutter_pub_get
- *build_runner_build
# - *load_current_build_number
# - *update_build_number
- *set_environment_specific_icon
- name: Flutter build release apk
script: |
flutter build apk --release --dart-define-from-file=".env.${{ inputs.environment_type }}" --dart-define="TEST_CONTROLS=${{ inputs.test_controls }}"
- name: Rename APK artifact
script: |
find build/ -name "*.apk" | xargs echo
ENVIRONMENT="${{ inputs.environment_type }}"
VERSION=$(grep 'version:' pubspec.yaml | sed 's/version: //g' | cut -d '+' -f1)
BUILD_NUMBER=$(grep 'version:' pubspec.yaml | sed 's/version: //g' | cut -d '+' -f2)
OLD_APK_PATH="build/app/outputs/flutter-apk/app-release.apk"
NEW_APK_PATH="build/app/outputs/flutter-apk/mom_${VERSION}_${BUILD_NUMBER}_${ENVIRONMENT}.apk"
echo "Renaming $OLD_APK_PATH to $NEW_APK_PATH"
if [ -f "$OLD_APK_PATH" ]; then
mv "$OLD_APK_PATH" "$NEW_APK_PATH"
else
echo "WARNING: $OLD_APK_PATH not found."
fi
artifacts: *artifacts_v1
publishing:
slack:
<<: *slack_v1
# triggering:
# <<: *triggering_v1
ios-release:
name: IOS Release Build
inputs:
environment_type:
description: Either UAT or PROD environment to use
type: choice
options: ["uat", "prod"]
default: uat
test_controls:
description: Enables Testing controls (true for UAT)
type: boolean
default: false
labels:
- ios
- environment_type ${{ inputs.environment_type }}
- testing_controls ${{ inputs.test_controls }}
- release
instance_type: mac_mini_m1
max_build_duration: 30
environment:
<<: *env_versions_v1
ios_signing:
distribution_type: app_store # or: ad_hoc | development | enterprise
# bundle_identifier: com.yourcompany.app # MASKED
provisioning_profiles:
- YourProvisioningProfile_MainApp # MASKED
- YourProvisioningProfile_Extension # MASKED
certificates:
- YourDistributionCertificate # MASKED
vars:
BUNDLE_ID: "com.yourcompany.app" # MASKED
XCODE_WORKSPACE: "Runner.xcworkspace"
XCODE_PROJECT: "Runner.xcodeproj"
XCODE_SCHEME: "Runner"
APP_STORE_APPLE_ID: 1234567890 # MASKED
scripts:
- *flutter_pub_get
- name: Installing flutterfire CLI
script: dart pub global activate flutterfire_cli
- *build_runner_build
- *load_current_build_number
- *update_build_number
- name: Set up code signing settings on Xcode project
script: xcode-project use-profiles
- *set_environment_specific_icon
- name: Flutter build IPA
script: |
# Get the current version from pubspec.yaml
CURRENT_VERSION=$(grep 'version:' pubspec.yaml | head -1 | awk '{print $2}' | cut -d'+' -f1)
echo "Current version: $CURRENT_VERSION"
# Get the latest build for the current version from TestFlight using the 'builds list' command.
# This allows filtering by version to get the correct build number.
# Get all valid builds for the current version.
# We will sort and pick the latest one client-side using jq.
ALL_BUILDS_JSON=$(app-store-connect builds list \
--app-id "$APP_STORE_APPLE_ID" \
--pre-release-version "$CURRENT_VERSION" \
--processing-state "VALID" \
--json)
# Check if ALL_BUILDS_JSON is empty or not a valid JSON array before processing with jq.
if [ -z "$ALL_BUILDS_JSON" ] || ! echo "$ALL_BUILDS_JSON" | jq -e 'if type=="array" then . else empty end' > /dev/null; then
echo "No builds found for version $CURRENT_VERSION or invalid JSON response (or JSON was not an array)."
BUILD_NUMBER=""
else
echo "--- JQ: Attempting to sort by numerical build version and extract latest build number --- "
# Sort by numerical version (descending) and pick the first one's version attribute
JQ_OUTPUT=$(echo "$ALL_BUILDS_JSON" | jq -r 'map(.attributes.version |= tonumber) | sort_by(.attributes.version) | reverse | .[0].attributes.version // empty')
echo "JQ_OUTPUT (extracted build number): $JQ_OUTPUT"
if [ -z "$JQ_OUTPUT" ]; then
echo "JQ failed to extract a build number. Defaulting to empty for increment logic."
BUILD_NUMBER=""
else
BUILD_NUMBER=$JQ_OUTPUT
fi
echo "--- JQ: Sorted builds (by numerical version and uploadedDate) --- "
# Log sorted list for debugging, now sorted by numerical version
echo "$ALL_BUILDS_JSON" | jq -r 'map(.attributes.version |= tonumber) | sort_by(.attributes.version) | reverse | .[] | "Version: \(.attributes.version), Date: \(.attributes.uploadedDate)"'
echo "--- END JQ: Sorted builds --- "
fi
# If no build exists for this version, start from 1, otherwise increment.
if [ -z "$BUILD_NUMBER" ]; then
NEW_BUILD_NUMBER=1
echo "No existing build found for version $CURRENT_VERSION, starting with build number: $NEW_BUILD_NUMBER"
else
NEW_BUILD_NUMBER=$(($BUILD_NUMBER + 1))
echo "Current BUILD_NUMBER for version $CURRENT_VERSION: $BUILD_NUMBER, NEW_BUILD_NUMBER: $NEW_BUILD_NUMBER"
fi
echo "NEW_BUILD_NUMBER=$NEW_BUILD_NUMBER" >> $CM_ENV
flutter build ipa --release \
--export-options-plist=/Users/builder/export_options.plist \
--build-number=$NEW_BUILD_NUMBER \
--dart-define-from-file=".env.${{ inputs.environment_type }}" \
--dart-define="TEST_CONTROLS=${{ inputs.test_controls }}"
- name: Rename IPA artifact
script: |
echo "Files inside build/ios/"
find build/ios -name "*.ipa" | xargs echo
ENVIRONMENT="${{ inputs.environment_type }}"
OLD_IPA_PATH="build/ios/ipa/miracle_of_mind.ipa"
NEW_IPA_PATH="build/ios/ipa/mom_${VERSION}_${NEW_BUILD_NUMBER}_${ENVIRONMENT}.ipa"
echo "Renaming $OLD_IPA_PATH to $NEW_IPA_PATH"
if [ -f "$OLD_IPA_PATH" ]; then
mv "$OLD_IPA_PATH" "$NEW_IPA_PATH"
else
echo "WARNING: $OLD_IPA_PATH does not exist. Please check your build path."
fi
artifacts: *artifacts_v1
integrations:
app_store_connect: YOUR_INTEGRATION_NAME # MASKED
publishing:
app_store_connect:
# Docs https://docs.codemagic.io/yaml-publishing/app-store-connect/
auth: integration
submit_to_testflight: true
beta_groups:
- Your Internal Testers # MASKED
slack:
<<: *slack_v1
# triggering:
# <<: *triggering_v1 Expected resultsIn codemagic.yaml file, i have below inputs :
It should show the "input" options in the codemagic ui in the "Build Tag" tab when i select any tag. But its not showing up. It shows up only when I try to build from a branch. Actual resultsNot showing the "input" options in the codemagic ui in the "Build Tag" tab when i select any tag. Build id (optional)No response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hello @nateshmbhat, thank you for reporting this! |
Beta Was this translation helpful? Give feedback.
hi @nateshmbhat, build inputs in tag builds are now supported