Skip to content

Instantly share code, notes, and snippets.

@igor-makarov
Created July 1, 2019 05:35
Show Gist options
  • Save igor-makarov/d928a8f460ba5e8e2c3452583835fcde to your computer and use it in GitHub Desktop.
Save igor-makarov/d928a8f460ba5e8e2c3452583835fcde to your computer and use it in GitHub Desktop.
Spaceship legacy API usage
#!/usr/bin/env ruby
fastlane_require 'rest-client'
fastlane_require 'json'
fastlane_require 'pathname'
fastlane_require 'fileutils'
fastlane_require 'spaceship'
fastlane_require 'sigh'
fastlane_require 'sigh/download_all'
fastlane_require 'fabricate'
DIR = File.dirname(__FILE__)
lane :dsymcopy do |options|
bundle_id = options[:bundle_id]
build = options[:build]
team_id = options[:team_id]
Spaceship::Tunes.login
Spaceship::Tunes.select_team(team_id: team_id)
app = Spaceship::Tunes::Application.find(bundle_id)
builds = app.builds(platform: :ios).select(&:processed?)
if !build
builds = builds.sort_by(&:build_version).reverse.take(1)
else
STDERR.puts "checking #{builds.count} builds"
builds = builds.select { |b| b.build_version == build }
end
puts "Build: #{builds.map(&:build_version)}"
builds.each do |build|
download_dsyms(
platform: 'ios',
app_identifier: bundle_id,
team_id: team_id,
version: build.train_version,
build_number: build.build_version,
)
end
Actions.lane_context[SharedValues::DSYM_PATHS].each do |dsym_path|
fabricator = Fabricate::Fabricate.new(app_identifier: bundle_id, api_key: "XXXX", filename: dsym_path)
fabricator.verbose = true
fabricator.run!
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment