fastlane-plugin-screenshotslive 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 4b94c48f4980b7913c607efb064dadd0ba7c6a11ccf4f57abdde1f106d1d8869
4
+ data.tar.gz: d4be2bd39be2b82127efc03cae00f242c5ccdb5b240165e6ab522754ee8e9eb3
5
+ SHA512:
6
+ metadata.gz: 11e03828263b8cd463c488a402ff055bc6469157ec734e0ac4e7c6d6c774fe48b3d8cc330e5b65224600e442bd83f3906e6b1fd999a1c626ee29d7cc2dadecb6
7
+ data.tar.gz: c725e75991717d9c63e63cb267d2ca7c7a9500fee6b35b8b1333b57a1d25a4f98ed95b3aa2f25734f53b60ebc2238a22fab94c31db69c8ff7b27fb4123e614f2
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Eric Isensee - Screenshots.live
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,97 @@
1
+ # fastlane-plugin-screenshotslive
2
+
3
+ Generate app store screenshots via the [Screenshots.live](https://screenshots.live) REST API. Design templates once in the visual editor, then render all device sizes and locales automatically from your Fastlane pipeline.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ fastlane add_plugin screenshotslive
9
+ ```
10
+
11
+ Or add to your `Gemfile`:
12
+
13
+ ```ruby
14
+ gem "fastlane-plugin-screenshotslive"
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ ```ruby
20
+ # Fastfile
21
+ lane :screenshots do
22
+ screenshotslive(
23
+ api_key: ENV["SCREENSHOTSLIVE_API_KEY"],
24
+ yaml_config: "./screenshots.yml",
25
+ output_directory: "./fastlane/screenshots"
26
+ )
27
+
28
+ # Upload to App Store Connect
29
+ deliver(skip_metadata: true, skip_binary_upload: true)
30
+ end
31
+ ```
32
+
33
+ ## Parameters
34
+
35
+ | Key | Env Var | Description | Default |
36
+ |-----|---------|-------------|---------|
37
+ | `api_key` | `SCREENSHOTSLIVE_API_KEY` | Your API key from screenshots.live/app/api-access | Required |
38
+ | `yaml_config` | - | Path to your YAML render configuration | Required |
39
+ | `output_directory` | - | Where to extract rendered screenshots | `./screenshots` |
40
+ | `base_url` | `SCREENSHOTSLIVE_BASE_URL` | Override API URL (for testing) | `https://api.screenshots.live` |
41
+
42
+ ## Output Structure
43
+
44
+ Screenshots are extracted into Fastlane-compatible folders:
45
+
46
+ ```
47
+ screenshots/
48
+ en-US/
49
+ iPhone 6.5/
50
+ screenshot_01.png
51
+ screenshot_02.png
52
+ iPad 12.9/
53
+ screenshot_01.png
54
+ screenshot_02.png
55
+ phoneScreenshots/
56
+ screenshot_01.png
57
+ tenInchScreenshots/
58
+ screenshot_01.png
59
+ ```
60
+
61
+ ## YAML Configuration
62
+
63
+ Export your template's YAML config from the Screenshots.live editor, or write one manually:
64
+
65
+ ```yaml
66
+ templateId: "your-template-uuid"
67
+ locales:
68
+ - code: "en-US"
69
+ overrides:
70
+ headline: "Your App Name"
71
+ subtitle: "The best app ever"
72
+ - code: "de-DE"
73
+ overrides:
74
+ headline: "Ihr App-Name"
75
+ subtitle: "Die beste App aller Zeiten"
76
+ ```
77
+
78
+ ## Migrating from frameit
79
+
80
+ Replace your `frameit` call:
81
+
82
+ ```ruby
83
+ # Before
84
+ frameit(silver: true)
85
+
86
+ # After
87
+ screenshotslive(
88
+ api_key: ENV["SCREENSHOTSLIVE_API_KEY"],
89
+ yaml_config: "./screenshots.yml"
90
+ )
91
+ ```
92
+
93
+ Screenshots.live gives you everything frameit does plus: dynamic text/image overlays, multi-platform porting, localization via API, and a visual editor for designing templates.
94
+
95
+ ## License
96
+
97
+ MIT
@@ -0,0 +1,124 @@
1
+ require "zip"
2
+ require "fileutils"
3
+ require_relative "../helper/api_client"
4
+
5
+ module Fastlane
6
+ module Actions
7
+ class ScreenshotsliveAction < Action
8
+ def self.run(params)
9
+ api_key = params[:api_key]
10
+ yaml_path = params[:yaml_config]
11
+ output_dir = params[:output_directory]
12
+ base_url = params[:base_url]
13
+
14
+ yaml_config = File.read(yaml_path)
15
+ UI.message("Dispatching render via Screenshots.live API...")
16
+
17
+ client = Screenshotslive::ApiClient.new(api_key: api_key, base_url: base_url)
18
+
19
+ result = client.render(yaml_config: yaml_config)
20
+ job_id = result.dig("data", "id") || result["id"]
21
+ UI.message("Render job dispatched: #{job_id}")
22
+
23
+ UI.message("Waiting for render to complete...")
24
+ job = client.poll_job(job_id: job_id)
25
+
26
+ download_url = job.dig("data", "downloadUrl") || job["downloadUrl"]
27
+ unless download_url
28
+ raise "Render completed but no download URL returned"
29
+ end
30
+
31
+ UI.message("Downloading rendered screenshots...")
32
+ zip_data = client.download(url: download_url)
33
+
34
+ FileUtils.mkdir_p(output_dir)
35
+ zip_path = File.join(output_dir, "screenshots.zip")
36
+ File.binwrite(zip_path, zip_data)
37
+
38
+ UI.message("Extracting to #{output_dir}...")
39
+ Zip::File.open(zip_path) do |zip_file|
40
+ zip_file.each do |entry|
41
+ dest = File.join(output_dir, entry.name)
42
+ FileUtils.mkdir_p(File.dirname(dest))
43
+ entry.extract(dest) { true }
44
+ end
45
+ end
46
+
47
+ File.delete(zip_path)
48
+
49
+ UI.success("Screenshots rendered and extracted to #{output_dir}")
50
+ output_dir
51
+ end
52
+
53
+ def self.description
54
+ "Generate app store screenshots via the Screenshots.live REST API"
55
+ end
56
+
57
+ def self.authors
58
+ ["Eric Isensee"]
59
+ end
60
+
61
+ def self.return_value
62
+ "Path to the output directory containing rendered screenshots in Fastlane-compatible folder structure"
63
+ end
64
+
65
+ def self.details
66
+ "Sends a YAML configuration to the Screenshots.live render API, polls for completion, " \
67
+ "downloads the rendered ZIP, and extracts it into a Fastlane-compatible folder structure " \
68
+ "(iPhone 6.5, iPad 12.9, phoneScreenshots, tenInchScreenshots). " \
69
+ "Use this as a drop-in replacement for frameit with full template customization."
70
+ end
71
+
72
+ def self.available_options
73
+ [
74
+ FastlaneCore::ConfigItem.new(
75
+ key: :api_key,
76
+ env_name: "SCREENSHOTSLIVE_API_KEY",
77
+ description: "Your Screenshots.live API key",
78
+ sensitive: true,
79
+ type: String
80
+ ),
81
+ FastlaneCore::ConfigItem.new(
82
+ key: :yaml_config,
83
+ description: "Path to the YAML configuration file for the render",
84
+ type: String,
85
+ verify_block: proc do |value|
86
+ UI.user_error!("YAML config file not found: #{value}") unless File.exist?(value)
87
+ end
88
+ ),
89
+ FastlaneCore::ConfigItem.new(
90
+ key: :output_directory,
91
+ description: "Directory to extract rendered screenshots into",
92
+ default_value: "./screenshots",
93
+ type: String
94
+ ),
95
+ FastlaneCore::ConfigItem.new(
96
+ key: :base_url,
97
+ env_name: "SCREENSHOTSLIVE_BASE_URL",
98
+ description: "Override the API base URL (for testing)",
99
+ optional: true,
100
+ type: String
101
+ ),
102
+ ]
103
+ end
104
+
105
+ def self.is_supported?(platform)
106
+ [:ios, :android].include?(platform)
107
+ end
108
+
109
+ def self.category
110
+ :screenshots
111
+ end
112
+
113
+ def self.example_code
114
+ [
115
+ 'screenshotslive(
116
+ api_key: ENV["SCREENSHOTSLIVE_API_KEY"],
117
+ yaml_config: "./screenshots.yml",
118
+ output_directory: "./fastlane/screenshots"
119
+ )',
120
+ ]
121
+ end
122
+ end
123
+ end
124
+ end
@@ -0,0 +1,76 @@
1
+ require "faraday"
2
+ require "json"
3
+
4
+ module Fastlane
5
+ module Screenshotslive
6
+ class ApiClient
7
+ BASE_URL = "https://api.screenshots.live"
8
+ RENDER_PATH = "/render-api"
9
+ POLL_INTERVAL = 3
10
+ MAX_POLL_ATTEMPTS = 200
11
+
12
+ def initialize(api_key:, base_url: nil)
13
+ @api_key = api_key
14
+ @conn = Faraday.new(url: base_url || BASE_URL) do |f|
15
+ f.request :multipart
16
+ f.request :url_encoded
17
+ f.adapter Faraday.default_adapter
18
+ end
19
+ end
20
+
21
+ def render(yaml_config:)
22
+ response = @conn.post(RENDER_PATH) do |req|
23
+ req.headers["Authorization"] = "Bearer #{@api_key}"
24
+ req.headers["Content-Type"] = "application/json"
25
+ req.body = JSON.generate({ yamlConfig: yaml_config })
26
+ end
27
+
28
+ unless response.success?
29
+ body = JSON.parse(response.body) rescue {}
30
+ raise "Screenshots.live API error (#{response.status}): #{body["message"] || response.body}"
31
+ end
32
+
33
+ JSON.parse(response.body)
34
+ end
35
+
36
+ def poll_job(job_id:)
37
+ attempts = 0
38
+ loop do
39
+ attempts += 1
40
+ if attempts > MAX_POLL_ATTEMPTS
41
+ raise "Render job #{job_id} timed out after #{MAX_POLL_ATTEMPTS * POLL_INTERVAL}s"
42
+ end
43
+
44
+ response = @conn.get("/render-jobs/#{job_id}") do |req|
45
+ req.headers["Authorization"] = "Bearer #{@api_key}"
46
+ end
47
+
48
+ unless response.success?
49
+ raise "Failed to check job status (#{response.status})"
50
+ end
51
+
52
+ job = JSON.parse(response.body)
53
+ status = job.dig("data", "status") || job["status"]
54
+
55
+ case status
56
+ when "Completed"
57
+ return job
58
+ when "Failed"
59
+ error = job.dig("data", "error") || "Unknown error"
60
+ raise "Render job failed: #{error}"
61
+ end
62
+
63
+ sleep(POLL_INTERVAL)
64
+ end
65
+ end
66
+
67
+ def download(url:)
68
+ response = Faraday.get(url)
69
+ unless response.success?
70
+ raise "Failed to download render output (#{response.status})"
71
+ end
72
+ response.body
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,5 @@
1
+ module Fastlane
2
+ module Screenshotslive
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,13 @@
1
+ require "fastlane/plugin/screenshotslive/version"
2
+
3
+ module Fastlane
4
+ module Screenshotslive
5
+ def self.all_classes
6
+ Dir[File.expand_path("**/{actions,helper}/*.rb", File.dirname(__FILE__))]
7
+ end
8
+ end
9
+ end
10
+
11
+ Fastlane::Screenshotslive.all_classes.each do |current|
12
+ require current
13
+ end
metadata ADDED
@@ -0,0 +1,126 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fastlane-plugin-screenshotslive
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Eric Isensee
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: faraday
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '1.0'
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: '3.0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: '1.0'
29
+ - - "<"
30
+ - !ruby/object:Gem::Version
31
+ version: '3.0'
32
+ - !ruby/object:Gem::Dependency
33
+ name: rubyzip
34
+ requirement: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '2.0'
39
+ - - "<"
40
+ - !ruby/object:Gem::Version
41
+ version: '3.0'
42
+ type: :runtime
43
+ prerelease: false
44
+ version_requirements: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '2.0'
49
+ - - "<"
50
+ - !ruby/object:Gem::Version
51
+ version: '3.0'
52
+ - !ruby/object:Gem::Dependency
53
+ name: bundler
54
+ requirement: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ type: :development
60
+ prerelease: false
61
+ version_requirements: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ - !ruby/object:Gem::Dependency
67
+ name: fastlane
68
+ requirement: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: 2.200.0
73
+ type: :development
74
+ prerelease: false
75
+ version_requirements: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: 2.200.0
80
+ - !ruby/object:Gem::Dependency
81
+ name: rspec
82
+ requirement: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ type: :development
88
+ prerelease: false
89
+ version_requirements: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ email: contact@screenshots.live
95
+ executables: []
96
+ extensions: []
97
+ extra_rdoc_files: []
98
+ files:
99
+ - LICENSE
100
+ - README.md
101
+ - lib/fastlane/plugin/screenshotslive.rb
102
+ - lib/fastlane/plugin/screenshotslive/actions/screenshotslive_action.rb
103
+ - lib/fastlane/plugin/screenshotslive/helper/api_client.rb
104
+ - lib/fastlane/plugin/screenshotslive/version.rb
105
+ homepage: https://github.com/screenshots-live/fastlane-plugin-screenshotslive
106
+ licenses:
107
+ - MIT
108
+ metadata: {}
109
+ rdoc_options: []
110
+ require_paths:
111
+ - lib
112
+ required_ruby_version: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: 2.7.0
117
+ required_rubygems_version: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - ">="
120
+ - !ruby/object:Gem::Version
121
+ version: '0'
122
+ requirements: []
123
+ rubygems_version: 3.6.9
124
+ specification_version: 4
125
+ summary: Generate app store screenshots via the Screenshots.live API
126
+ test_files: []