Publish Variables
The Publish Variables section within the Publish module is a feature that allows you to set up and manage key-value pairs that are essential for the app publishing process.
To use these defined variables, it will be necessary to select them from the Publish Settings.
Publish Variables are key-value pairs that can be used to store configuration settings, credentials, and other data required during the publish process. You can add new variables directly in the Publish Variables section without the need for an additional menu or button.
How to Add a New Publish Variable
-
Input the Key-Value Pair:
- Locate the input fields under the 'Publish Variables' header.
- Enter the name of the variable in the 'Key' input field.
- Enter the corresponding value in the 'Value' input field.
-
Select Variable Type:
- Choose the type of variable you're adding. Options typically include:
- Text: for string or numeric values.
- File: if you're assigning a file as the variable's value.
- Choose the type of variable you're adding. Options typically include:
-
Add the Variable:
- Click the 'Add' button to save the new variable.
-
Review and Confirm:
- Once added, the new variable will appear in the list of Publish Variables.
- Ensure that the details are correct and the variable is saved properly.
Example Variable
In the example provided:
- Key Name:
Foo
- Value:
Bar
- Type:
Text
Remember to handle these variables with care, especially if they contain sensitive information such as passwords, tokens, or API keys.
Reserved Variables
There are some reserved variables that are automatically defined by Appcircle and can be used in the publish flow.
Common Publish Reserved Variables
Variable | Description |
---|---|
AC_RELEASE_NOTES | Specifies the release notes from the Build profile (if published from there) or from one of the Publish steps, to be published to the stores (Google Play , Huawei AppGallary , or App Store ). |
AC_ORGANIZATION_ID | Specifies the organization ID where the publish process starts. |
AC_USER_ID | Specifies the user ID who started the publish process. |
AC_USER_EMAIL | Specifies the email address of the user who started the publish process. |
AC_STORE_NAME | Name of the store where the app is being published. |
AC_PLATFORM_TYPE | Platform type (e.g., iOS:1 , Android:2 ). |
AC_UNIQUE_NAME | Unique name of the app (starts with com. for Android and iOS). |
AC_PUBLISH_APP_VERSION | Version of the app being published (e.g., 1.0.1 ). |
AC_PUBLISH_APP_VERSION_ID | App version ID being published on Appcircle. |
AC_PUBLISH_APP_VERSION_CODE | Version code of the app being published. |
AC_APP_VERSION_NAME | Name of the app version being published. |
AC_STORE_CREDENTIAL_ID | ID of the store credential where the app is being published. |
AC_PUBLISH_PROFILE_ID | Specifies the profile ID who started the publish process on Appcircle. |
AC_TASK_ID | Task ID associated with the publish process on Appcircle. |
AC_PUBLISH_ID | Publish ID on Appcircle. |
AC_PUBLISH_STEP_ID | Publish step ID on Appcircle. |
AC_RESOURCE_ID | Resource ID used in the publishing process on Appcircle. |
AC_ORGANIZATION_POOL_ID | Pool ID of the organization where the publish process starts. |
AC_SOURCE_ID | Source ID of the process (e.g., Publish ). |
AC_MODULE_NAME | Name of the module in the process (e.g., Publish ). |
AC_PUBLISH_PROFILE_NAME | Specifies the Appcircle profile name who started the publish process. |
AC_PUBLISH_STEP_NAME | Name of the publish flow step being run. |
AC_PUBLISH_WORKFLOW_NAME | Name of the publish workflow being run. |
AC_APP_FILE_URL | URL of the app file being published. |
AC_APP_FILE_NAME | Name of the app file being published (with file extension). |
User can use AC_RELEASE_NOTES
environment variable, if the apk
, aab
or ipa
files comes from Build module.
iOS Publish Reserved Variables
Variable | Description |
---|---|
AC_XCODE_LIST_DIR | Specifies the Xcode folder list directory. |
AC_XCODE_VERSION | Specifies the Xcode version. |
AC_VALIDATION_CONDITION | Used for the Get Approval from TestFlight. TestFlight's internalBuildState and externalBuildState will be checked according to the selection. |
AC_SUCCESS_STATUSES | You can customize Acceptable/Succeeded App Store statuses for your app. |
AC_STACK_TYPE | App Store or TestFlight stages. |
Android Publish Reserved Variables
Variable | Description |
---|---|
AC_RELEASE_STATUS | Used for the Send to Google Play step. Allows you to specify draft or completed app statuses on the Google Play Console. |
AC_STACK_TYPE | Used for the Send to Google Play step. Specifies the release track to send the binary. After the binary is uploaded, you can release it from the Google Play. |
AC_TRACK_TO_CHECK | Used for the Get Approval from Google Play step. It's recommended to check the track that you've sent the app in previous steps. |
AC_ACCEPTED_STATUSES | Used for the Get Approval from Google Play step. Statuses of completed ,inProgress ,draft ,halted can be used. |
AC_HUAWEI_APP_ID | Used for the Send to Huawei AppGallery step. Huawei requires Huawei App ID to be sent app to Huawei App Gallery. |
FAQ
How is environment variable exchange done between steps?
In the Appcircle Publish module, the steps within a Publish flow operate independently. This means that each step is executed in a separate, clean runner environment. This feature allows steps to run independently and individually. Therefore, to exchange environment variables between steps, the modified ENV value needs to be saved as an output variable.
Below is an example of how this can be done. Once an ENV variable is modified in a step and saved to the output direction, it will become accessible in another step.
- For first step
def set_env_variable(key, value)
open(ENV['AC_ENV_FILE_PATH'], 'a') do |f|
f.puts "#{key}=#{value}"
end
ENV[key] = value # New value added to new ENV
end
# First, get the $AC_BUILD_RELEASE_NOTES value
ac_build_release_notes = ENV['AC_RELEASE_NOTES']
# Check the value nil or not
if ac_build_release_notes.nil?
puts "Hata: $AC_RELEASE_NOTES değişkeni tanımlanmamış veya boş."
else
# Before
puts "Before: #{ac_build_release_notes}"
ac_build_release_notes = "Release note değiştirildi"
# After
puts "Changed: #{ac_build_release_notes}"
# Save the updated valur to new ENV value
set_env_variable('$AC_OUTPUT_DIR/STORE_NOTES.env', ac_build_release_notes)
# Print the new value.
puts "Sonrası store notes: #{ENV['STORE_NOTES']}"
end
- For second step
puts "After value changed in other step: #{ENV['$AC_OUTPUT_DIR/STORE_NOTES.env']}"