Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Internal builds leftovers #23803

Draft
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Draft
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
4 changes: 2 additions & 2 deletions Scripts/BuildPhases/GenerateCredentials.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ EXTERNAL_CONTRIBUTOR_MSG="If you are an external contributor, run \`bundle exec

case $CONFIGURATION in
Release*)
# There are three release configurations: Release, Release-Alpha, and
# Release-Internal. Since they all start with "Release" we can use a
# There are two release configurations: Release and Release-Alpha.
# Since they all start with "Release", we can use a
# pattern to check for them.
echo "error: $COULD_NOT_FIND_SECRET_MSG. Cannot continue Release build. $INTERNAL_CONTRIBUTOR_MSG. $EXTERNAL_CONTRIBUTOR_RELEASE_MSG."
exit 1
Expand Down
1,165 changes: 67 additions & 1,098 deletions WordPress/WordPress.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

This file was deleted.

4 changes: 0 additions & 4 deletions config/Jetpack.internal.xcconfig

This file was deleted.

2 changes: 0 additions & 2 deletions config/Version.internal.xcconfig

This file was deleted.

2 changes: 1 addition & 1 deletion config/WordPress.alpha.xcconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "Version.internal.xcconfig"
#include "Version.public.xcconfig"
#include "Common.enterprise.xcconfig"

BUILD_SCHEME=WordPress Alpha
2 changes: 1 addition & 1 deletion config/WordPress.debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "Version.internal.xcconfig"
#include "Version.public.xcconfig"
#include "Common.debug.xcconfig"

BUILD_SCHEME=WordPress
4 changes: 0 additions & 4 deletions config/WordPress.internal.xcconfig

This file was deleted.

68 changes: 1 addition & 67 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ Dotenv.load(PROJECT_ENV_FILE_PATH)
GITHUB_REPO = 'wordpress-mobile/wordpress-iOS'
DEFAULT_BRANCH = 'trunk'
PUBLIC_CONFIG_FILE = File.join(PROJECT_ROOT_FOLDER, 'config', 'Version.public.xcconfig')
INTERNAL_CONFIG_FILE = File.join(PROJECT_ROOT_FOLDER, 'config', 'Version.internal.xcconfig')
ENV['FASTLANE_WWDR_USE_HTTP1_AND_RETRIES'] = 'true'

# Fastlane's `git_branch` action and its relevant helpers use environment variables to modify the output.
Expand All @@ -66,10 +65,6 @@ VERSION_FORMATTER = Fastlane::Wpmreleasetoolkit::Versioning::FourPartVersionForm
BUILD_CODE_FORMATTER = Fastlane::Wpmreleasetoolkit::Versioning::FourPartBuildCodeFormatter.new
PUBLIC_VERSION_FILE = Fastlane::Wpmreleasetoolkit::Versioning::IOSVersionFile.new(xcconfig_path: PUBLIC_CONFIG_FILE)

# Instantiate internal versioning classes
INTERNAL_BUILD_CODE_CALCULATOR = Fastlane::Wpmreleasetoolkit::Versioning::DateBuildCodeCalculator.new
INTERNAL_VERSION_FILE = Fastlane::Wpmreleasetoolkit::Versioning::IOSVersionFile.new(xcconfig_path: INTERNAL_CONFIG_FILE)

BUILDKITE_ORGANIZATION = 'automattic'
BUILDKITE_PIPELINE = 'wordpress-ios'
BUILDKITE_RELEASE_PIPELINE = 'release-builds.yml'
Expand Down Expand Up @@ -107,15 +102,6 @@ def release_version_current
VERSION_FORMATTER.release_version(current_version)
end

# Returns the internal release version of the app in the format `1.2` or `1.2.3` if it is a hotfix
#
def release_version_current_internal
# Read the current release version from the .xcconfig file and parse it into an AppVersion object
current_version = VERSION_FORMATTER.parse(INTERNAL_VERSION_FILE.read_release_version)
# Return the formatted release version
VERSION_FORMATTER.release_version(current_version)
end

# Returns the next release version of the app in the format `1.2` or `1.2.3` if it is a hotfix
#
def release_version_next
Expand Down Expand Up @@ -145,45 +131,19 @@ def build_code_current
BUILD_CODE_FORMATTER.build_code(version: version)
end

# Returns the current internal build code of the app
#
def build_code_current_internal
# Read the current build code from the .xcconfig file and parse it into an AppVersion object
# The AppVersion is used because WP/JPiOS uses the four part (1.2.3.4) build code format, so the version
# calculator can be used to calculate the next four-part version
version = VERSION_FORMATTER.parse(INTERNAL_VERSION_FILE.read_build_code(attribute_name: 'VERSION_LONG'))
# Return the formatted build code
BUILD_CODE_FORMATTER.build_code(version: version)
end

# Returns the build code of the app for the code freeze. It is the release version name plus sets the build number to 0
#
def build_code_code_freeze
# Read the current build code from the .xcconfig file and parse it into an AppVersion object
# The AppVersion is used because WP/JPiOS uses the four part (1.2.3.4) build code format, so the version
# calculator can be used to calculate the next four-part version
release_version_current = VERSION_FORMATTER.parse(INTERNAL_VERSION_FILE.read_release_version)
release_version_current = VERSION_FORMATTER.parse(PUBLIC_VERSION_FILE.read_release_version)
# Calculate the next release version, which will be used as the basis of the new build code
build_code_code_freeze = VERSION_CALCULATOR.next_release_version(version: release_version_current)
# Return the formatted build code
BUILD_CODE_FORMATTER.build_code(version: build_code_code_freeze)
end

# Returns the internal build code of the app for the code freeze. It is the release version name plus sets the build
# number to 0
#
def build_code_code_freeze_internal
# Read the current build code from the .xcconfig file and parse it into an AppVersion object
# The AppVersion is used because WP/JPiOS uses the four part (1.2.3.4) build code format, so the version
# calculator can be used to calculate the next four-part version
release_version_current = VERSION_FORMATTER.parse(INTERNAL_VERSION_FILE.read_release_version)
# Calculate the next release version, which will be used as the basis of the new build code
release_version_next = VERSION_CALCULATOR.next_release_version(version: release_version_current)
build_code_code_freeze = INTERNAL_BUILD_CODE_CALCULATOR.next_build_code(version: release_version_next)
# Return the formatted build code
BUILD_CODE_FORMATTER.build_code(version: build_code_code_freeze)
end

# Returns the build code of the app for the code freeze. It is the hotfix version name plus sets the build number to 0
#
def build_code_hotfix(release_version:)
Expand All @@ -205,32 +165,6 @@ def build_code_next
BUILD_CODE_FORMATTER.build_code(version: build_code_next)
end

# Returns the next internal build code of the app
#
def build_code_next_internal
# Read the current build code from the .xcconfig file and parse it into an AppVersion object
# The AppVersion is used because WP/JPiOS uses the four part (1.2.3.4) build code format, so the version
# calculator can be used to calculate the next four-part version
build_code_current = VERSION_FORMATTER.parse(INTERNAL_VERSION_FILE.read_build_code(attribute_name: 'VERSION_LONG'))
# Calculate the next build code
build_code_next = INTERNAL_BUILD_CODE_CALCULATOR.next_build_code(version: build_code_current)
# Return the formatted build code
BUILD_CODE_FORMATTER.build_code(version: build_code_next)
end

# Returns the next internal hotfix build code of the app
#
def build_code_hotfix_internal(release_version:)
# Read the current build code from the .xcconfig file and parse it into an AppVersion object
# The AppVersion is used because WP/JPiOS uses the four part (1.2.3.4) build code format, so the version
# calculator can be used to calculate the next four-part version
build_code_current = VERSION_FORMATTER.parse(release_version)
# Calculate the next build code
build_code_next = INTERNAL_BUILD_CODE_CALCULATOR.next_build_code(version: build_code_current)
# Return the formatted build code
BUILD_CODE_FORMATTER.build_code(version: build_code_next)
end

########################################################################
# Group buildkite logs by action
########################################################################
Expand Down
2 changes: 1 addition & 1 deletion fastlane/lanes/build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def build_and_upload_prototype_build(scheme:, output_app_name:, appcenter_app_na
configuration = 'Release-Alpha'

# Get the current build version, and update it if needed
version_config_path = File.join(PROJECT_ROOT_FOLDER, 'config', 'Version.internal.xcconfig')
version_config_path = File.join(PROJECT_ROOT_FOLDER, 'config', 'Version.public.xcconfig')
versions = Xcodeproj::Config.new(File.new(version_config_path)).to_hash
build_number = generate_prototype_build_number
UI.message("Updating build version to #{build_number}")
Expand Down
26 changes: 0 additions & 26 deletions fastlane/lanes/codesign.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#
lane :update_wordpress_certs_and_profiles do |options|
alpha_code_signing(options)
internal_code_signing(options)
appstore_code_signing(options)
end

Expand All @@ -31,7 +30,6 @@
#
lane :update_jetpack_certs_and_profiles do |options|
jetpack_alpha_code_signing(options)
jetpack_internal_code_signing(options)
jetpack_appstore_code_signing(options)
end

Expand All @@ -51,18 +49,6 @@
)
end

# Downloads all the required certificates and profiles (using `match``) for the WordPress Internal builds (`org.wordpress.internal`) in the Enterprise account.
# Optionally, it can create any new necessary certificate or profile.
#
# @option [Boolean] readonly (default: true) Whether to only fetch existing certificates and profiles, without generating new ones.
#
private_lane :internal_code_signing do |options|
update_code_signing_enterprise(
app_identifiers: ALL_WORDPRESS_BUNDLE_IDENTIFIERS.map { |id| id.sub(WORDPRESS_BUNDLE_IDENTIFIER, 'org.wordpress.internal') },
readonly: options.fetch(:readonly, true)
)
end

# Downloads all the required certificates and profiles (using `match``) for the WordPress App Store builds
# Optionally, it can create any new necessary certificate or profile.
#
Expand All @@ -87,18 +73,6 @@
)
end

# Downloads all the required certificates and profiles (using `match``) for the Jetpack Internal builds (`com.jetpack.internal`) in the Enterprise account.
# Optionally, it can create any new necessary certificate or profile.
#
# @option [Boolean] readonly (default: true) Whether to only fetch existing certificates and profiles, without generating new ones.
#
private_lane :jetpack_internal_code_signing do |options|
update_code_signing_enterprise(
app_identifiers: ALL_JETPACK_BUNDLE_IDENTIFIERS.map { |id| id.sub(JETPACK_BUNDLE_IDENTIFIER, 'com.jetpack.internal') },
readonly: options.fetch(:readonly, true)
)
end

# Downloads all the required certificates and profiles (using `match``) for the Jetpack App Store builds.
# Optionally, it can create any new necessary certificate or profile.
#
Expand Down
Loading