Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
# Changelog

## Unreleased

### Breaking Changes

Due to sentry-cli 3.0.0 upgrade, the following breaking changes have been made ([#370](https://github.com/getsentry/sentry-fastlane-plugin/pull/370)):

- **`sentry_upload_file` action has been removed**: The `releases files` commands were removed in sentry-cli 3.0.0. Users should migrate to `sentry_upload_sourcemap` for source maps or other specialized upload actions.
- **`android_manifest_path` parameter in `sentry_upload_proguard` has been removed**: The `--android-manifest` argument was removed in sentry-cli 3.0.0 and is no longer needed. Any Fastfiles still using this parameter will need to remove it.
- **`path` parameter default behavior changed in `sentry_debug_files_upload`**: The `path` parameter now defaults to `DSYM_OUTPUT_PATH` from fastlane's lane context if available (set by actions like `build_app` or `ipa`), otherwise falls back to `'.'` (current directory). This changes the default behavior when `DSYM_OUTPUT_PATH` is set, which may affect users who were relying on the previous behavior of always searching from the current directory. Users can explicitly specify `path: '.'` to maintain the previous behavior. This addresses issue [#377](https://github.com/getsentry/sentry-fastlane-plugin/issues/377).
- **`api_key` parameter has been removed**: The `api_key` parameter has been removed in favor of `auth_token`. All actions now require `auth_token` for authentication. Users should update their Fastfiles to use `auth_token` instead of `api_key`. ([#376](https://github.com/getsentry/sentry-fastlane-plugin/pull/376))
- **`force_foreground` parameter has been removed**: This parameter was deprecated as a no-op since v1.26.0 and has now been removed from `sentry_debug_files_upload`. Users should remove this parameter from their Fastfiles. ([#376](https://github.com/getsentry/sentry-fastlane-plugin/pull/376))
- **`sentry_upload_dsym` action has been removed**: This action has been deprecated in favor of `sentry_debug_files_upload`. Users should migrate to `sentry_debug_files_upload` with the appropriate `path` parameter. ([#375](https://github.com/getsentry/sentry-fastlane-plugin/pull/375))
- **`sentry_upload_dif` action has been removed**: This action has been deprecated in favor of `sentry_debug_files_upload`. Users should migrate to `sentry_debug_files_upload` with the appropriate `path` parameter. ([#375](https://github.com/getsentry/sentry-fastlane-plugin/pull/375))
- **`ids` parameter renamed to `id` in `sentry_debug_files_upload`**: The parameter has been renamed from `ids` to `id` to match sentry-cli v3. Users should update their Fastfiles to use `id` instead of `ids`.
- **Removed deprecated parameters from `sentry_debug_files_upload`**: The following parameters have been removed as they are no longer supported in sentry-cli v3: `info_plist`, `no_reprocessing`, `upload_symbol_maps`. Users should remove these parameters from their Fastfiles.

See the [sentry-cli 3.0.0 release notes](https://github.com/getsentry/sentry-cli/releases/tag/3.0.0) for more details on CLI changes.

### Features

- Set `SENTRY_PIPELINE` environment variable for all sentry-cli invocations to identify the plugin and version ([#365](https://github.com/getsentry/sentry-fastlane-plugin/pull/365))
- **Added missing sentry-cli v3 options to all actions**: All actions have been updated to support all available options from sentry-cli version 3.0.1:
- **`sentry_debug_files_upload`**: Added `wait_for`, `no_upload`, `il2cpp_mapping` options. Fixed `id` parameter (was `ids`). Updated type validation to include `jvm`, `portablepdb`, and `wasm` types. Removed deprecated options (`info_plist`, `no_reprocessing`, `upload_symbol_maps`) that are no longer supported in sentry-cli v3. (#382)
- **`sentry_upload_sourcemap`**: Added `url_suffix`, `note`, `validate`, `decompress`, `wait`, `wait_for`, `no_sourcemap_reference`, `debug_id_reference`, `bundle`, `bundle_sourcemap`, `ext` (array support), and `strict` options.
- **`sentry_upload_proguard`**: Added `no_upload`, `write_properties`, `require_one`, and `uuid` options.
- **`sentry_upload_build`**: Added `release_notes`, `force_git_metadata`, and `no_git_metadata` options.
- **`sentry_create_release`**: Added `url` option.
- **`sentry_finalize_release`**: Added `url` and `released` options.
- **`sentry_set_commits`**: Added `local` and `initial_depth` options.
- Add support for uploading Android App Bundles (.aab), Android APK files (.apk) and iOS app bundles (.ipa) to `sentry_upload_build` action ([#397](https://github.com/getsentry/sentry-fastlane-plugin/pull/397))

### Improvements

- **`sentry_upload_sourcemap` internal command changed**: Now uses `sourcemaps upload --release <version>` instead of `releases files <version> upload-sourcemaps`. This is an internal change and should not affect users unless they are mocking or testing the CLI commands ([#370](https://github.com/getsentry/sentry-fastlane-plugin/pull/370)).

### Dependencies

- Bump CLI from v2.58.2 to v3.1.0 ([#366](https://github.com/getsentry/sentry-fastlane-plugin/pull/366), [#367](https://github.com/getsentry/sentry-fastlane-plugin/pull/367), [#369](https://github.com/getsentry/sentry-fastlane-plugin/pull/369), [#371](https://github.com/getsentry/sentry-fastlane-plugin/pull/371), [#378](https://github.com/getsentry/sentry-fastlane-plugin/pull/378), [#383](https://github.com/getsentry/sentry-fastlane-plugin/pull/383))
- [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#310)
- [diff](https://github.com/getsentry/sentry-cli/compare/2.58.2...3.1.0)

## 2.0.0-rc.2

### Breaking Changes
Expand Down
79 changes: 69 additions & 10 deletions lib/fastlane/plugin/sentry/actions/sentry_upload_build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,45 @@ class SentryUploadBuildAction < Action
def self.run(params)
Helper::SentryConfig.parse_api_params(params)

# Verify xcarchive path
xcarchive_path = params[:xcarchive_path]
UI.user_error!("Could not find xcarchive at path '#{xcarchive_path}'") unless File.exist?(xcarchive_path)
UI.user_error!("Path '#{xcarchive_path}' is not an xcarchive") unless File.extname(xcarchive_path) == '.xcarchive'
# Determine which build file path to use (conflicting_options handles mutual exclusivity)
build_path = nil
build_type = nil

if params[:xcarchive_path]
build_path = params[:xcarchive_path]
build_type = :xcarchive
elsif params[:apk_path]
build_path = params[:apk_path]
build_type = :apk
elsif params[:aab_path]
build_path = params[:aab_path]
build_type = :aab
elsif params[:ipa_path]
build_path = params[:ipa_path]
build_type = :ipa
else
UI.user_error!("One of xcarchive_path, apk_path, aab_path, or ipa_path must be provided")
end

# Verify build file exists
UI.user_error!("Could not find build file at path '#{build_path}'") unless File.exist?(build_path)

# Verify file extension matches expected type
case build_type
when :xcarchive
UI.user_error!("Path '#{build_path}' is not an xcarchive") unless File.extname(build_path) == '.xcarchive'
when :apk
UI.user_error!("Path '#{build_path}' is not an APK") unless File.extname(build_path).casecmp('.apk').zero?
when :aab
UI.user_error!("Path '#{build_path}' is not an AAB") unless File.extname(build_path).casecmp('.aab').zero?
when :ipa
UI.user_error!("Path '#{build_path}' is not an IPA") unless File.extname(build_path).casecmp('.ipa').zero?
end

command = [
"build",
"upload",
File.absolute_path(xcarchive_path)
File.absolute_path(build_path)
]

# Add git-related parameters if provided
Expand All @@ -30,30 +60,59 @@ def self.run(params)
command << "--no-git-metadata" if params[:no_git_metadata]

Helper::SentryHelper.call_sentry_cli(params, command)
UI.success("Successfully uploaded build archive: #{xcarchive_path}")
UI.success("Successfully uploaded build file: #{build_path}")
end

#####################################################
# @!group Documentation
#####################################################

def self.description
"Upload iOS build archive to Sentry with optional git context"
"Upload build files (iOS .xcarchive/.ipa or Android .apk/.aab) to Sentry with optional git context"
end

def self.details
"This action allows you to upload iOS build archives (.xcarchive) to Sentry with optional git-related parameters for enhanced context including commit SHAs, branch names, repository information, and pull request details."
"This action allows you to upload build files to Sentry. Supported formats include iOS build archives (.xcarchive), iOS app bundles (.ipa), Android APK files (.apk), and Android App Bundles (.aab). The action supports optional git-related parameters for enhanced context including commit SHAs, branch names, repository information, and pull request details."
end

def self.available_options
Helper::SentryConfig.common_api_config_items + [
FastlaneCore::ConfigItem.new(key: :xcarchive_path,
description: "Path to your iOS build archive (.xcarchive)",
description: "Path to your iOS build archive (.xcarchive). Mutually exclusive with apk_path, aab_path, and ipa_path",
default_value: Actions.lane_context[SharedValues::XCODEBUILD_ARCHIVE],
optional: true,
conflicting_options: [:apk_path, :aab_path, :ipa_path],
verify_block: proc do |value|
# Skip validation if value is nil or empty (will be validated in run method)
next if value.nil? || value.to_s.empty?

UI.user_error!("Could not find xcarchive at path '#{value}'") unless File.exist?(value)
UI.user_error!("Path '#{value}' is not an xcarchive") unless File.extname(value) == '.xcarchive'
end),
FastlaneCore::ConfigItem.new(key: :apk_path,
description: "Path to your Android APK file (.apk). Mutually exclusive with xcarchive_path, aab_path, and ipa_path",
optional: true,
conflicting_options: [:xcarchive_path, :aab_path, :ipa_path],
verify_block: proc do |value|
UI.user_error!("Could not find APK at path '#{value}'") unless File.exist?(value)
UI.user_error!("Path '#{value}' is not an APK") unless File.extname(value).casecmp('.apk').zero?
end),
FastlaneCore::ConfigItem.new(key: :aab_path,
description: "Path to your Android App Bundle (.aab). Mutually exclusive with xcarchive_path, apk_path, and ipa_path",
optional: true,
conflicting_options: [:xcarchive_path, :apk_path, :ipa_path],
verify_block: proc do |value|
UI.user_error!("Could not find AAB at path '#{value}'") unless File.exist?(value)
UI.user_error!("Path '#{value}' is not an AAB") unless File.extname(value).casecmp('.aab').zero?
end),
FastlaneCore::ConfigItem.new(key: :ipa_path,
description: "Path to your iOS app bundle (.ipa). Mutually exclusive with xcarchive_path, apk_path, and aab_path",
optional: true,
conflicting_options: [:xcarchive_path, :apk_path, :aab_path],
verify_block: proc do |value|
UI.user_error!("Could not find IPA at path '#{value}'") unless File.exist?(value)
UI.user_error!("Path '#{value}' is not an IPA") unless File.extname(value).casecmp('.ipa').zero?
end),
FastlaneCore::ConfigItem.new(key: :head_sha,
env_name: "SENTRY_HEAD_SHA",
description: "The SHA of the head of the current branch",
Expand Down Expand Up @@ -125,7 +184,7 @@ def self.authors
end

def self.is_supported?(platform)
[:ios].include?(platform)
[:ios, :android].include?(platform)
end
end
end
Expand Down
Loading
Loading