Skip to content

Commit 0f80374

Browse files
Apply standard Swift package configuration (#916)
* Apply standard Swift package configuration * Do not treat DocC warnings as errors * Upgrade SwiftLint in quick start project * Use Nimble v14.0.0 in quick start project * Find SwiftLint in macOS directory only * Use https Nodes URL * Fix URL * Use https Nodes URL * Use https Nodes URL * Remove extraneous step from genesis workflow * Always remove `@MainActor`
1 parent ce6cd8a commit 0f80374

32 files changed

+438
-678
lines changed

.github/workflows/docc.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ on:
77
branches: [ main ]
88

99
env:
10-
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
10+
DEVELOPER_DIR: /Applications/Xcode_26.3.app/Contents/Developer
1111

1212
jobs:
1313
docc:
1414
name: DocC
1515
runs-on: macos-latest
16+
permissions:
17+
contents: read
1618
steps:
1719
- name: Checkout source
18-
uses: actions/checkout@v4
20+
uses: actions/checkout@v6
1921
- name: Build
2022
run: make docs open="no" DERIVED_DATA_PATH="$(mktemp -d)"

.github/workflows/genesis.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,23 @@ on:
77
branches: [ main ]
88

99
env:
10-
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
10+
DEVELOPER_DIR: /Applications/Xcode_26.3.app/Contents/Developer
1111

1212
jobs:
1313
genesis:
1414
name: Genesis
1515
runs-on: macos-latest
16+
permissions:
17+
contents: read
1618
env:
17-
SIMULATOR: iPhone 15
19+
SIMULATOR: iPhone 17
1820
steps:
1921
- name: Install dependencies
2022
run: |
2123
brew install mint xcodegen needle mockolo
2224
mint install yonaskolb/genesis
2325
- name: Checkout source
24-
uses: actions/checkout@v4
26+
uses: actions/checkout@v6
2527
- name: Create temporary directory
2628
id: mktemp
2729
run: echo "directory=$(mktemp -d)" >> "$GITHUB_OUTPUT"
@@ -33,16 +35,13 @@ jobs:
3335
- name: Generate Xcode project
3436
working-directory: ${{ steps.mktemp.outputs.directory }}
3537
run: xcodegen
36-
- name: Remove @MainActor
37-
working-directory: ${{ steps.mktemp.outputs.directory }}
38-
run: find "Tinder/Sources" -type f -name "*.swift" -exec sed -i '' '/@MainActor/,+0d' {} \;
3938
- name: Download swiftlint binary
4039
working-directory: ${{ steps.mktemp.outputs.directory }}
4140
run: swift package resolve
4241
- name: Lint
4342
working-directory: ${{ steps.mktemp.outputs.directory }}
4443
run: >
45-
"$(find ".build/artifacts/swiftlint" -type f -name swiftlint -perm +111 -print -quit)"
44+
"$(find ".build/artifacts/swiftlint" -path "*macos*" -type f -name swiftlint -perm +111 -print -quit)"
4645
lint --strict --reporter github-actions-logging
4746
- name: Resolve package dependencies
4847
working-directory: ${{ steps.mktemp.outputs.directory }}

.github/workflows/lint.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,20 @@ on:
77
branches: [ main ]
88

99
env:
10-
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
10+
DEVELOPER_DIR: /Applications/Xcode_26.3.app/Contents/Developer
1111

1212
jobs:
1313
lint:
1414
name: Lint
1515
runs-on: macos-latest
16+
permissions:
17+
contents: read
1618
steps:
1719
- name: Checkout source
18-
uses: actions/checkout@v4
20+
uses: actions/checkout@v6
1921
- name: Download swiftlint binary
2022
run: swift package resolve
2123
- name: Lint
2224
run: >
23-
"$(find ".build/artifacts/swiftlint" -type f -name swiftlint -perm +111 -print -quit)"
25+
"$(find ".build/artifacts/swiftlint" -path "*macos*" -type f -name swiftlint -perm +111 -print -quit)"
2426
lint --strict --reporter github-actions-logging

.github/workflows/pages.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@ on:
55
tags: ['[0-9]+.[0-9]+.[0-9]+']
66

77
env:
8-
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
9-
10-
permissions:
11-
contents: read
12-
pages: write
13-
id-token: write
8+
DEVELOPER_DIR: /Applications/Xcode_26.3.app/Contents/Developer
149

1510
concurrency:
1611
group: "pages"
@@ -23,9 +18,13 @@ jobs:
2318
name: github-pages
2419
url: ${{ steps.deployment.outputs.page_url }}
2520
runs-on: macos-latest
21+
permissions:
22+
contents: read
23+
pages: write
24+
id-token: write
2625
steps:
2726
- name: Checkout source
28-
uses: actions/checkout@v4
27+
uses: actions/checkout@v6
2928
- name: Configure pages
3029
uses: actions/configure-pages@v5
3130
- name: Build documentation

.github/workflows/swift.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@ on:
77
branches: [ main ]
88

99
env:
10-
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
10+
DEVELOPER_DIR: /Applications/Xcode_26.3.app/Contents/Developer
1111

1212
jobs:
1313
swift:
1414
name: Swift
1515
runs-on: macos-latest
16+
permissions:
17+
contents: read
1618
steps:
1719
- name: Checkout source
18-
uses: actions/checkout@v4
20+
uses: actions/checkout@v6
1921
- name: Build
2022
run: swift build -v
2123
- name: Test

.github/workflows/xcode.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,19 @@ on:
77
branches: [ main ]
88

99
env:
10-
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
10+
DEVELOPER_DIR: /Applications/Xcode_26.3.app/Contents/Developer
1111

1212
jobs:
1313
xcode:
1414
name: Xcode
1515
runs-on: macos-latest
16+
permissions:
17+
contents: read
1618
env:
17-
SIMULATOR: iPhone 15
19+
SIMULATOR: iPhone 17
1820
steps:
1921
- name: Checkout source
20-
uses: actions/checkout@v4
22+
uses: actions/checkout@v6
2123
- name: Resolve package dependencies
2224
run: xcodebuild -resolvePackageDependencies
2325
- name: Build

.swiftlint-rules.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ only_rules:
99
- accessibility_label_for_image
1010
- accessibility_trait_for_button
1111
- anonymous_argument_in_multiline_closure
12-
- anyobject_protocol
1312
- array_init
13+
- async_without_await
14+
- attribute_name_spacing
1415
# - attributes
1516
- balanced_xctest_lifecycle
1617
- blanket_disable_command
@@ -94,7 +95,6 @@ only_rules:
9495
- implicitly_unwrapped_optional
9596
- inclusive_language
9697
# - indentation_width
97-
- inert_defer
9898
- invalid_swiftlint_command
9999
- is_disjoint
100100
- joined_default_parameter
@@ -145,6 +145,7 @@ only_rules:
145145
- opening_brace
146146
- operator_usage_whitespace
147147
- operator_whitespace
148+
- optional_data_string_conversion
148149
- optional_enum_case_matching
149150
- orphaned_doc_comment
150151
- overridden_super_call
@@ -155,6 +156,7 @@ only_rules:
155156
- prefer_nimble
156157
- prefer_self_in_static_references
157158
- prefer_self_type_over_type_of_self
159+
- prefer_type_checking
158160
- prefer_zero_over_explicit_init
159161
# - prefixed_toplevel_constant
160162
- private_action
@@ -177,6 +179,7 @@ only_rules:
177179
- redundant_objc_attribute
178180
- redundant_optional_initialization
179181
- redundant_self_in_closure
182+
- redundant_sendable
180183
- redundant_set_access_control
181184
# - redundant_string_enum_value
182185
- redundant_type_annotation
@@ -224,7 +227,6 @@ only_rules:
224227
- unneeded_synthesized_initializer
225228
- unowned_variable_capture
226229
- untyped_error_in_catch
227-
- unused_capture_list
228230
- unused_closure_parameter
229231
- unused_control_flow_label
230232
- unused_enumerated

Makefile

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,3 @@
1-
.PHONY: release
2-
release: override library = Nodes
3-
release: override platforms = macos catalyst ios tvos watchos
4-
release: override bitcode = DISABLED
5-
release:
6-
@make xcframework library="$(library)" platforms="$(platforms)" bitcode="$(bitcode)" version="$(version)"
7-
8-
.PHONY: xcframework
9-
xcframework: library ?= $(shell make get-libraries | head -1)
10-
xcframework: platforms ?= $(shell make get-platforms)
11-
xcframework:
12-
ifndef version
13-
$(error required variable: "version")
14-
endif
15-
ifeq ($(strip $(bitcode)),ENABLED)
16-
@./bin/create-xcframework "$(library)" "$(platforms)" BITCODE_ENABLED "$(version)"
17-
else
18-
@./bin/create-xcframework "$(library)" "$(platforms)" BITCODE_DISABLED "$(version)"
19-
endif
20-
211
.PHONY: open
222
open: fix
233
open:
@@ -81,19 +61,13 @@ docs:
8161
-scheme "$(target)" \
8262
-destination "$(destination)" \
8363
-derivedDataPath "$(DERIVED_DATA_PATH)" \
84-
-skipPackagePluginValidation \
85-
OTHER_DOCC_FLAGS="--warnings-as-errors"
64+
-skipPackagePluginValidation
8665
@find "$(DERIVED_DATA_PATH)" \
8766
-type d \
8867
-name "$(target).doccarchive" \
8968
-exec cp -R {} "$(ARCHIVE_PATH)/" \;
9069
$(if $(filter $(open),OPEN),@open "$(ARCHIVE_PATH)/$(target).doccarchive",)
9170

92-
.PHONY: preview
93-
preview: target ?= Nodes
94-
preview:
95-
swift package --disable-sandbox preview-documentation --target "$(target)"
96-
9771
.PHONY: site
9872
site: target ?= Nodes
9973
site: prefix ?= $(shell pwd)
@@ -108,18 +82,3 @@ site:
10882
--output-path "$(prefix)/_site"
10983
cp docs.html "$(prefix)/_site/index.html"
11084
cp docs.html "$(prefix)/_site/documentation/index.html"
111-
112-
.PHONY: get-libraries
113-
get-libraries:
114-
@./bin/get-libraries
115-
116-
.PHONY: get-platforms
117-
get-platforms:
118-
@./bin/get-platforms
119-
120-
.PHONY: get-deployment-target
121-
get-deployment-target:
122-
ifndef platform
123-
$(error required variable: "platform")
124-
endif
125-
@./bin/get-deployment-target "$(platform)"

0 commit comments

Comments
 (0)