Skip to content

Commit a6111cb

Browse files
committed
Replace Fastlane with Shell scripts
1 parent e177ea9 commit a6111cb

17 files changed

+403
-119
lines changed

.github/FUNDING.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1 @@
1-
# These are supported funding model platforms
2-
31
github: [danielsaidi]
4-
patreon: # Replace with a single Patreon username
5-
open_collective: # Replace with a single Open Collective username
6-
ko_fi: # Replace with a single Ko-fi username
7-
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8-
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9-
liberapay: # Replace with a single Liberapay username
10-
issuehunt: # Replace with a single IssueHunt username
11-
otechie: # Replace with a single Otechie username
12-
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
13-
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/workflows/build.yml

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,19 @@ name: Build Runner
55

66
on:
77
push:
8-
branches: ["master"]
8+
branches: ["main"]
99
pull_request:
10-
branches: ["master"]
11-
12-
env:
13-
SCHEME: SwiftUIKit
10+
branches: ["main"]
1411

1512
jobs:
1613
build:
17-
runs-on: macos-13
14+
runs-on: macos-15
1815
steps:
1916
- uses: actions/checkout@v3
2017
- uses: maxim-lobanov/setup-xcode@v1
2118
with:
22-
xcode-version: '15.1.0'
23-
- name: Build iOS
24-
run: xcodebuild -scheme $SCHEME -derivedDataPath .build -destination 'generic/platform=iOS';
25-
- name: Build macOS
26-
run: xcodebuild -scheme $SCHEME -derivedDataPath .build -destination 'generic/platform=OS X';
27-
- name: Build tvOS
28-
run: xcodebuild -scheme $SCHEME -derivedDataPath .build -destination 'generic/platform=tvOS';
29-
- name: Build watchOS
30-
run: xcodebuild -scheme $SCHEME -derivedDataPath .build -destination 'generic/platform=watchOS';
31-
- name: Build visionOS
32-
run: xcodebuild -scheme $SCHEME -derivedDataPath .build -destination 'generic/platform=xrOS';
19+
xcode-version: '16.0'
20+
- name: Build all platforms
21+
run: bash scripts/build.sh ${{ github.event.repository.name }}
3322
- name: Test iOS
34-
run: xcodebuild test -scheme $SCHEME -derivedDataPath .build -destination 'platform=iOS Simulator,name=iPhone 15,OS=17.2' -enableCodeCoverage YES;
23+
run: bash scripts/test.sh ${{ github.event.repository.name }}

.github/workflows/docc.yml

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name: DocC Runner
66

77
on:
88
push:
9-
branches: ["master"]
9+
branches: ["main"]
1010

1111
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1212
permissions:
@@ -24,34 +24,23 @@ jobs:
2424
environment:
2525
name: github-pages
2626
url: ${{ steps.deployment.outputs.page_url }}
27-
runs-on: macos-13
27+
runs-on: macos-15
2828
steps:
2929
- name: Checkout
3030
uses: actions/checkout@v3
3131
- id: pages
3232
name: Setup Pages
3333
uses: actions/configure-pages@v4
34-
- name: Select Xcode 15.1
34+
- name: Select Xcode version
3535
uses: maxim-lobanov/setup-xcode@v1
3636
with:
37-
xcode-version: '15.1.0'
37+
xcode-version: '16.0'
3838
- name: Build DocC
39-
run: |
40-
swift package resolve;
41-
42-
xcodebuild docbuild -scheme SwiftUIKit -derivedDataPath /tmp/docbuild -destination 'generic/platform=iOS';
43-
44-
$(xcrun --find docc) process-archive \
45-
transform-for-static-hosting /tmp/docbuild/Build/Products/Debug-iphoneos/SwiftUIKit.doccarchive \
46-
--output-path docs \
47-
--hosting-base-path 'SwiftUIKit';
48-
49-
echo "<script>window.location.href += \"/documentation/swiftuikit\"</script>" > docs/index.html;
50-
39+
run: bash scripts/docc.sh ${{ github.event.repository.name }}
5140
- name: Upload artifact
5241
uses: actions/upload-pages-artifact@v3
5342
with:
54-
path: 'docs'
43+
path: '.build/docs'
5544
- id: deployment
5645
name: Deploy to GitHub Pages
5746
uses: actions/deploy-pages@v4

Fastlane/Fastfile

Lines changed: 0 additions & 62 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<p align="center">
66
<img src="https://img.shields.io/github/v/release/danielsaidi/SwiftUIKit?color=%2300550&sort=semver" alt="Version" />
7-
<img src="https://img.shields.io/badge/Swift-5.9-orange.svg" alt="Swift 5.9" />
7+
<img src="https://img.shields.io/badge/Swift-6.0-orange.svg" alt="Swift 6.0" />
88
<img src="https://img.shields.io/badge/platform-SwiftUI-blue.svg" alt="Swift UI" title="Swift UI" />
99
<img src="https://img.shields.io/github/license/danielsaidi/SwiftUIKit" alt="MIT License" />
1010
<a href="https://twitter.com/danielsaidi"><img src="https://img.shields.io/twitter/url?label=Twitter&style=social&url=https%3A%2F%2Ftwitter.com%2Fdanielsaidi" alt="Twitter: @danielsaidi" title="Twitter: @danielsaidi" /></a>
@@ -33,13 +33,9 @@ https://github.com/danielsaidi/SwiftUIKit.git
3333

3434
## Getting Started
3535

36-
SwiftUIKit started as a small project, but has grown pretty huge over the years.
36+
SwiftUIKit started as a small project, but has grown big over the years. Due to its complexity, I have decided to remove the demo. Instead, have a look at the various namespaces and use the live previews to explore the SDK.
3737

38-
Due to its complexity, I have decided to remove the demo. Instead, have a look at the various namespaces and use the live previews to explore the components in the SDK.
39-
40-
I will therefore extract parts of this SDK into separate libraries, to be able to provide better documentation & help.
41-
42-
For more Swift & SwiftUI SDKs that I have created, please have a look at [my open-source listing page][OpenSource].
38+
I will extract parts of this SDK into separate libraries, to be able to provide better documentation & help. Have a look at [my open-source listing page][OpenSource] for some of these.
4339

4440

4541

Version

Lines changed: 0 additions & 3 deletions
This file was deleted.

scripts/build.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
3+
# Documentation:
4+
# This script builds a <TARGET> for all supported platforms.
5+
6+
# Exit immediately if a command exits with a non-zero status
7+
set -e
8+
9+
# Verify that all required arguments are provided
10+
if [ $# -eq 0 ]; then
11+
echo "Error: This script requires exactly one argument"
12+
echo "Usage: $0 <TARGET>"
13+
exit 1
14+
fi
15+
16+
# Create local argument variables.
17+
TARGET=$1
18+
19+
# Use the script folder to refer to other scripts.
20+
FOLDER="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
21+
SCRIPT="$FOLDER/build_platform.sh"
22+
23+
# Make the script executable
24+
chmod +x $SCRIPT
25+
26+
# A function that builds a specific platform
27+
build_platform() {
28+
local platform=$1
29+
echo "Building for $platform..."
30+
if ! bash $SCRIPT $TARGET $platform; then
31+
echo "Failed to build $platform"
32+
return 1
33+
fi
34+
echo "Successfully built $platform"
35+
}
36+
37+
# Array of platforms to build
38+
platforms=("iOS" "macOS" "tvOS" "watchOS" "xrOS")
39+
40+
# Loop through platforms and build
41+
for platform in "${platforms[@]}"; do
42+
if ! build_platform "$platform"; then
43+
exit 1
44+
fi
45+
done
46+
47+
echo "All platforms built successfully!"

scripts/build_platform.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
# Documentation:
4+
# This script builds a <TARGET> for a specific <PLATFORM>.
5+
6+
# Verify that all required arguments are provided
7+
if [ $# -ne 2 ]; then
8+
echo "Error: This script requires exactly two arguments"
9+
echo "Usage: $0 <TARGET> <PLATFORM>"
10+
exit 1
11+
fi
12+
13+
TARGET=$1
14+
PLATFORM=$2
15+
16+
xcodebuild -scheme $TARGET -derivedDataPath .build -destination generic/platform=$PLATFORM

scripts/docc.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
# Documentation:
4+
# This script build DocC for a <TARGET>.
5+
# The documentation ends up in to .build/docs.
6+
7+
# Verify that all required arguments are provided
8+
if [ $# -eq 0 ]; then
9+
echo "Error: This script requires exactly one argument"
10+
echo "Usage: $0 <TARGET>"
11+
exit 1
12+
fi
13+
14+
TARGET=$1
15+
TARGET_LOWERCASED=$(echo "$1" | tr '[:upper:]' '[:lower:]')
16+
17+
swift package resolve;
18+
19+
xcodebuild docbuild -scheme $1 -derivedDataPath /tmp/docbuild -destination 'generic/platform=iOS';
20+
21+
$(xcrun --find docc) process-archive \
22+
transform-for-static-hosting /tmp/docbuild/Build/Products/Debug-iphoneos/$1.doccarchive \
23+
--output-path .build/docs \
24+
--hosting-base-path "$TARGET";
25+
26+
echo "<script>window.location.href += \"/documentation/$TARGET_LOWERCASED\"</script>" > .build/docs/index.html;

scripts/test.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
3+
# Documentation:
4+
# This script tests a <TARGET> for all supported platforms.
5+
6+
# Exit immediately if a command exits with a non-zero status
7+
set -e
8+
9+
# Verify that all required arguments are provided
10+
if [ $# -eq 0 ]; then
11+
echo "Error: This script requires exactly one argument"
12+
echo "Usage: $0 <TARGET>"
13+
exit 1
14+
fi
15+
16+
# Create local argument variables.
17+
TARGET=$1
18+
19+
# Use the script folder to refer to other scripts.
20+
FOLDER="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
21+
SCRIPT="$FOLDER/test_platform.sh"
22+
23+
# Make the script executable
24+
chmod +x $SCRIPT
25+
26+
# A function that tests a specific platform
27+
test_platform() {
28+
local platform=$1
29+
echo "Testing for $platform..."
30+
if ! bash $SCRIPT $TARGET $platform; then
31+
echo "Failed to test $platform"
32+
return 1
33+
fi
34+
echo "Successfully tested $platform"
35+
}
36+
37+
# Array of platforms to test
38+
platforms=("platform=iOS_Simulator,name=iPhone_16")
39+
40+
# Loop through platforms and build
41+
for platform in "${platforms[@]}"; do
42+
if ! test_platform "$platform"; then
43+
exit 1
44+
fi
45+
done
46+
47+
echo "All platforms tested successfully!"

0 commit comments

Comments
 (0)