Merge branch 'main' of https://github.com/hiddify/hiddify-next-core
This commit is contained in:
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -86,7 +86,7 @@ jobs:
|
||||
- name: Calculate SHA256 Checksum
|
||||
if: startsWith(matrix.job.target,'ios')
|
||||
run: |
|
||||
sha256sum hiddify-libcore-ios.xcframework.zip > hiddify-libcore-ios.xcframework.zip.sha256
|
||||
sha256sum hiddify-libcore-ios.xcframework.zip | awk '{print $1}'> hiddify-libcore-ios.xcframework.zip.sha256
|
||||
working-directory: bin
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: ${{ success() }}
|
||||
|
||||
Binary file not shown.
@@ -12,11 +12,16 @@
|
||||
<key>hiddify-next-core-Package.xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
<integer>1</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>SuppressBuildableAutocreation</key>
|
||||
<dict>
|
||||
<key>Libcore</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>hiddify-next-core</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
|
||||
@@ -2,46 +2,30 @@
|
||||
// The swift-tools-version declares the minimum version of Swift required to build this package.
|
||||
|
||||
import PackageDescription
|
||||
|
||||
func fetchChecksum(from url: String) throws -> String {
|
||||
guard let checksumURL = URL(string: url) else {
|
||||
throw NSError(domain: "Invalid URL", code: 0, userInfo: nil)
|
||||
}
|
||||
|
||||
let checksumString = try String(contentsOf: checksumURL)
|
||||
return checksumString.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
}
|
||||
import Foundation
|
||||
|
||||
let version = "draft"
|
||||
let baseURL = "https://github.com/hiddify/hiddify-next-core/releases/download/"
|
||||
let packageURL = "\(baseURL)\(version)/hiddify-libcore-ios.xcframework.zip"
|
||||
let checksumURL = "\(packageURL).sha256"
|
||||
let packageURL = baseURL + version + "/hiddify-libcore-ios.xcframework.zip"
|
||||
|
||||
do {
|
||||
let package = Package(
|
||||
name: "Libcore",
|
||||
platforms: [
|
||||
.iOS(.v13) // Minimum platform version
|
||||
],
|
||||
products: [
|
||||
.library(
|
||||
name: "Libcore",
|
||||
targets: ["Libcore"]),
|
||||
],
|
||||
dependencies: [
|
||||
// No dependencies
|
||||
],
|
||||
targets: [
|
||||
.binaryTarget(
|
||||
name: "Libcore",
|
||||
url: packageURL,
|
||||
checksum: try fetchChecksum(from: checksumURL)
|
||||
)
|
||||
]
|
||||
)
|
||||
} catch {
|
||||
// Handle URL or checksum fetch errors
|
||||
print("Error: \(error)")
|
||||
// You might want to exit or handle the error in a way suitable for your application
|
||||
// exit(1)
|
||||
}
|
||||
let package = Package(
|
||||
name: "Libcore",
|
||||
platforms: [
|
||||
.iOS(.v13) // Minimum platform version
|
||||
],
|
||||
products: [
|
||||
.library(
|
||||
name: "Libcore",
|
||||
targets: ["Libcore"]),
|
||||
],
|
||||
dependencies: [
|
||||
// No dependencies
|
||||
],
|
||||
targets: [
|
||||
.binaryTarget(
|
||||
name: "Libcore",
|
||||
url: packageURL,
|
||||
checksum: "e42d176d32198bc33ae4f8aafa24814934bbc93cbc8747aa8a0353e8341dc3ff"
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user