Skip to content

Commit bdeea3c

Browse files
committed
Replace Fastlane with Shell scripts
1 parent c68f899 commit bdeea3c

17 files changed

+399
-114
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: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,16 @@ on:
88
branches: ["main"]
99
pull_request:
1010
branches: ["main"]
11-
12-
env:
13-
SCHEME: TagKit
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: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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 TagKit -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/TagKit.doccarchive \
46-
--output-path docs \
47-
--hosting-base-path 'TagKit';
48-
49-
echo "<script>window.location.href += \"/documentation/tagkit\"</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

.gitignore

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
1-
# SPM defaults
21
.DS_Store
32
/.build
43
/Packages
54
.swiftpm/
6-
7-
# Documentation
8-
Docs
9-
documentation
10-
downloads
11-
videos
12-
13-
# Fastlane
14-
Fastlane/report.xml
15-
Fastlane/Preview.html
16-
Fastlane/screenshots
17-
Fastlane/test_output
18-
Fastlane/README.md
5+
xcuserdata/
6+
DerivedData/

Fastlane/Fastfile

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

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)