From b8094c314f9d56ae48033176d6ef99d46566aedb Mon Sep 17 00:00:00 2001 From: Keyan Zhang <2268452+keyz@users.noreply.github.com> Date: Sun, 1 Dec 2024 23:31:03 -0800 Subject: [PATCH 1/2] upgrade to swift 6 --- .swift-version | 2 +- Sources/ComicSans/ComicSans.swift | 2 +- Sources/CommandLineTool/cs.swift | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.swift-version b/.swift-version index 509b0b6..9b9a244 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -5.10.0 +6.0.2 diff --git a/Sources/ComicSans/ComicSans.swift b/Sources/ComicSans/ComicSans.swift index 3fa022c..3531b5d 100644 --- a/Sources/ComicSans/ComicSans.swift +++ b/Sources/ComicSans/ComicSans.swift @@ -69,7 +69,7 @@ public struct ComicSans { return result.isEmpty ? nil : result } - @MainActor public func pngRepresentation(scale: Int = 2) -> Data? { + @MainActor public func pngRepresentation(scale: Int = 2) async -> Data? { let renderer = ImageRenderer(content: view) renderer.scale = CGFloat(scale) diff --git a/Sources/CommandLineTool/cs.swift b/Sources/CommandLineTool/cs.swift index aa76e3a..a7916a5 100644 --- a/Sources/CommandLineTool/cs.swift +++ b/Sources/CommandLineTool/cs.swift @@ -57,7 +57,7 @@ struct CommandLineTool: ParsableCommand { } } - @MainActor mutating func run() throws { + @MainActor mutating func run() async throws { let text = try isExpectingPipe ? parsePipeInput() : text let result = ComicSans( @@ -72,7 +72,7 @@ struct CommandLineTool: ParsableCommand { fileExtension: "png" ) - guard let pngData = result.pngRepresentation() else { + guard let pngData = await result.pngRepresentation() else { throw ExitCode.failure } From b72dcf57827f816c14236dc5eb293e7f33460b12 Mon Sep 17 00:00:00 2001 From: Keyan Zhang <2268452+keyz@users.noreply.github.com> Date: Sun, 1 Dec 2024 23:36:35 -0800 Subject: [PATCH 2/2] bump tooling --- .github/workflows/build.yml | 2 +- Package.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d4bd22f..dfb6c26 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: - name: Set up Swift uses: swift-actions/setup-swift@3aed395c5397f62deb91d8fe7af1418a9ae4d16f # v2.1.0 with: - swift-version: "5.10.0" + swift-version: "6.0.2" - name: Checkout uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 diff --git a/Package.swift b/Package.swift index 7b9e4b3..824cef9 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.10 +// swift-tools-version: 6.0 import PackageDescription