Skip to content

Commit 8caf1b2

Browse files
committed
chore: clean up Fastfile
Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
1 parent 409ffe8 commit 8caf1b2

File tree

2 files changed

+24
-45
lines changed

2 files changed

+24
-45
lines changed

DesignToolbox/fastlane/Fastfile

Lines changed: 24 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ require 'json'
2424

2525
# TestFlight
2626
# Configuration for App Store Connect API (https://appstoreconnect.apple.com/access/integrations/api)
27-
# OUDS_APPLE_ISSUER_ID = Issuer identifier (unique to group)
27+
# OUDS_APPLE_ISSUER_ID = issuer identifier (unique to group)
2828
# OUDS_APPLE_KEY_ID = key identifier (for the app)
2929
# OUDS_APPLE_KEY_CONTENT = private key associated to the key identifier
3030
APPLE_ISSUER_ID = ENV["OUDS_APPLE_ISSUER_ID"]
@@ -47,10 +47,14 @@ MATTERMOST_HOOK_BOT_ICON_URL = ENV["OUDS_MATTERMOST_HOOK_BOT_ICON_URL"]
4747
# GitHub
4848
# ------
4949

50-
# Repository of OUDS iOS
51-
GITHUB_ORG_REPO = "Orange-OpenSource/ouds-ios"
50+
# Repository of OUDS iOS library
51+
GITHUB_ORG_LIB_REPO = "Orange-OpenSource/ouds-ios"
5252

53-
# Fine grained personal access token with enough permissions for the suitable GitHub project
53+
# Repository of OUDS iOS Design System Toolbox app
54+
GITHUB_ORG_APP_REPO = "Orange-OpenSource/ouds-ios-design-system-toolbox"
55+
56+
# Fine grained personal access token with enough permissions for the suitable GitHub projects
57+
# Must be configured for both GITHUB_ORG_LIB_REPO and GITHUB_ORG_APP_REPO
5458
GITHUB_ACCESS_TOKEN = ENV['GITHUB_ACCESS_TOKEN']
5559

5660
# Project configuration
@@ -59,12 +63,17 @@ GITHUB_ACCESS_TOKEN = ENV['GITHUB_ACCESS_TOKEN']
5963
OUDS_WORKSPACE = "DesignToolbox.xcworkspace"
6064
OUDS_PROJECT = "DesignToolbox.xcodeproj"
6165
OUDS_SCHEME = "DesignToolbox"
62-
OUDS_TEST_SCHEME = "DesignToolbox"
66+
OUDS_TARGET = "DesignToolbox"
6367
OUDS_SNAPSHOTS_SNAPSHOTS_TEST_SCHEME = "DesignToolboxSnapshotsTests"
6468
OUDS_SNAPSHOTS_UI_TEST_SCHEME = "DesignToolboxUITests"
6569
OUDS_PROJECT_NAME = "DesignToolbox" # Root for Info.plist, etc.
6670
OUDS_APP_DISPLAY_NAME = "Design System Toolbox"
6771

72+
# Devices configuration
73+
# ---------------------
74+
75+
OUDS_SNAPSHOTS_TEST_DEVICE = "iPhone 16 Pro (18.0)"
76+
6877
# Lanes
6978
# ------
7079

@@ -86,7 +95,7 @@ platform :ios do
8695
lane :check_dead_code do
8796
puts "👉 Check dead code with Periphery"
8897

89-
sh "periphery scan --strict --workspace ../DesignToolbox.xcworkspace --schemes DesignToolbox --targets DesignToolbox --format xcode"
98+
sh "periphery scan --strict --workspace ../#{OUDS_WORKSPACE} --schemes #{OUDS_SCHEME} --targets #{OUDS_TARGET} --format xcode"
9099
end
91100

92101
# ------------------------------------------------------------
@@ -116,9 +125,8 @@ platform :ios do
116125
# Check the available devices using `xcrun xctrace list devices`
117126
# Add new environments using `xcodebuild -downloadPlatform iOS`
118127
begin
119-
device = "iPhone 16 Pro (18.0)"
120128
scan(scheme: OUDS_SNAPSHOTS_SNAPSHOTS_TEST_SCHEME,
121-
device: device,
129+
device: OUDS_SNAPSHOTS_TEST_DEVICE,
122130
skip_build: true
123131
)
124132

@@ -148,9 +156,8 @@ platform :ios do
148156
# Check the available devices using `xcrun xctrace list devices`
149157
# Add new environments using `xcodebuild -downloadPlatform iOS`
150158
begin
151-
device = "iPhone 16 Pro (18.0)"
152159
scan(scheme: OUDS_SNAPSHOTS_UI_TEST_SCHEME,
153-
device: device,
160+
device: OUDS_SNAPSHOTS_TEST_DEVICE,
154161
skip_build: true
155162
)
156163

@@ -169,25 +176,6 @@ platform :ios do
169176
end
170177
end
171178

172-
# ------------------------------------------------------------
173-
# READ AND SET NEXT RELEASE NOTE IN CHANGELOG
174-
# ------------------------------------------------------------
175-
# TODO Maybe this lane should be removed or updated if we have several changelogs or if we use git-cliff
176-
desc "READ AND SET NEXT RELEASE NOTE IN CHANGELOG"
177-
lane :prepare_release do
178-
puts "👉 Prepare release"
179-
180-
version = get_app_version
181-
182-
stamp_changelog(
183-
changelog_path: '../CHANGELOG.md',
184-
section_identifier: version,
185-
git_tag: version,
186-
should_stamp_date: true,
187-
stamp_datetime_format: '%F'
188-
)
189-
end
190-
191179
# ------------------------------------------------------------
192180
# BUILD DEBUG APP
193181
# ------------------------------------------------------------
@@ -421,9 +409,9 @@ platform :ios do
421409
issues_numbers = params[:issues_numbers]
422410
puts "ℹ️ Upload type: '#{uploadType}'"
423411
if uploadType == "alpha"
424-
news = "Warning: this is alpha build for issues '#{issues_numbers}'\n\n" + read_current_release_notes # Add details about build type in changelog for TestFlight
412+
news = "⚠️ Warning: this is alpha build for issues '#{issues_numbers}'\n\n" + read_current_release_notes # Add details about build type in changelog for TestFlight
425413
else
426-
news = "Warning: this is #{uploadType} build\n\n" + read_current_release_notes # Add details about build type in changelog for TestFlight
414+
news = "ℹ️ #{uploadType} build\n\n" + read_current_release_notes # Add details about build type in changelog for TestFlight
427415
end
428416
end
429417

@@ -535,7 +523,7 @@ platform :ios do
535523
tag = "#{prefix}/" + commitHash[0,7]
536524
puts "ℹ️ Check if '#{tag}' exists yet"
537525

538-
uri = URI("https://api.github.com/repos/#{GITHUB_ORG_REPO}/tags")
526+
uri = URI("https://api.github.com/repos/#{GITHUB_ORG_APP_REPO}/tags")
539527
http = Net::HTTP.new(uri.host, uri.port)
540528
http.use_ssl = true
541529

@@ -555,7 +543,7 @@ platform :ios do
555543
else
556544
puts "ℹ️ Commit SHA to tag is '#{commitHash}'"
557545

558-
uri = URI("https://api.github.com/repos/#{GITHUB_ORG_REPO}/git/refs")
546+
uri = URI("https://api.github.com/repos/#{GITHUB_ORG_APP_REPO}/git/refs")
559547
http = Net::HTTP.new(uri.host, uri.port)
560548
http.use_ssl = true
561549

@@ -600,7 +588,7 @@ platform :ios do
600588
build_issues_numbers = build_details.scan(/\d+/).map(&:to_i)
601589

602590
build_issues_numbers.each do |issue_number|
603-
uri = URI("https://api.github.com/repos/#{GITHUB_ORG_REPO}/issues/#{issue_number}")
591+
uri = URI("https://api.github.com/repos/#{GITHUB_ORG_LIB_REPO}/issues/#{issue_number}")
604592
response = Net::HTTP.get(uri)
605593
issue = JSON.parse(response)
606594

@@ -626,17 +614,16 @@ Please, get the new build from *TestFlight* app, or contact the project maintain
626614
@ludovic35 - Ludovic PINEL - iOS developer, OUDS iOS maintainer
627615
@MaximeTonnerre - Maxime TONNERRE - lead designer
628616
@mccart77 - Stephen McCARTHY - designer
629-
@iassab - Iman Assabah - designer
630617
@TonyAntonyHello - Anton ASTAFEV - designer
631618
-->
632619
cc @B3nz01d (product owner)
633620
cc @pylapp @ludovic35 (dev team)
634-
cc @MaximeTonnerre @mccart77 @iassab @TonyAntonyHello (design team)
621+
cc @MaximeTonnerre @mccart77 @TonyAntonyHello (design team)
635622
636623
_This is an automated message sent with love thanks to *Fastlane* from our CI/CD pipeline 🤘_
637624
EOF
638625

639-
uri = URI("https://api.github.com/repos/#{GITHUB_ORG_REPO}/issues/#{issue_number}/comments")
626+
uri = URI("https://api.github.com/repos/#{GITHUB_ORG_LIB_REPO}/issues/#{issue_number}/comments")
640627
http = Net::HTTP.new(uri.host, uri.port)
641628
http.use_ssl = true
642629

DesignToolbox/fastlane/README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,6 @@ RUN SNAPSHOTS TESTS BY TRIGGERING THE TESTS PLANS OF THE PROJECT
4747

4848
RUN UI TESTS BY TRIGGERING THE TESTS PLANS OF THE PROJECT
4949

50-
### ios prepare_release
51-
52-
```sh
53-
[bundle exec] fastlane ios prepare_release
54-
```
55-
56-
READ AND SET NEXT RELEASE NOTE IN CHANGELOG
57-
5850
### ios buildDebugApp
5951

6052
```sh

0 commit comments

Comments
 (0)