Release 5.7.4 (#22)

* chore: Add xcframework signing for Capacitor and Cordova
This commit is contained in:
Steven Sherry 2024-04-02 15:57:47 -05:00 committed by GitHub
parent fe3c5b63e7
commit f304c9dd18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 100 additions and 86 deletions

View file

@ -20,6 +20,18 @@ jobs:
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/*/}" >> $GITHUB_ENV run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/*/}" >> $GITHUB_ENV
- name: Build Capacitor and Cordova - name: Build Capacitor and Cordova
run: ./build-cap $RELEASE_VERSION run: ./build-cap $RELEASE_VERSION
- name: Sign Capacitor xcframework
uses: ionic-team/sign-xcframework@main
with:
cert-token: ${{ secrets.XCFRAMEWORK_SIGNING_TOKEN }}
xcframework-path: Capacitor.xcframework
- name: Sign Cordova xcframework
uses: ionic-team/sign-xcframework@main
with:
cert-token: ${{ secrets.XCFRAMEWORK_SIGNING_TOKEN }}
xcframework-path: Cordova.xcframework
- name: Package Capacitor and Cordova
run: ./package-cap $RELEASE_VERSION
- name: Push manifest update - name: Push manifest update
uses: EndBug/add-and-commit@v9 uses: EndBug/add-and-commit@v9
- name: Create Draft Release - name: Create Draft Release

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
capacitor-checkout capacitor-checkout
*.xcframework
*.zip *.zip
.swiftpm .swiftpm
frameworks frameworks

View file

@ -18,13 +18,13 @@ let package = Package(
targets: [ targets: [
.binaryTarget( .binaryTarget(
name: "Capacitor", name: "Capacitor",
url: "https://github.com/ionic-team/capacitor-swift-pm/releases/download/6.0.0-rc.0/Capacitor.xcframework.zip", url: "https://github.com/ionic-team/capacitor-swift-pm/releases/download/5.7.4/Capacitor.xcframework.zip",
checksum: "40931648c794e29ade96907e7e25747cac89ad6dc0841263be35c69108732a06" checksum: "3fe57f27e8b578518d0e3bd3ef08046297ff71a0af9610f16c4a7e6bbb5dc033"
), ),
.binaryTarget( .binaryTarget(
name: "Cordova", name: "Cordova",
url: "https://github.com/ionic-team/capacitor-swift-pm/releases/download/6.0.0-rc.0/Cordova.xcframework.zip", url: "https://github.com/ionic-team/capacitor-swift-pm/releases/download/5.7.4/Cordova.xcframework.zip",
checksum: "0f3eed00c80e54a50eb10c0c2c65c7f09ed0a3d4bddd2b95537f32cc3d41186f" checksum: "c5638dab59595073d6ca72a8f0faf844d4097a2c873efe07b2781bc92c6057c3"
) )
] ]
) )

View file

@ -1,4 +1,4 @@
#!/bin/bash -eoux pipefail #!/usr/bin/env bash -eoux pipefail
build_capacitor_simulator() { build_capacitor_simulator() {
xcodebuild archive \ xcodebuild archive \
@ -44,43 +44,6 @@ create_xcframeworks() {
-debug-symbols $PWD/Build/iOS.xcarchive/dSYMs/Cordova.framework.dSYM \ -debug-symbols $PWD/Build/iOS.xcarchive/dSYMs/Cordova.framework.dSYM \
-output Cordova.xcframework -output Cordova.xcframework
zip -r Capacitor.xcframework.zip Capacitor.xcframework
zip -r Cordova.xcframework.zip Cordova.xcframework
}
write_package_file() {
cat << EOF > Package.swift
// swift-tools-version:5.3
import PackageDescription
let package = Package(
name: "capacitor-swift-pm",
products: [
.library(
name: "Capacitor",
targets: ["Capacitor"]
),
.library(
name: "Cordova",
targets: ["Cordova"]
)
],
dependencies: [],
targets: [
.binaryTarget(
name: "Capacitor",
url: "$1",
checksum: "$2"
),
.binaryTarget(
name: "Cordova",
url: "$3",
checksum: "$4"
)
]
)
EOF
} }
git clone https://github.com/ionic-team/capacitor capacitor-checkout git clone https://github.com/ionic-team/capacitor capacitor-checkout
@ -89,14 +52,5 @@ git checkout $1
create_xcframeworks create_xcframeworks
cap_url="https://github.com/ionic-team/capacitor-swift-pm/releases/download/$1/Capacitor.xcframework.zip" mv Capacitor.xcframework ../../../
cap_sha=$(shasum -a 256 Capacitor.xcframework.zip | sed 's/ /\n/g' | head -n1 | xargs echo -n) mv Cordova.xcframework ../../../
cap_cordova_url="https://github.com/ionic-team/capacitor-swift-pm/releases/download/$1/Cordova.xcframework.zip"
cap_cordova_sha=$(shasum -a 256 Cordova.xcframework.zip | sed 's/ /\n/g' | head -n1 | xargs echo -n)
cd ../../../
mkdir frameworks
mv capacitor-checkout/ios/Capacitor/{Capacitor,Cordova}.xcframework.zip frameworks
write_package_file $cap_url $cap_sha $cap_cordova_url $cap_cordova_sha

47
package-cap Executable file
View file

@ -0,0 +1,47 @@
#!/usr/bin/env bash -eoux pipefail
mkdir frameworks
zip -r frameworks/Capacitor.xcframework.zip Capacitor.xcframework
zip -r frameworks/Cordova.xcframework.zip Cordova.xcframework
write_package_file() {
cat <<EOF >Package.swift
// swift-tools-version:5.3
import PackageDescription
let package = Package(
name: "capacitor-swift-pm",
products: [
.library(
name: "Capacitor",
targets: ["Capacitor"]
),
.library(
name: "Cordova",
targets: ["Cordova"]
)
],
dependencies: [],
targets: [
.binaryTarget(
name: "Capacitor",
url: "$1",
checksum: "$2"
),
.binaryTarget(
name: "Cordova",
url: "$3",
checksum: "$4"
)
]
)
EOF
}
cap_url="https://github.com/ionic-team/capacitor-swift-pm/releases/download/$1/Capacitor.xcframework.zip"
cap_sha=$(shasum -a 256 frameworks/Capacitor.xcframework.zip | sed 's/ /\n/g' | head -n1 | xargs echo -n)
cap_cordova_url="https://github.com/ionic-team/capacitor-swift-pm/releases/download/$1/Cordova.xcframework.zip"
cap_cordova_sha=$(shasum -a 256 frameworks/Cordova.xcframework.zip | sed 's/ /\n/g' | head -n1 | xargs echo -n)
write_package_file $cap_url $cap_sha $cap_cordova_url $cap_cordova_sha