commit 0c40e48f695a1165671d4281fbe2a90020c4ebfe
parent f4b2ae6c6bf4aa362fc32f4e5f057168b20ff098
Author: Darren Clarke <darren@redaranj.com>
Date: Thu, 7 Dec 2023 08:42:51 +0100
Compute xcframework checksum with Swift
Diffstat:
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/apple/.gitlab-ci.yml b/apple/.gitlab-ci.yml
@@ -30,9 +30,9 @@ publish_apple:
only:
- tags
stage: release
- image: debian:bullseye
+ image: swift:jammy
before_script:
- - apt-get update && apt-get install -y git perl
+ - apt-get update && apt-get install -y git
- git config --global user.email "${GITLAB_USER_EMAIL}"
- git config --global user.name "${GITLAB_USER_NAME}"
- git remote set-url --push origin "https://${GITLAB_ACCESS_USERNAME}:${GITLAB_ACCESS_TOKEN}@gitlab.com/guardianproject/proofmode/simple-c2pa.git"
@@ -42,13 +42,12 @@ publish_apple:
- cp out/apple/SimpleC2PA.swift apple/src/SimpleC2PA/
- FRAMEWORK_URL="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/simple_c2pa/${CI_COMMIT_TAG}/SimpleC2PA.xcframework.zip"
- echo "Calculating checksum..."
- - CHECKSUM=$(shasum -a 256 ./out/apple/SimpleC2PA.xcframework.zip | awk '{print $1}')
+ - CHECKSUM=$(swift package compute-checksum ./out/apple/SimpleC2PA.xcframework.zip)
- echo "Updating Package.swift..."
- echo $FRAMEWORK_URL
- echo $CHECKSUM
- 'sed -i "s|url: \".*\"|url: \"${FRAMEWORK_URL}\"|g" Package.swift'
- 'sed -i "s|checksum: \".*\"|checksum: \"${CHECKSUM}\"|g" Package.swift'
- - cat Package.swift
- git add Package.swift
- git add apple/src/SimpleC2PA/SimpleC2PA.swift
- git commit -m "Update Swift files"