Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

old Swift version tests #57

Merged
merged 7 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@ on: push

jobs:
build:


strategy:
matrix:
swift: ["5.9", "5.10"]

runs-on: macos-latest

steps:
- uses: swift-actions/setup-swift@v2
with:
swift-version: ${{ matrix.swift }}
- uses: actions/checkout@v2
- name: Build
run: swift build -v
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.5
// swift-tools-version:5.8
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand Down
4 changes: 4 additions & 0 deletions Sources/YouTubeKit/Extensions/URLSessionDelegates.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ final class ConfigurableURLSessionDelegate: NSObject, URLSessionTaskDelegate {
let applyCookiesOnRedirect: Bool
let saveIntermediateResponses: Bool

#if swift(>=5.10)
nonisolated(unsafe) var intermediateResponses = [HTTPURLResponse]()
#else
var intermediateResponses = [HTTPURLResponse]()
#endif

init(allowsRedirect: Bool, applyCookiesOnRedirect: Bool, saveIntermediateResponses: Bool) {
self.allowsRedirects = allowsRedirect
Expand Down
5 changes: 5 additions & 0 deletions Sources/YouTubeKit/YouTube.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ public class YouTube {
private var _js: String?
private var _jsURL: URL?

#if swift(>=5.10)
nonisolated(unsafe) private static var __js: String? // caches js between calls
nonisolated(unsafe) private static var __jsURL: URL?
#else
private static var __js: String? // caches js between calls
private static var __jsURL: URL?
#endif

private var _videoInfos: [InnerTube.VideoInfo]?

Expand Down
Loading