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
2 changes: 1 addition & 1 deletion .github/workflows/build-bwa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ jobs:
- name: Build iOS app
run: |
BUILD_NUMBER=$(($GITHUB_RUN_NUMBER))
./Scripts-bwa/build.sh
./Scripts/build.sh project-bwa.yml Authenticator Device

- name: Upload IPA
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ jobs:

- name: Build iOS app
run: |
./Scripts/build.sh ${{ env._BUILD_MODE }}
./Scripts/build.sh project-pm.yml Bitwarden ${{ env._BUILD_MODE }}

- name: Prepare artifacts for upload to GitHub
run: |
Expand Down
44 changes: 0 additions & 44 deletions Scripts-bwa/build.sh

This file was deleted.

39 changes: 25 additions & 14 deletions Scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,51 @@
#
# Usage:
#
# $ ./Scripts/build.sh <build_mode>
# $ ./Scripts/build.sh <project_file> <build_scheme> <build_mode>
#
# Where mode is one of:
# - Device: Build for physical iOS devices
# - Simulator: Build for iOS Simulator
# Where:
# - project_file: Path to the project file (i.e., project-pm.yml or project-bwa.yml)
# - build_scheme: Build scheme (i.e., Bitwarden or Authenticator)
# - build_mode is one of:
# - Device: Build for physical iOS devices
# - Simulator: Build for iOS Simulator
#
# Examples:
# $ ./Scripts/build.sh project-pm.yml Bitwarden Simulator
# $ ./Scripts/build.sh project-bwa.yml Authenticator Device

set -euo pipefail

bold=$(tput -T ansi bold)
normal=$(tput -T ansi sgr0)

if [ $# -lt 1 ]; then
echo >&2 "Called without necessary arguments: ${bold}mode${normal}"
echo >&2 "For example: \`Scripts/build.sh Simulator"
if [ $# -lt 3 ]; then
echo >&2 "Called without necessary arguments: ${bold}project_file build_scheme build_mode${normal}"
echo >&2 "For example: \`Scripts/build.sh project-pm.yml Bitwarden Simulator\`"
exit 1
fi

MODE=$1
PROJECT_FILE=$1
BUILD_SCHEME=$2
MODE=$3

BUILD_DIR="build"
DERIVED_DATA_PATH="${BUILD_DIR}/DerivedData"
ARCHIVE_PATH="${BUILD_DIR}/Bitwarden.xcarchive"
EXPORT_PATH="${BUILD_DIR}/Bitwarden"
ARCHIVE_PATH="${BUILD_DIR}/${BUILD_SCHEME}.xcarchive"
EXPORT_PATH="${BUILD_DIR}/${BUILD_SCHEME}"

echo "๐Ÿงฑ Building in ${bold}$(pwd)${normal}"
echo "๐Ÿงฑ Using build mode of ${bold}${MODE}${normal}."
echo "๐Ÿงฑ Project file ${bold}${PROJECT_FILE}${normal}"
echo "๐Ÿงฑ Build Scheme ${bold}${BUILD_SCHEME}${normal}"
echo "๐Ÿงฑ Using build mode of ${bold}${MODE}${normal}"
echo "๐Ÿงฑ Derived Data path ${bold}${DERIVED_DATA_PATH}${normal}"
echo "๐Ÿงฑ Archive path ${bold}${ARCHIVE_PATH}${normal}"
echo "๐Ÿงฑ Export path ${bold}${EXPORT_PATH}${normal}"
echo ""

echo "๐ŸŒฑ Generating Xcode projects"
mint run xcodegen --spec "project-bwk.yml"
mint run xcodegen --spec "project-pm.yml"
mint run xcodegen --spec "${PROJECT_FILE}"
echo ""

mkdir -p "${BUILD_DIR}"
Expand All @@ -49,7 +60,7 @@ case "$MODE" in
echo "๐Ÿ”จ Performing Xcode build"
xcrun xcodebuild \
-workspace Bitwarden.xcworkspace \
-scheme Bitwarden \
-scheme "${BUILD_SCHEME}" \
-configuration Debug \
-destination "generic/platform=iOS Simulator" \
-derivedDataPath "${DERIVED_DATA_PATH}" \
Expand All @@ -59,7 +70,7 @@ case "$MODE" in
echo "๐Ÿ“ฆ Performing Xcode archive"
xcrun xcodebuild archive \
-workspace Bitwarden.xcworkspace \
-scheme Bitwarden \
-scheme "${BUILD_SCHEME}" \
-configuration Release \
-archivePath "${ARCHIVE_PATH}" \
-derivedDataPath "${DERIVED_DATA_PATH}" \
Expand Down
Loading