Skip to content

Commit

Permalink
feat: add binary spm distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
crleona committed Oct 30, 2024
1 parent d0d1ce6 commit c00b44a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ jobs:
working-directory: .build/artifacts
run: zip -r AnalyticsConnector.xcframework.zip AnalyticsConnector.xcframework

- name: Update Checksum
run: CHECKSUM=$(xcrun swift package compute-checksum .build/artifacts/AnalyticsConnector.xcframework.zip) && \
sed -i '' -E "s/(checksum: \")[^\"]*(\")/\1$CHECKSUM\2/" Package.swift

- name: Semantic Release --dry-run
if: ${{ github.event.inputs.dryRun == 'true'}}
env:
Expand Down
3 changes: 3 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ let package = Package(
name: "AnalyticsConnector",
path: "Sources/AnalyticsConnector",
exclude: ["Info.plist"]),
.binaryTarget(name: "AnalyticsConnectorFramework",
url: "https://github.com/amplitude/analytics-connector-ios/releases/download/v1.1.1/AnalyticsConnector.xcframework.zip",
checksum: "4d5ecd7301d34ef4cfb91a799e8d32940fd7c9eac4b5ab62b820ad447d18b594"),
.testTarget(
name: "AnalyticsConnectorTests",
dependencies: ["AnalyticsConnector"],
Expand Down
14 changes: 14 additions & 0 deletions release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@ module.exports = {
],
"countMatches": true
},
{
"files": ["Package.swift"],
"from": "https://github.com/amplitude/analytics-connector-ios/releases/download/v.*/AnalyticsConnector.xcframework.zip",
"to": "https://github.com/amplitude/analytics-connector-ios/releases/download/v${nextRelease.version}/AnalyticsConnector.xcframework.zip",
"results": [
{
"file": "Package.swift",
"hasChanged": true,
"numMatches": 1,
"numReplacements": 1
}
],
"countMatches": true
},
]
}
],
Expand Down

0 comments on commit c00b44a

Please sign in to comment.