From 251d7b77b091241dfec421fff9634bbdad436e77 Mon Sep 17 00:00:00 2001 From: Konstantinos Nikoloutsos Date: Thu, 29 Jan 2026 01:28:28 +0200 Subject: [PATCH] Fix bundle not found on 1.0.2 --- .github/workflows/release.yml | 10 +++++++--- Package.swift | 3 --- Sources/SwiftFindRefs/SwiftFindRefs.swift | 10 ---------- Sources/SwiftFindRefs/Version.swift | 1 + Tests/SwiftFindRefs/SwiftFindRefsTests.swift | 2 +- Sources/SwiftFindRefs/VERSION => VERSION | 0 swiftfindrefs.rb | 2 +- 7 files changed, 10 insertions(+), 18 deletions(-) create mode 100644 Sources/SwiftFindRefs/Version.swift rename Sources/SwiftFindRefs/VERSION => VERSION (100%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b04c956..a8a82ae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,7 +30,7 @@ jobs: id: version run: | # Read version from VERSION file - CURRENT=$(cat Sources/SwiftFindRefs/VERSION | tr -d '\n') + CURRENT=$(cat VERSION | tr -d '\n') echo "Current version: $CURRENT" # Parse version components @@ -54,13 +54,17 @@ jobs: - name: Update VERSION file run: | - echo "${{ steps.version.outputs.new }}" > Sources/SwiftFindRefs/VERSION + echo "${{ steps.version.outputs.new }}" > VERSION + + - name: Update Version.swift + run: | + echo 'let version = "${{ steps.version.outputs.new }}"' > Sources/SwiftFindRefs/Version.swift - name: Commit version bump run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - git add Sources/SwiftFindRefs/VERSION + git add VERSION Sources/SwiftFindRefs/Version.swift git commit -m "bump up version" git push diff --git a/Package.swift b/Package.swift index 97e309f..ff22f70 100644 --- a/Package.swift +++ b/Package.swift @@ -16,9 +16,6 @@ let package = Package( dependencies: [ .product(name: "ArgumentParser", package: "swift-argument-parser"), .product(name: "IndexStore", package: "swift-index-store"), - ], - resources: [ - .copy("VERSION") ] ), .testTarget( diff --git a/Sources/SwiftFindRefs/SwiftFindRefs.swift b/Sources/SwiftFindRefs/SwiftFindRefs.swift index ffd790f..d88e91b 100644 --- a/Sources/SwiftFindRefs/SwiftFindRefs.swift +++ b/Sources/SwiftFindRefs/SwiftFindRefs.swift @@ -105,13 +105,3 @@ extension SwiftFindRefs { } } } - -extension SwiftFindRefs { - static let version: String = { - guard let url = Bundle.module.url(forResource: "VERSION", withExtension: nil), - let content = try? String(contentsOf: url, encoding: .utf8) else { - return "unknown" - } - return content.trimmingCharacters(in: .whitespacesAndNewlines) - }() -} diff --git a/Sources/SwiftFindRefs/Version.swift b/Sources/SwiftFindRefs/Version.swift new file mode 100644 index 0000000..0951025 --- /dev/null +++ b/Sources/SwiftFindRefs/Version.swift @@ -0,0 +1 @@ +let version = "1.0.2" diff --git a/Tests/SwiftFindRefs/SwiftFindRefsTests.swift b/Tests/SwiftFindRefs/SwiftFindRefsTests.swift index d2d16a9..379ae3b 100644 --- a/Tests/SwiftFindRefs/SwiftFindRefsTests.swift +++ b/Tests/SwiftFindRefs/SwiftFindRefsTests.swift @@ -5,6 +5,6 @@ import Testing struct SwiftFindRefsTests { @Test func `Verify CLI version uses VERSION file`() { - #expect(SwiftFindRefs.configuration.version == SwiftFindRefs.version) + #expect(SwiftFindRefs.configuration.version == version) } } diff --git a/Sources/SwiftFindRefs/VERSION b/VERSION similarity index 100% rename from Sources/SwiftFindRefs/VERSION rename to VERSION diff --git a/swiftfindrefs.rb b/swiftfindrefs.rb index 3a5a4d9..256d1a9 100644 --- a/swiftfindrefs.rb +++ b/swiftfindrefs.rb @@ -1,7 +1,7 @@ # Version is managed by the VERSION file - do not edit manually # Run the Release workflow to bump version automatically class Swiftfindrefs < Formula - APP_VERSION = File.read(File.join(__dir__, "Sources/SwiftFindRefs/VERSION")).strip.freeze + APP_VERSION = File.read(File.join(__dir__, "VERSION")).strip.freeze desc "SwiftFindRefs is a macOS Swift CLI that resolves a project's DerivedData, reads Xcode's IndexStore, and reports every file referencing a chosen symbol, with optional verbose tracing for diagnostics." homepage "https://github.com/michaelversus/SwiftFindRefs"