From e61c4fc330fac51bf7e668f4f49ff443bb1ca2df Mon Sep 17 00:00:00 2001 From: 417-72KI <417.72ki@gmail.com> Date: Sun, 1 Sep 2024 11:47:38 +0900 Subject: [PATCH 1/9] update Swift and Xcode versions to latest --- .github/workflows/ci.yml | 24 ++++++++++++------------ .swift-version | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a791fe51..bbb56e8a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,13 +12,13 @@ concurrency: cancel-in-progress: true jobs: - test-on-macos-12: - name: Test on macOS 12 - runs-on: macOS-12 + test-on-macos-14: + name: Test on macOS 14 + runs-on: macOS-14 strategy: fail-fast: false matrix: - xcode: ["13.2.1", "13.4.1", "14.1"] + xcode: ["14.3.1", "15.2", "15.4"] steps: - uses: actions/checkout@v2 @@ -53,11 +53,11 @@ jobs: test-dependencies-resolver: name: Test dependencies resolver - runs-on: macOS-12 + runs-on: macOS-14 strategy: fail-fast: false matrix: - xcode: ["13.2.1", "13.4.1", "14.1"] + xcode: ["14.3.1", "15.2", "15.4"] steps: - uses: actions/checkout@v2 @@ -98,7 +98,7 @@ jobs: strategy: fail-fast: false matrix: - swift: ["5.5.3", "5.6.3", "5.7"] + swift: ["5.8", "5.9", "5.10"] steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 @@ -131,13 +131,13 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - test-without-spm-on-macos-12: - name: Test without SPM on macOS 12 - runs-on: macOS-12 + test-without-spm-on-macos-14: + name: Test without SPM on macOS 14 + runs-on: macOS-14 strategy: fail-fast: false matrix: - xcode: ["13.2.1", "13.4.1", "14.1"] + xcode: ["14.3.1", "15.2", "15.4"] steps: - uses: actions/checkout@v2 @@ -176,7 +176,7 @@ jobs: strategy: fail-fast: false matrix: - swift: ["5.5.3", "5.6.3", "5.7"] + swift: ["5.8", "5.9", "5.10"] steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 diff --git a/.swift-version b/.swift-version index 9ad974f6..f9ce5a96 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -5.5 +5.10 From c7fe1482ae9a4dccee95b71ff21cca141c6a21f4 Mon Sep 17 00:00:00 2001 From: 417-72KI <417.72ki@gmail.com> Date: Sun, 1 Sep 2024 11:49:14 +0900 Subject: [PATCH 2/9] update Ubuntu to 22.04 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bbb56e8a..f35a24a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,7 +94,7 @@ jobs: test-on-linux: name: Test on Linux - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: @@ -172,7 +172,7 @@ jobs: test-without-spm-on-linux: name: Test without SPM on Linux - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: From 43158350055f8e06de8560bcf22aaf18801e5d23 Mon Sep 17 00:00:00 2001 From: 417-72KI <417.72ki@gmail.com> Date: Sat, 31 Aug 2024 10:30:01 +0900 Subject: [PATCH 3/9] update dependencies --- Package.resolved | 49 ++++++++++++++++++++++++++++-------------------- Package.swift | 25 +++++++++++++++--------- 2 files changed, 45 insertions(+), 29 deletions(-) diff --git a/Package.resolved b/Package.resolved index f0bfe94b..b158a80c 100644 --- a/Package.resolved +++ b/Package.resolved @@ -10,6 +10,15 @@ "version": "0.2.0" } }, + { + "package": "CryptoSwift", + "repositoryURL": "https://github.com/krzyzanowskim/CryptoSwift.git", + "state": { + "branch": null, + "revision": "678d442c6f7828def400a70ae15968aef67ef52d", + "version": "1.8.3" + } + }, { "package": "Komondor", "repositoryURL": "https://github.com/shibapm/Komondor", @@ -33,8 +42,8 @@ "repositoryURL": "https://github.com/nerdishbynature/octokit.swift", "state": { "branch": null, - "revision": "f762f1566f7cd0e683b9329f169c28ab6ef993cc", - "version": "0.12.0" + "revision": "44192458beb89180c3a3a1245d904aacac8be0ae", + "version": "0.13.0" } }, { @@ -51,8 +60,8 @@ "repositoryURL": "https://github.com/nerdishbynature/RequestKit.git", "state": { "branch": null, - "revision": "8b0258ea2a4345cbcac90509b764faacea12efb0", - "version": "3.2.1" + "revision": "e4d905fed938807e36d87f28375f88b7c1c26840", + "version": "3.3.0" } }, { @@ -78,8 +87,8 @@ "repositoryURL": "https://github.com/jpsim/SourceKitten.git", "state": { "branch": null, - "revision": "b6dc09ee51dfb0c66e042d2328c017483a1a5d56", - "version": "0.34.1" + "revision": "fd4df99170f5e9d7cf9aa8312aa8506e0e7a44e7", + "version": "0.35.0" } }, { @@ -96,17 +105,17 @@ "repositoryURL": "https://github.com/pointfreeco/swift-snapshot-testing.git", "state": { "branch": null, - "revision": "f29e2014f6230cf7d5138fc899da51c7f513d467", - "version": "1.10.0" + "revision": "6d932a79e7173b275b96c600c86c603cf84f153c", + "version": "1.17.4" } }, { - "package": "SwiftSyntax", - "repositoryURL": "https://github.com/apple/swift-syntax.git", + "package": "swift-syntax", + "repositoryURL": "https://github.com/swiftlang/swift-syntax.git", "state": { "branch": null, - "revision": "013a48e2312e57b7b355db25bd3ea75282ebf274", - "version": "0.50900.0-swift-DEVELOPMENT-SNAPSHOT-2023-02-06-a" + "revision": "515f79b522918f83483068d99c68daeb5116342d", + "version": "600.0.0-prerelease-2024-08-14" } }, { @@ -114,8 +123,8 @@ "repositoryURL": "https://github.com/nicklockwood/SwiftFormat", "state": { "branch": null, - "revision": "7d3682f70f790805ecab81a685b711f6842f4698", - "version": "0.51.1" + "revision": "d6309f7440889427426143b4a0b100b959d3f3e6", + "version": "0.54.3" } }, { @@ -123,8 +132,8 @@ "repositoryURL": "https://github.com/Realm/SwiftLint", "state": { "branch": null, - "revision": "eb85125a5f293de3d3248af259980c98bc2b1faa", - "version": "0.51.0" + "revision": "a24488f26e60247d8fff7bbb03d51910af3dc91c", + "version": "0.56.2" } }, { @@ -150,8 +159,8 @@ "repositoryURL": "https://github.com/drmohundro/SWXMLHash.git", "state": { "branch": null, - "revision": "4d0f62f561458cbe1f732171e625f03195151b60", - "version": "7.0.1" + "revision": "a853604c9e9a83ad9954c7e3d2a565273982471f", + "version": "7.0.2" } }, { @@ -168,8 +177,8 @@ "repositoryURL": "https://github.com/jpsim/Yams", "state": { "branch": null, - "revision": "f47ba4838c30dbd59998a4e4c87ab620ff959e8a", - "version": "5.0.5" + "revision": "3036ba9d69cf1fd04d433527bc339dc0dc75433d", + "version": "5.1.3" } } ] diff --git a/Package.swift b/Package.swift index 47dca284..f09e9450 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.5 +// swift-tools-version:5.8 import PackageDescription @@ -8,10 +8,10 @@ import PackageDescription let isDevelop = true let swiftLint: Package.Dependency = { - #if compiler(>=5.7) - return .package(url: "https://github.com/Realm/SwiftLint", from: "0.51.0") + #if compiler(>=5.9) + return .package(url: "https://github.com/Realm/SwiftLint", from: "0.56.0") #else - return .package(url: "https://github.com/Realm/SwiftLint", .exact("0.48.0")) + return .package(url: "https://github.com/Realm/SwiftLint", exact: "0.53.0") #endif }() @@ -22,10 +22,10 @@ let devProducts: [Product] = isDevelop let devDependencies: [Package.Dependency] = isDevelop ? [ .package(url: "https://github.com/shibapm/Komondor", from: "1.1.4"), - .package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.50.5"), + .package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.54.0"), swiftLint, - .package(url: "https://github.com/pointfreeco/swift-snapshot-testing.git", from: "1.10.0"), - .package(url: "https://github.com/shibapm/Rocket", from: "1.2.1"), + .package(url: "https://github.com/pointfreeco/swift-snapshot-testing.git", from: "1.17.0"), + .package(url: "https://github.com/shibapm/Rocket", from: "1.3.0"), ] : [] let devTargets: [Target] = isDevelop ? [ @@ -59,13 +59,20 @@ let package = Package( dependencies: [ .package(url: "https://github.com/shibapm/Logger", from: "0.1.0"), .package(url: "https://github.com/mxcl/Version", from: "2.0.1"), - .package(name: "OctoKit", url: "https://github.com/nerdishbynature/octokit.swift", from: "0.12.0"), + .package(url: "https://github.com/nerdishbynature/octokit.swift", from: "0.13.0"), ] + devDependencies, targets: [ .target(name: "Danger-Swift", dependencies: ["Danger"]), .target(name: "DangerShellExecutor"), .target(name: "DangerDependenciesResolver", dependencies: ["DangerShellExecutor", "Version", "Logger"]), - .target(name: "Danger", dependencies: ["OctoKit", "Logger", "DangerShellExecutor"]), + .target( + name: "Danger", + dependencies: [ + .product(name: "OctoKit", package: "octokit.swift"), + "Logger", + "DangerShellExecutor" + ] + ), .target(name: "RunnerLib", dependencies: ["Logger", "DangerShellExecutor", "Version"]), .executableTarget(name: "Runner", dependencies: ["RunnerLib", "Logger", "DangerDependenciesResolver"]), .target(name: "DangerFixtures", dependencies: ["Danger"]), From 5a6820a51b15bc43682278c5411ce0503b2204e6 Mon Sep 17 00:00:00 2001 From: 417-72KI <417.72ki@gmail.com> Date: Sun, 1 Sep 2024 12:12:12 +0900 Subject: [PATCH 4/9] add DEVELOPER_DIR to avoid error in `brew install danger-js` --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f35a24a1..d680d8a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,6 +43,8 @@ jobs: - name: Install danger-js run: brew install danger/tap/danger-js + env: + DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer # Avoid Homebrew installation error - run: swift test @@ -82,6 +84,8 @@ jobs: - name: Install danger-js run: brew install danger/tap/danger-js + env: + DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer # Avoid Homebrew installation error - run: make install @@ -162,6 +166,8 @@ jobs: - name: Install danger-js run: brew install danger/tap/danger-js + env: + DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer # Avoid Homebrew installation error - run: make install From f6c7cf67acdd2399b3f7e224d539acde3f5ca82c Mon Sep 17 00:00:00 2001 From: 417-72KI <417.72ki@gmail.com> Date: Sun, 1 Sep 2024 12:46:01 +0900 Subject: [PATCH 5/9] split matrix with whole jobs --- .github/workflows/ci.yml | 89 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 80 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d680d8a9..ee429635 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,13 +12,51 @@ concurrency: cancel-in-progress: true jobs: + test-on-macos-13: + name: Test on macOS 13 + runs-on: macOS-13 + strategy: + fail-fast: false + matrix: + xcode: ["14.3.1"] + steps: + - uses: actions/checkout@v2 + + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: | + .build/artifacts + .build/checkouts + .build/repositories + key: ${{ runner.os }}-dependencies-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }} + restore-keys: | + ${{ runner.os }}-dependencies-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }} + ${{ runner.os }}-dependencies-${{ matrix.xcode }}- + + - name: Select Xcode + run: | + xcodebuild -version + ls -nt /Applications/ | grep "Xcode*" + sudo xcode-select -switch /Applications/Xcode_${{ matrix.xcode }}.app + xcodebuild -version + + - name: Install danger-js + run: brew install danger/tap/danger-js + + - run: swift test + + - run: swift run danger-swift ci --verbose --failOnErrors + if: ${{ github.event_name == 'pull_request' }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} test-on-macos-14: name: Test on macOS 14 runs-on: macOS-14 strategy: fail-fast: false matrix: - xcode: ["14.3.1", "15.2", "15.4"] + xcode: ["15.2", "15.4"] steps: - uses: actions/checkout@v2 @@ -43,8 +81,6 @@ jobs: - name: Install danger-js run: brew install danger/tap/danger-js - env: - DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer # Avoid Homebrew installation error - run: swift test @@ -59,7 +95,7 @@ jobs: strategy: fail-fast: false matrix: - xcode: ["14.3.1", "15.2", "15.4"] + xcode: ["15.2", "15.4"] steps: - uses: actions/checkout@v2 @@ -84,8 +120,6 @@ jobs: - name: Install danger-js run: brew install danger/tap/danger-js - env: - DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer # Avoid Homebrew installation error - run: make install @@ -135,13 +169,52 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + test-without-spm-on-macos-13: + name: Test without SPM on macOS 13 + runs-on: macOS-13 + strategy: + fail-fast: false + matrix: + xcode: ["14.3.1"] + steps: + - uses: actions/checkout@v2 + + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: | + .build/artifacts + .build/checkouts + .build/repositories + key: ${{ runner.os }}-without-spm-package-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }} + restore-keys: | + ${{ runner.os }}-without-spm-package-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }} + ${{ runner.os }}-without-spm-package-${{ matrix.xcode }}- + + - name: Select Xcode + run: | + xcodebuild -version + ls -nt /Applications/ | grep "Xcode*" + sudo xcode-select -switch /Applications/Xcode_${{ matrix.xcode }}.app + xcodebuild -version + + - name: Install danger-js + run: brew install danger/tap/danger-js + + - run: sudo make install + + - run: danger-swift ci --verbose --failOnErrors + if: ${{ github.event_name == 'pull_request' }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + test-without-spm-on-macos-14: name: Test without SPM on macOS 14 runs-on: macOS-14 strategy: fail-fast: false matrix: - xcode: ["14.3.1", "15.2", "15.4"] + xcode: ["15.2", "15.4"] steps: - uses: actions/checkout@v2 @@ -166,8 +239,6 @@ jobs: - name: Install danger-js run: brew install danger/tap/danger-js - env: - DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer # Avoid Homebrew installation error - run: make install From b8663dc85e792d1affb5d9ecd55b1d463d77e6d6 Mon Sep 17 00:00:00 2001 From: 417-72KI <417.72ki@gmail.com> Date: Sun, 1 Sep 2024 12:54:46 +0900 Subject: [PATCH 6/9] fix with new URL initializer --- .../InlineDependenciesFinder.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Sources/DangerDependenciesResolver/InlineDependenciesFinder.swift b/Sources/DangerDependenciesResolver/InlineDependenciesFinder.swift index c537bbfb..9c721fc9 100644 --- a/Sources/DangerDependenciesResolver/InlineDependenciesFinder.swift +++ b/Sources/DangerDependenciesResolver/InlineDependenciesFinder.swift @@ -29,7 +29,15 @@ struct InlineDependenciesFinder { .trimmingCharacters(in: .whitespaces) .components(separatedBy: " " + config.majorVersionPrefix) - guard let url = URL(string: splittedImportString[0]) else { + let url: URL? = { + #if os(macOS) && compiler(>=5.9) + if #available(macOS 14.0, *) { + return URL(string: splittedImportString[0], encodingInvalidCharacters: false) + } + #endif + return URL(string: splittedImportString[0]) + }() + guard let url = url else { throw Errors.invalidInlineDependencyURL(splittedImportString[0]) } From 87caf5b3b34cd8c7d31721c6bd2ded941772d4a5 Mon Sep 17 00:00:00 2001 From: 417-72KI <417.72ki@gmail.com> Date: Sun, 1 Sep 2024 12:17:41 +0900 Subject: [PATCH 7/9] avoid `mkdir: /usr/local/lib: Permission denied` in macOS-14 runner --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee429635..0ceb7819 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -121,7 +121,7 @@ jobs: - name: Install danger-js run: brew install danger/tap/danger-js - - run: make install + - run: make install PREFIX='/opt/homebrew' - run: mkdir DangerTestWithDependencies && mv DangerfileWithDependencies.swift DangerTestWithDependencies/Dangerfile.swift @@ -201,7 +201,7 @@ jobs: - name: Install danger-js run: brew install danger/tap/danger-js - - run: sudo make install + - run: make install - run: danger-swift ci --verbose --failOnErrors if: ${{ github.event_name == 'pull_request' }} @@ -240,7 +240,7 @@ jobs: - name: Install danger-js run: brew install danger/tap/danger-js - - run: make install + - run: make install PREFIX='/opt/homebrew' - run: danger-swift ci --verbose --failOnErrors if: ${{ github.event_name == 'pull_request' }} From 4764165aeec95a6a6ef38b52748502cf5204f8a1 Mon Sep 17 00:00:00 2001 From: 417-72KI <417.72ki@gmail.com> Date: Sun, 1 Sep 2024 13:50:07 +0900 Subject: [PATCH 8/9] update requirements --- README.md | 3 ++- Scripts/create_homebrew_tap.sh | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ee27097c..5d778020 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,13 @@ Write your Dangerfiles in Swift. ### Requirements -Latest version requires Swift 5.5 +Latest version requires Swift 5.8 If you are using an older Swift, use the supported version according to next table. | Swift version | Danger support version | | ------------- | ---------------------- | +| 5.5-5.7 | v3.18.1 | | 5.4 | v3.15.0 | | 5.3 | v3.13.0 | | 5.2 | v3.11.1 | diff --git a/Scripts/create_homebrew_tap.sh b/Scripts/create_homebrew_tap.sh index 3eb20d6c..e68e1998 100755 --- a/Scripts/create_homebrew_tap.sh +++ b/Scripts/create_homebrew_tap.sh @@ -30,8 +30,8 @@ echo " url \"https://github.com/danger/danger-swift/archive/#{version}.tar.gz\" echo " sha256 \"${SHA}\"" >> danger-swift.rb echo " head \"https://github.com/danger/danger-swift.git\"" >> danger-swift.rb echo >> danger-swift.rb -echo " # Runs only on Xcode 12" >> danger-swift.rb -echo " depends_on :xcode => [\"12\", :build]" >> danger-swift.rb +echo " # Runs only on Xcode 14" >> danger-swift.rb +echo " depends_on :xcode => [\"14\", :build]" >> danger-swift.rb echo " # Use the vendored danger" >> danger-swift.rb echo " depends_on \"danger/tap/danger-js\"" >> danger-swift.rb echo >> danger-swift.rb From 8260ca02c8695b19ce39eb8c485e76efa15da3f2 Mon Sep 17 00:00:00 2001 From: 417-72KI <417.72ki@gmail.com> Date: Sun, 1 Sep 2024 13:53:14 +0900 Subject: [PATCH 9/9] update CHANGELOG --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e684ddb..0132ff51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ ## Master +- Drop Swift 5.7 [@417-72KI][] - [#620](https://github.com/danger/swift/pull/620) +- Fix pattern for detecting SwiftLint in package [@417-72KI][] - [#616](https://github.com/danger/swift/pull/616) + ## 3.18.1 - Update Node version to 18.x [@hasanabuzayed][] - [#607](https://github.com/danger/swift/pull/607)