Skip to content
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
10 changes: 7 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
3 changes: 0 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
10 changes: 0 additions & 10 deletions Sources/SwiftFindRefs/SwiftFindRefs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}()
}
1 change: 1 addition & 0 deletions Sources/SwiftFindRefs/Version.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let version = "1.0.2"
2 changes: 1 addition & 1 deletion Tests/SwiftFindRefs/SwiftFindRefsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
File renamed without changes.
2 changes: 1 addition & 1 deletion swiftfindrefs.rb
Original file line number Diff line number Diff line change
@@ -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"
Expand Down