Skip to content

Commit a780c79

Browse files
committed
Update icon, logo and scripts
1 parent bdf6362 commit a780c79

31 files changed

+766
-233
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: actions/checkout@v3
1717
- uses: maxim-lobanov/setup-xcode@v1
1818
with:
19-
xcode-version: '16.0'
19+
xcode-version: latest-stable
2020
- name: Build all platforms
2121
run: bash scripts/build.sh ${{ github.event.repository.name }}
2222
- name: Test iOS

.github/workflows/docc.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ jobs:
3434
- name: Select Xcode version
3535
uses: maxim-lobanov/setup-xcode@v1
3636
with:
37-
xcode-version: '16.0'
37+
xcode-version: latest-stable
3838
- name: Build DocC
3939
run: bash scripts/docc.sh ${{ github.event.repository.name }}
4040
- name: Upload artifact
4141
uses: actions/upload-pages-artifact@v3
4242
with:
43-
path: '.build/docs'
43+
path: '.build/docs-iOS'
4444
- id: deployment
4545
name: Deploy to GitHub Pages
4646
uses: actions/deploy-pages@v4

README.md

+10-15
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
11
<p align="center">
2-
<img src ="Resources/Logo_Rounded.png" alt="TagKit Logo" title="TagKit" />
2+
<img src="Resources/Icon.png" alt="Project Icon" width="250" />
33
</p>
44

55
<p align="center">
66
<img src="https://img.shields.io/github/v/release/danielsaidi/TagKit?color=%2300550&sort=semver" alt="Version" />
77
<img src="https://img.shields.io/badge/Swift-5.9-orange.svg" alt="Swift 5.9" />
88
<img src="https://img.shields.io/badge/platform-SwiftUI-blue.svg" alt="Swift UI" title="Swift UI" />
9+
<a href="https://danielsaidi.github.io/TagKit"><img src="https://img.shields.io/badge/documentation-web-blue.svg" alt="Documentation" /></a>
910
<img src="https://img.shields.io/github/license/danielsaidi/TagKit" alt="MIT License" />
10-
<a href="https://twitter.com/danielsaidi">
11-
<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" />
12-
</a>
13-
<a href="https://mastodon.social/@danielsaidi">
14-
<img src="https://img.shields.io/mastodon/follow/000253346?label=mastodon&style=social" alt="Mastodon: @[email protected]" title="Mastodon: @[email protected]" />
15-
</a>
1611
</p>
1712

1813

1914

20-
## About TagKit
15+
# TagKit
2116

2217
TagKit is a Swift SDK that makes it easy to work with tags and string/ID slugification in `Swift` and `SwiftUI`.
2318

@@ -67,9 +62,9 @@ Your support makes it possible for me to put more work into these projects and m
6762
Feel free to reach out if you have questions or if you want to contribute in any way:
6863

6964
* Website: [danielsaidi.com][Website]
70-
* Mastodon: [@danielsaidi@mastodon.social][Mastodon]
71-
* Twitter: [@danielsaidi][Twitter]
7265
* E-mail: [[email protected]][Email]
66+
* Bluesky: [@danielsaidi@bsky.social][Bluesky]
67+
* Mastodon: [@danielsaidi@mastodon.social][Mastodon]
7368

7469

7570

@@ -80,15 +75,15 @@ TagKit is available under the MIT license. See the [LICENSE][License] file for m
8075

8176

8277
[Email]: mailto:[email protected]
83-
84-
[Website]: https://www.danielsaidi.com
78+
[Website]: https://danielsaidi.com
8579
[GitHub]: https://github.com/danielsaidi
86-
[Twitter]: https://twitter.com/danielsaidi
87-
[Mastodon]: https://mastodon.social/@danielsaidi
8880
[OpenSource]: https://danielsaidi.com/opensource
8981
[Sponsors]: https://github.com/sponsors/danielsaidi
9082

83+
[Bluesky]: https://bsky.app/profile/danielsaidi.bsky.social
84+
[Mastodon]: https://mastodon.social/@danielsaidi
85+
[Twitter]: https://twitter.com/danielsaidi
86+
9187
[Documentation]: https://danielsaidi.github.io/TagKit
9288
[Getting-Started]: https://danielsaidi.github.io/TagKit/documentation/tagkit/getting-started
93-
9489
[License]: https://github.com/danielsaidi/TagKit/blob/master/LICENSE

Resources/Icon-ios.png

-89.2 KB
Binary file not shown.

Resources/Icon-macos.png

-81.2 KB
Binary file not shown.

Resources/Icon.png

30.7 KB
Loading

Resources/Logo.png

-102 KB
Binary file not shown.

Resources/Logo_Rounded.png

-101 KB
Binary file not shown.
126 KB
Loading

package_version.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
# Documentation:
4+
# This script creates a new project version for the current project.
5+
# You can customize this to fit your project when you copy these scripts.
6+
# You can pass in a custom branch if you don't want to use the default one.
7+
8+
SCRIPT="scripts/package_version.sh"
9+
chmod +x $SCRIPT
10+
bash $SCRIPT

scripts/build.sh

+41-21
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,67 @@
11
#!/bin/bash
22

33
# Documentation:
4-
# This script builds a <TARGET> for all supported platforms.
4+
# This script builds a <TARGET> for all provided <PLATFORMS>.
5+
# This script targets iOS, macOS, tvOS, watchOS, and xrOS by default.
6+
# You can pass in a list of <PLATFORMS> if you want to customize the build.
7+
8+
# Usage:
9+
# build.sh <TARGET> [<PLATFORMS> default:iOS macOS tvOS watchOS xrOS]
10+
# e.g. `bash scripts/build.sh MyTarget iOS macOS`
511

612
# Exit immediately if a command exits with a non-zero status
713
set -e
814

915
# Verify that all required arguments are provided
1016
if [ $# -eq 0 ]; then
11-
echo "Error: This script requires exactly one argument"
12-
echo "Usage: $0 <TARGET>"
17+
echo "Error: This script requires at least one argument"
18+
echo "Usage: $0 <TARGET> [<PLATFORMS> default:iOS macOS tvOS watchOS xrOS]"
19+
echo "For instance: $0 MyTarget iOS macOS"
1320
exit 1
1421
fi
1522

16-
# Create local argument variables.
23+
# Define argument variables
1724
TARGET=$1
1825

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"
26+
# Remove TARGET from arguments list
27+
shift
2228

23-
# Make the script executable
24-
chmod +x $SCRIPT
29+
# Define platforms variable
30+
if [ $# -eq 0 ]; then
31+
set -- iOS macOS tvOS watchOS xrOS
32+
fi
33+
PLATFORMS=$@
2534

26-
# A function that builds a specific platform
35+
# A function that builds $TARGET for a specific platform
2736
build_platform() {
28-
local platform=$1
29-
echo "Building for $platform..."
30-
if ! bash $SCRIPT $TARGET $platform; then
31-
echo "Failed to build $platform"
37+
38+
# Define a local $PLATFORM variable
39+
local PLATFORM=$1
40+
41+
# Build $TARGET for the $PLATFORM
42+
echo "Building $TARGET for $PLATFORM..."
43+
if ! xcodebuild -scheme $TARGET -derivedDataPath .build -destination generic/platform=$PLATFORM; then
44+
echo "Failed to build $TARGET for $PLATFORM"
3245
return 1
3346
fi
34-
echo "Successfully built $platform"
47+
48+
# Complete successfully
49+
echo "Successfully built $TARGET for $PLATFORM"
3550
}
3651

37-
# Array of platforms to build
38-
platforms=("iOS" "macOS" "tvOS" "watchOS" "xrOS")
52+
# Start script
53+
echo ""
54+
echo "Building $TARGET for [$PLATFORMS]..."
55+
echo ""
3956

40-
# Loop through platforms and build
41-
for platform in "${platforms[@]}"; do
42-
if ! build_platform "$platform"; then
57+
# Loop through all platforms and call the build function
58+
for PLATFORM in $PLATFORMS; do
59+
if ! build_platform "$PLATFORM"; then
4360
exit 1
4461
fi
4562
done
4663

47-
echo "All platforms built successfully!"
64+
# Complete successfully
65+
echo ""
66+
echo "Building $TARGET completed successfully!"
67+
echo ""

scripts/build_platform.sh

-16
This file was deleted.

scripts/chmod.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
# Documentation:
4+
# This script makes all scripts in this folder executable.
5+
6+
# Usage:
7+
# scripts_chmod.sh
8+
# e.g. `bash scripts/chmod.sh`
9+
10+
# Exit immediately if a command exits with a non-zero status
11+
set -e
12+
13+
# Use the script folder to refer to other scripts.
14+
FOLDER="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
15+
16+
# Find all .sh files in the FOLDER except chmod.sh
17+
find "$FOLDER" -name "*.sh" ! -name "chmod.sh" -type f | while read -r script; do
18+
chmod +x "$script"
19+
done

scripts/docc.sh

100644100755
+96-10
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,112 @@
11
#!/bin/bash
22

33
# Documentation:
4-
# This script build DocC for a <TARGET>.
5-
# The documentation ends up in to .build/docs.
4+
# This script builds DocC for a <TARGET> and certain <PLATFORMS>.
5+
# This script targets iOS, macOS, tvOS, watchOS, and xrOS by default.
6+
# You can pass in a list of <PLATFORMS> if you want to customize the build.
7+
# The documentation ends up in to .build/docs-<PLATFORM>.
8+
9+
# Usage:
10+
# docc.sh <TARGET> [<PLATFORMS> default:iOS macOS tvOS watchOS xrOS]
11+
# e.g. `bash scripts/docc.sh MyTarget iOS macOS`
12+
13+
# Exit immediately if a command exits with a non-zero status
14+
set -e
15+
16+
# Fail if any command in a pipeline fails
17+
set -o pipefail
618

719
# Verify that all required arguments are provided
820
if [ $# -eq 0 ]; then
9-
echo "Error: This script requires exactly one argument"
10-
echo "Usage: $0 <TARGET>"
21+
echo "Error: This script requires at least one argument"
22+
echo "Usage: $0 <TARGET> [<PLATFORMS> default:iOS macOS tvOS watchOS xrOS]"
23+
echo "For instance: $0 MyTarget iOS macOS"
1124
exit 1
1225
fi
1326

27+
# Define argument variables
1428
TARGET=$1
1529
TARGET_LOWERCASED=$(echo "$1" | tr '[:upper:]' '[:lower:]')
1630

31+
# Remove TARGET from arguments list
32+
shift
33+
34+
# Define platforms variable
35+
if [ $# -eq 0 ]; then
36+
set -- iOS macOS tvOS watchOS xrOS
37+
fi
38+
PLATFORMS=$@
39+
40+
# Prepare the package for DocC
1741
swift package resolve;
1842

19-
xcodebuild docbuild -scheme $1 -derivedDataPath /tmp/docbuild -destination 'generic/platform=iOS';
43+
# A function that builds $TARGET for a specific platform
44+
build_platform() {
45+
46+
# Define a local $PLATFORM variable and set an exit code
47+
local PLATFORM=$1
48+
local EXIT_CODE=0
49+
50+
# Define the build folder name, based on the $PLATFORM
51+
case $PLATFORM in
52+
"iOS")
53+
DEBUG_PATH="Debug-iphoneos"
54+
;;
55+
"macOS")
56+
DEBUG_PATH="Debug"
57+
;;
58+
"tvOS")
59+
DEBUG_PATH="Debug-appletvos"
60+
;;
61+
"watchOS")
62+
DEBUG_PATH="Debug-watchos"
63+
;;
64+
"xrOS")
65+
DEBUG_PATH="Debug-xros"
66+
;;
67+
*)
68+
echo "Error: Unsupported platform '$PLATFORM'"
69+
exit 1
70+
;;
71+
esac
72+
73+
# Build $TARGET docs for the $PLATFORM
74+
echo "Building $TARGET docs for $PLATFORM..."
75+
if ! xcodebuild docbuild -scheme $TARGET -derivedDataPath .build/docbuild -destination "generic/platform=$PLATFORM"; then
76+
echo "Error: Failed to build documentation for $PLATFORM" >&2
77+
return 1
78+
fi
79+
80+
# Transform docs for static hosting
81+
if ! $(xcrun --find docc) process-archive \
82+
transform-for-static-hosting .build/docbuild/Build/Products/$DEBUG_PATH/$TARGET.doccarchive \
83+
--output-path .build/docs-$PLATFORM \
84+
--hosting-base-path "$TARGET"; then
85+
echo "Error: Failed to transform documentation for $PLATFORM" >&2
86+
return 1
87+
fi
88+
89+
# Inject a root redirect script on the root page
90+
echo "<script>window.location.href += \"/documentation/$TARGET_LOWERCASED\"</script>" > .build/docs-$PLATFORM/index.html;
91+
92+
# Complete successfully
93+
echo "Successfully built $TARGET docs for $PLATFORM"
94+
return 0
95+
}
96+
97+
# Start script
98+
echo ""
99+
echo "Building $TARGET docs for [$PLATFORMS]..."
100+
echo ""
20101

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";
102+
# Loop through all platforms and call the build function
103+
for PLATFORM in $PLATFORMS; do
104+
if ! build_platform "$PLATFORM"; then
105+
exit 1
106+
fi
107+
done
25108

26-
echo "<script>window.location.href += \"/documentation/$TARGET_LOWERCASED\"</script>" > .build/docs/index.html;
109+
# Complete successfully
110+
echo ""
111+
echo "Building $TARGET docs completed successfully!"
112+
echo ""

0 commit comments

Comments
 (0)