Skip to content

Commit

Permalink
fix: checksum of SPM.
Browse files Browse the repository at this point in the history
  • Loading branch information
rashadatjou committed Aug 22, 2023
1 parent 5924240 commit 558250e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion FlowplayerSDK/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let package = Package(
.binaryTarget(
name: "FlowplayerSDK",
url: "https://github.com/flowplayer/apple-sdk-releases/releases/download/\(version)/FlowplayerSDK.zip",
checksum: "8d2a99256f69155101c0520ffbe692e622b5288a91d2891cdddb0da94c7623b0"
checksum: "38dc1f789192157afdb457a5a947b8500771aea8a5395ef2d90c60c8b5889988"
),
]
)
26 changes: 26 additions & 0 deletions FlowplayerSDK/Package.swift-E
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// swift-tools-version: 5.6

import PackageDescription

let version = "4.0.0-rc.1"

let package = Package(
name: "FlowplayerSDK",
platforms: [
.iOS(.v14),
.tvOS(.v14),
],
products: [
.library(
name: "FlowplayerSDK",
targets: ["FlowplayerSDK"]
),
],
targets: [
.binaryTarget(
name: "FlowplayerSDK",
url: "https://github.com/flowplayer/apple-sdk-releases/releases/download/\(version)/FlowplayerSDK.zip",
checksum: "400.1"
),
]
)
6 changes: 2 additions & 4 deletions Scripts/UpdateManifests.bash
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@ echo "🗃️ Downloaded $BINARY_NAME"

echo "Updaing Package.swift..."
# Calculate new checksum
touch Package.swift # need for swift package compute-checksum to work
NEW_CHECKSUM=$(shasum -a 256 $BINARY_NAME)
rm Package.swift # delete it as it is not needed anymore
NEW_CHECKSUM=$(shasum -a 256 $BINARY_NAME | awk '{ print $1 }')
echo "🔐 New checksum is: $NEW_CHECKSUM"

# Replace version information in package manifest
sed -E -i '' 's/let version = ".+"/let version = "'$NEW_VERSION\"/ FlowplayerSDK/Package.swift

# Replace checksum information in package manifest
sed -E -i '' 's/checksum: ".+"/checksum: "'$NEW_CHECKSUM\"/ FlowplayerSDK/Package.swift
sed -i -E "s/checksum: \".*\"/checksum: \"$NEW_CHECKSUM\"/" FlowplayerSDK/Package.swift

# print out package manifes for convenience reasons
echo "📜 New Package Manifest is:"
Expand Down

0 comments on commit 558250e

Please sign in to comment.