Skip to content

Commit d2cd4a4

Browse files
committed
Add release workflow
1 parent e79efc8 commit d2cd4a4

File tree

5 files changed

+45
-8
lines changed

5 files changed

+45
-8
lines changed

.github/workflows/release.yml.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- v*.*.*
7+
8+
jobs:
9+
release:
10+
runs-on: macos-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Build executable for release
15+
run: swift build -c release --arch arm64 --arch x86_64 --product swift-pd-guess
16+
- name: Compress archive
17+
run: tar -czf swift-pd-guess-${{ github.ref_name }}.tar.gz -C .build/apple/Products/Release swift-pd-guess
18+
- name: Release
19+
uses: softprops/action-gh-release@v1
20+
with:
21+
files: ${{ github.ref_name }}.tar.gz
22+
token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ DerivedData/
66
.swiftpm/configuration/registries.json
77
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
88
.netrc
9+
.vscode/

Package.swift

+4-7
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import PackageDescription
66
let package = Package(
77
name: "swift-pd-guess",
88
platforms: [.macOS(.v15)],
9+
products: [
10+
.executable(name: "swift-pd-guess", targets: ["swift-pd-guess"]),
11+
],
912
dependencies: [
1013
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.2.0"),
1114
.package(url: "https://github.com/apple/swift-algorithms", from: "1.2.0"),
@@ -16,17 +19,11 @@ let package = Package(
1619
dependencies: [
1720
.product(name: "ArgumentParser", package: "swift-argument-parser"),
1821
.product(name: "Algorithms", package: "swift-algorithms"),
19-
],
20-
swiftSettings: [
21-
.swiftLanguageMode(.v5),
2222
]
2323
),
2424
.testTarget(
2525
name: "swift-pd-guess-tests",
26-
dependencies: ["swift-pd-guess"],
27-
swiftSettings: [
28-
.swiftLanguageMode(.v5),
29-
]
26+
dependencies: ["swift-pd-guess"]
3027
),
3128
]
3229
)

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# swift-pd-guess
2+
3+
Try to guess the file name from a private discriminator of a private Swift symbol.
4+
5+
## Example
6+
7+
See Example/README.md for detail.
8+
9+
## Usgae
10+
11+
```shell
12+
swift-pd-guess <hash> <words> --prefix <prefix> [--suffix <suffix>] [--max-count <max-count>]
13+
```
14+
15+
## License
16+
17+
MIT. See LICENSE for detail.

Sources/PDGuess.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import CryptoKit
1212

1313
@main
1414
struct PDGuess: AsyncParsableCommand {
15-
static var configuration: CommandConfiguration = CommandConfiguration(commandName: "swift-pd-guess")
15+
static let configuration: CommandConfiguration = CommandConfiguration(commandName: "swift-pd-guess")
1616

1717
@Argument(help: "MD5 hash value (private-discriminator) to search for")
1818
var hash: String

0 commit comments

Comments
 (0)