Skip to content

Commit fb9fe0a

Browse files
committed
Replace Fastlane with Shell scripts
1 parent 9c17c9c commit fb9fe0a

19 files changed

+579
-62
lines changed

.github/FUNDING.yml

-12
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

+5-16
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: StoreKitPlus
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

+5-16
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 StoreKitPlus -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/StoreKitPlus.doccarchive \
46-
--output-path docs \
47-
--hosting-base-path 'StoreKitPlus';
48-
49-
echo "<script>window.location.href += \"/documentation/storekitplus\"</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

+2-14
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/README.md

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
fastlane documentation
2+
----
3+
4+
# Installation
5+
6+
Make sure you have the latest version of the Xcode command line tools installed:
7+
8+
```sh
9+
xcode-select --install
10+
```
11+
12+
For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane)
13+
14+
# Available Actions
15+
16+
## iOS
17+
18+
### ios build
19+
20+
```sh
21+
[bundle exec] fastlane ios build
22+
```
23+
24+
25+
26+
### ios test_ios
27+
28+
```sh
29+
[bundle exec] fastlane ios test_ios
30+
```
31+
32+
33+
34+
### ios version
35+
36+
```sh
37+
[bundle exec] fastlane ios version
38+
```
39+
40+
Create a new version
41+
42+
### ios version_validate
43+
44+
```sh
45+
[bundle exec] fastlane ios version_validate
46+
```
47+
48+
Validate that the repo is valid for release
49+
50+
----
51+
52+
This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.
53+
54+
More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools).
55+
56+
The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools).

Fastlane/report.xml

+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<testsuites>
3+
<testsuite name="fastlane.lanes">
4+
5+
6+
7+
8+
<testcase classname="fastlane.lanes" name="00: Verifying fastlane version" time="0.000254">
9+
10+
</testcase>
11+
12+
13+
<testcase classname="fastlane.lanes" name="01: default_platform" time="0.000142">
14+
15+
</testcase>
16+
17+
18+
<testcase classname="fastlane.lanes" name="02: Switch to ios version_validate lane" time="9.4e-05">
19+
20+
</testcase>
21+
22+
23+
<testcase classname="fastlane.lanes" name="03: ensure_git_status_clean" time="0.014565">
24+
25+
</testcase>
26+
27+
28+
<testcase classname="fastlane.lanes" name="04: ensure_git_branch" time="0.011527">
29+
30+
</testcase>
31+
32+
33+
<testcase classname="fastlane.lanes" name="05: swiftlint" time="1.327149">
34+
35+
</testcase>
36+
37+
38+
<testcase classname="fastlane.lanes" name="06: Switch to ios build lane" time="0.000115">
39+
40+
</testcase>
41+
42+
43+
<testcase classname="fastlane.lanes" name="07: cd .. &amp;&amp; xcodebuild -scheme StoreKitPlus -derivedDataPath .build -destination &apos;generic/platform=iOS&apos;;" time="4.300415">
44+
45+
</testcase>
46+
47+
48+
<testcase classname="fastlane.lanes" name="08: Switch to ios build lane" time="0.000162">
49+
50+
</testcase>
51+
52+
53+
<testcase classname="fastlane.lanes" name="09: cd .. &amp;&amp; xcodebuild -scheme StoreKitPlus -derivedDataPath .build -destination &apos;generic/platform=OS X&apos;;" time="5.610943">
54+
55+
</testcase>
56+
57+
58+
<testcase classname="fastlane.lanes" name="10: Switch to ios build lane" time="0.000373">
59+
60+
</testcase>
61+
62+
63+
<testcase classname="fastlane.lanes" name="11: cd .. &amp;&amp; xcodebuild -scheme StoreKitPlus -derivedDataPath .build -destination &apos;generic/platform=tvOS&apos;;" time="3.067526">
64+
65+
</testcase>
66+
67+
68+
<testcase classname="fastlane.lanes" name="12: Switch to ios build lane" time="0.000143">
69+
70+
</testcase>
71+
72+
73+
<testcase classname="fastlane.lanes" name="13: cd .. &amp;&amp; xcodebuild -scheme StoreKitPlus -derivedDataPath .build -destination &apos;generic/platform=watchOS&apos;;" time="3.35889">
74+
75+
</testcase>
76+
77+
78+
<testcase classname="fastlane.lanes" name="14: Switch to ios build lane" time="0.000117">
79+
80+
</testcase>
81+
82+
83+
<testcase classname="fastlane.lanes" name="15: cd .. &amp;&amp; xcodebuild -scheme StoreKitPlus -derivedDataPath .build -destination &apos;generic/platform=xrOS&apos;;" time="3.554889">
84+
85+
</testcase>
86+
87+
88+
<testcase classname="fastlane.lanes" name="16: Switch to ios test_ios lane" time="0.000128">
89+
90+
</testcase>
91+
92+
93+
<testcase classname="fastlane.lanes" name="17: cd .. &amp;&amp; xcodebuild test -scheme StoreKitPlus -derivedDataPath .build -destination &apos;platform=iOS Simulator,name=iPhone 15,OS=17.2&apos; -enableCodeCoverage YES;" time="138.676759">
94+
95+
</testcase>
96+
97+
98+
<testcase classname="fastlane.lanes" name="18: version_bump_podspec" time="0.001153">
99+
100+
</testcase>
101+
102+
103+
<testcase classname="fastlane.lanes" name="19: git_commit" time="0.030672">
104+
105+
</testcase>
106+
107+
108+
<testcase classname="fastlane.lanes" name="20: add_git_tag" time="0.025366">
109+
110+
</testcase>
111+
112+
113+
<testcase classname="fastlane.lanes" name="21: push_git_tags" time="1.72002">
114+
115+
</testcase>
116+
117+
118+
<testcase classname="fastlane.lanes" name="22: push_to_git_remote" time="1.69903">
119+
120+
</testcase>
121+
122+
</testsuite>
123+
</testsuites>

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 Daniel Saidi
3+
Copyright (c) 2022-2024 Daniel Saidi
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Version

-3
This file was deleted.

scripts/build.sh

+47
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

+16
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

+26
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;

0 commit comments

Comments
 (0)