Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.bitrise.secrets.yml
.bitrise
out/
7 changes: 4 additions & 3 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
app:
envs:
# define these in your .bitrise.secrets.yml
- project_path:
- scheme:
- workdir:
- BITRISE_PROJECT_PATH​:
- BITRISE_SCHEME:
- BITRISE_SOURCE_DIR:

workflows:
test:
Expand All @@ -19,3 +19,4 @@ workflows:
inputs:
- content: |-
echo "-> BITRISE_IPA_PATH: ${BITRISE_IPA_PATH}"
echo "-> BITRISE_DSYM_PATH: ${BITRISE_DSYM_PATH}"
58 changes: 58 additions & 0 deletions step.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ cd -

archive_path="${output_dir}/${scheme}.xcarchive"
ipa_path="${output_dir}/${scheme}.ipa"
dsym_zip_path="${output_dir}/${scheme}.dSYM.zip"

if [ -z "${workdir}" ] ; then
workdir="$(pwd)"
Expand All @@ -52,6 +53,7 @@ echo " * workdir: ${workdir}"
echo " * output_dir: ${output_dir}"
echo " * archive_path: ${archive_path}"
echo " * ipa_path: ${ipa_path}"
echo " * dsym_zip_path: ${dsym_zip_path}"

if [ ! -z "${workdir}" ] ; then
echo
Expand Down Expand Up @@ -145,4 +147,60 @@ echo " (i) The IPA is now available at: ${ipa_path}"
envman add --key BITRISE_IPA_PATH --value "${ipa_path}"
echo ' (i) The IPA path is now available in the Environment Variable: $BITRISE_IPA_PATH'

set -v


#
# dSYM handling
# get the .app.dSYM folders from the dSYMs archive folder
archive_dsyms_folder="${archive_path}/dSYMs"
ls "${archive_dsyms_folder}"
app_dsym_count=0
app_dsym_path=""

IFS=$'\n'
for a_app_dsym in $(find "${archive_dsyms_folder}" -type d -name "*.app.dSYM") ; do
echo " (i) .app.dSYM found: ${a_app_dsym}"
app_dsym_count=$[app_dsym_count + 1]
app_dsym_path="${a_app_dsym}"
echo " (i) app_dsym_count: $app_dsym_count"
done
unset IFS

echo " (i) Found dSYM count: ${app_dsym_count}"
if [ ${app_dsym_count} -eq 1 ] ; then
echo "* dSYM found at: ${app_dsym_path}"
if [ -d "${app_dsym_path}" ] ; then
export DSYM_PATH="${app_dsym_path}"
else
echo "* (i) *Found dSYM path is not a directory!*"
fi
else
if [ ${app_dsym_count} -eq 0 ] ; then
echo "* (i) **No dSYM found!** To generate debug symbols (dSYM) go to your Xcode Project's Settings - *Build Settings - Debug Information Format* and set it to *DWARF with dSYM File*."
else
echo "* (i) *More than one dSYM found!*"
fi
fi

# Generate dSym zip
if [[ ! -z "${DSYM_PATH}" && -d "${DSYM_PATH}" ]] ; then
echo "Generating zip for dSym"

dsym_parent_folder=$( dirname "${DSYM_PATH}" )
dsym_fold_name=$( basename "${DSYM_PATH}" )
# cd into dSYM parent to not to store full
# paths in the ZIP
cd "${dsym_parent_folder}"
/usr/bin/zip -rTy \
"${dsym_zip_path}" \
"${dsym_fold_name}"

echo " (i) The IPA is now available at: ${dsym_zip_path}"
envman add --key BITRISE_DSYM_PATH --value "${dsym_zip_path}"
echo ' (i) The IPA path is now available in the Environment Variable: $BITRISE_DSYM_PATH'
else
echo " (!) No dSYM found (or not a directory: ${DSYM_PATH})"
fi

exit 0
19 changes: 16 additions & 3 deletions step.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
title: Xcode Archive
summary: Runs Xcode's `archive` action.
description: ""
website: https://github.com/bitrise-io/steps-new-xcode-archive
source_code_url: https://github.com/bitrise-io/steps-new-xcode-archive
support_url: https://github.com/bitrise-io/steps-new-xcode-archive/issues
Expand All @@ -16,38 +17,50 @@ is_skippable: false
dependencies:
- manager: _
name: xcode
run_if: ""
inputs:
- project_path:
- project_path: ${BITRISE_PROJECT_PATH​}
opts:
title: "Project (or Workspace) path"
summary: ""
description: |
A `.xcodeproj` or `.xcworkspace` path.
is_required: true
is_expand: true
- scheme:
is_dont_change_value: false
- scheme: ${BITRISE_SCHEME}
opts:
title: "Scheme name"
summary: ""
description: |
The Scheme to use.
is_required: true
is_expand: true
- workdir:
is_dont_change_value: false
- workdir: ${BITRISE_SOURCE_DIR}
opts:
title: "Working directory"
summary: ""
description: |
Working directory of the step.
You can leave it empty to don't change it.
is_required: false
is_expand: true
is_dont_change_value: false
- output_dir: "./build"
opts:
title: "Output directory path"
summary: ""
description: |
This directory will contain the generated Xcode archive (.xcarchive)
and the .ipa file.
is_required: false
is_expand: true
is_dont_change_value: false
outputs:
- BITRISE_IPA_PATH:
opts:
title: The created .ipa file's path
- BITRISE_DSYM_PATH:
opts:
title: The created .dSYM.zip file's path