Skip to content

Commit b193842

Browse files
authored
ci: Update ci scripts to bump package version on both Package files (#5839)
* Set default C language to compiler default * Bump GCC C version to GNU11 * Use GNU17 * Remove GCC_C_LANGUAGE_STANDARD * Restore xcconfig changes * Update changelog * Update tests to check building with both package files * Only delete newer package files * ci: Update ci scripts to bump package version on both Package files * Remove change in changelog * Update [email protected]
1 parent 718c372 commit b193842

File tree

5 files changed

+66
-33
lines changed

5 files changed

+66
-33
lines changed

.github/workflows/version-bump-util.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
- "Utils/VersionBump/**"
1111
- ".github/workflows/version-bump-util.yml"
1212
- "./Sentry.podspec"
13-
- "./Package.swift"
13+
- "./Package*.swift"
1414
- "./SentryPrivate.podspec"
1515
- "./SentrySwiftUI.podspec"
1616
- "./Sources/Sentry/SentryMeta.m"

[email protected]

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,18 @@ var products: [Product] = [
2121
var targets: [Target] = [
2222
.binaryTarget(
2323
name: "Sentry",
24-
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.54.0/Sentry.xcframework.zip",
25-
checksum: "f0f4b5582f7fef029ddedd22b6b9894a6d2d31ea9c7b52a2133b1ec7c4cff206" //Sentry-Static
24+
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.55.0/Sentry.xcframework.zip",
25+
checksum: "7467d496eda792a62c59e467aa1c94e0c093cfbedd35cb331c6fba3b8247cca3" //Sentry-Static
2626
),
2727
.binaryTarget(
2828
name: "Sentry-Dynamic",
29-
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.54.0/Sentry-Dynamic.xcframework.zip",
30-
checksum: "2cd3ee298133ed3a6d3b98f3b040e5c67b752887e67647ae671f450ecfd3facf" //Sentry-Dynamic
29+
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.55.0/Sentry-Dynamic.xcframework.zip",
30+
checksum: "bc672aac87e5f54d0744b95ddad62b5b3bf77329deea588a2c90c4aa52cad33f" //Sentry-Dynamic
31+
),
32+
.binaryTarget(
33+
name: "Sentry-Dynamic-WithARM64e",
34+
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.55.0/Sentry-Dynamic-WithARM64e.xcframework.zip",
35+
checksum: "c4fb9927ed1d1cb8fad79c5bfe845547271cf54d2c772e5a93badd1a1fa72f58" //Sentry-Dynamic-WithARM64e
3136
),
3237
.target (
3338
name: "SentrySwiftUI",

Utils/VersionBump/main.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ let fromVersionFile = "./Sentry.podspec"
3939
let files = [
4040
"./Sentry.podspec",
4141
"./Package.swift",
42+
4243
"./SentryPrivate.podspec",
4344
"./SentrySwiftUI.podspec",
4445
"./Sources/Sentry/SentryMeta.m",
@@ -179,7 +180,7 @@ func getRegexString(for file: String) throws -> String {
179180
return "s\\.dependency\\s\"Sentry\\/HybridSDK\",\\s\"(?<version>[a-zA-z0-9\\.\\-]+)\""
180181
}
181182
return "\\ss\\.version\\s+=\\s\"(?<version>[a-zA-z0-9\\.\\-]+)\""
182-
} else if file == "./Package.swift" {
183+
} else if file.hasPrefix("./Package") && file.hasSuffix(".swift") {
183184
return "https:\\/\\/github\\.com\\/getsentry\\/sentry-cocoa\\/releases\\/download\\/(?<version>[a-zA-z0-9\\.\\-]+)\\/Sentry"
184185
} else if file == "./Sources/Sentry/SentryMeta.m" {
185186
return "static NSString \\*versionString = @\"(?<version>[a-zA-z0-9\\.\\-]+)\""

scripts/update-package-sha.sh

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,31 @@ if [ -z "$GITHUB_RUN_ID" ]; then
66
exit 1
77
fi
88

9+
PACKAGE_FILES=$(find . -maxdepth 1 -name "Package.swift" -o -name "Package@swift-*.swift" | sort)
10+
11+
if [ -z "$PACKAGE_FILES" ]; then
12+
echo "::error::No Package.swift or Package@swift-*.swift files found"
13+
exit 1
14+
fi
15+
916
NEW_CHECKSUM_STATIC=$(shasum -a 256 Carthage/Sentry.xcframework.zip | awk '{print $1}')
1017
NEW_CHECKSUM_DYNAMIC=$(shasum -a 256 Carthage/Sentry-Dynamic.xcframework.zip | awk '{print $1}')
1118
NEW_CHECKSUM_DYNAMIC_WITH_ARM64E=$(shasum -a 256 Carthage/Sentry-Dynamic-WithARM64e.xcframework.zip | awk '{print $1}')
1219

1320
os=$(uname)
14-
# Craft pre-release command runs on an ubuntu machine
15-
# and `sed` needs an extra argument for macOS
16-
if [ "$os" == "Linux" ]; then
17-
sed -i "s/checksum: \".*\" \/\/Sentry-Static/checksum: \"$NEW_CHECKSUM_STATIC\" \/\/Sentry-Static/" Package.swift
18-
sed -i "s/checksum: \".*\" \/\/Sentry-Dynamic/checksum: \"$NEW_CHECKSUM_DYNAMIC\" \/\/Sentry-Dynamic/" Package.swift
19-
sed -i "s/checksum: \".*\" \/\/Sentry-Dynamic-WithARM64e/checksum: \"$NEW_CHECKSUM_DYNAMIC_WITH_ARM64E\" \/\/Sentry-Dynamic-WithARM64e/" Package.swift
20-
else
21-
sed -i "" "s/checksum: \".*\" \/\/Sentry-Static/checksum: \"$NEW_CHECKSUM_STATIC\" \/\/Sentry-Static/" Package.swift
22-
sed -i "" "s/checksum: \".*\" \/\/Sentry-Dynamic/checksum: \"$NEW_CHECKSUM_DYNAMIC\" \/\/Sentry-Dynamic/" Package.swift
23-
sed -i "" "s/checksum: \".*\" \/\/Sentry-Dynamic-WithARM64e/checksum: \"$NEW_CHECKSUM_DYNAMIC_WITH_ARM64E\" \/\/Sentry-Dynamic-WithARM64e/" Package.swift
24-
fi
21+
22+
for package_file in $PACKAGE_FILES; do
23+
# Craft pre-release command runs on an ubuntu machine
24+
# and `sed` needs an extra argument for macOS
25+
if [ "$os" == "Linux" ]; then
26+
sed -i "s/checksum: \".*\" \/\/Sentry-Static/checksum: \"$NEW_CHECKSUM_STATIC\" \/\/Sentry-Static/" "$package_file"
27+
sed -i "s/checksum: \".*\" \/\/Sentry-Dynamic/checksum: \"$NEW_CHECKSUM_DYNAMIC\" \/\/Sentry-Dynamic/" "$package_file"
28+
sed -i "s/checksum: \".*\" \/\/Sentry-Dynamic-WithARM64e/checksum: \"$NEW_CHECKSUM_DYNAMIC_WITH_ARM64E\" \/\/Sentry-Dynamic-WithARM64e/" "$package_file"
29+
else
30+
sed -i "" "s/checksum: \".*\" \/\/Sentry-Static/checksum: \"$NEW_CHECKSUM_STATIC\" \/\/Sentry-Static/" "$package_file"
31+
sed -i "" "s/checksum: \".*\" \/\/Sentry-Dynamic/checksum: \"$NEW_CHECKSUM_DYNAMIC\" \/\/Sentry-Dynamic/" "$package_file"
32+
sed -i "" "s/checksum: \".*\" \/\/Sentry-Dynamic-WithARM64e/checksum: \"$NEW_CHECKSUM_DYNAMIC_WITH_ARM64E\" \/\/Sentry-Dynamic-WithARM64e/" "$package_file"
33+
fi
34+
done
2535

2636
echo "$GITHUB_RUN_ID" > .github/last-release-runid

scripts/verify-package-sha.sh

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,26 +57,43 @@ if [ -z "$EXPECTED_LAST_RELEASE_RUNID" ]; then
5757
exit 1
5858
fi
5959

60-
echo "Verify checksum of static xcframework in Package.swift"
61-
UPDATED_PACKAGE_SHA=$(grep "checksum.*Sentry-Static" Package.swift | cut -d '"' -f 2)
62-
if [ "$UPDATED_PACKAGE_SHA" != "$EXPECTED_STATIC_CHECKSUM" ]; then
63-
echo "::error::Expected checksum to be $EXPECTED_STATIC_CHECKSUM but got $UPDATED_PACKAGE_SHA"
64-
exit 1
65-
fi
60+
# Find all Package.swift and Package@swift-*.swift files
61+
PACKAGE_FILES=$(find . -maxdepth 1 -name "Package.swift" -o -name "Package@swift-*.swift" | sort)
6662

67-
echo "Verify checksum of dynamic xcframework in Package.swift"
68-
UPDATED_PACKAGE_SHA=$(grep "checksum.*Sentry-Dynamic" Package.swift | cut -d '"' -f 2 | head -n 1)
69-
if [ "$UPDATED_PACKAGE_SHA" != "$EXPECTED_DYNAMIC_CHECKSUM" ]; then
70-
echo "::error::Expected checksum to be $EXPECTED_DYNAMIC_CHECKSUM but got $UPDATED_PACKAGE_SHA"
63+
if [ -z "$PACKAGE_FILES" ]; then
64+
echo "::error::No Package.swift or Package@swift-*.swift files found"
7165
exit 1
7266
fi
7367

74-
echo "Verify checksum of dynamic with arm64e xcframework in Package.swift"
75-
UPDATED_PACKAGE_SHA=$(grep "checksum.*Sentry-Dynamic-WithARM64e" Package.swift | cut -d '"' -f 2)
76-
if [ "$UPDATED_PACKAGE_SHA" != "$EXPECTED_DYNAMIC_WITH_ARM64E_CHECKSUM" ]; then
77-
echo "::error::Expected checksum to be $EXPECTED_DYNAMIC_WITH_ARM64E_CHECKSUM but got $UPDATED_PACKAGE_SHA"
78-
exit 1
79-
fi
68+
# Verify checksums in each Package file
69+
for package_file in $PACKAGE_FILES; do
70+
echo "Verifying checksums in $package_file"
71+
72+
# Verify static checksum
73+
UPDATED_PACKAGE_SHA=$(grep "checksum.*Sentry-Static" "$package_file" | cut -d '"' -f 2)
74+
if [ "$UPDATED_PACKAGE_SHA" != "$EXPECTED_STATIC_CHECKSUM" ]; then
75+
echo "::error::Expected static checksum to be $EXPECTED_STATIC_CHECKSUM but got $UPDATED_PACKAGE_SHA in $package_file"
76+
exit 1
77+
fi
78+
79+
# Verify dynamic checksum
80+
UPDATED_PACKAGE_SHA=$(grep "checksum.*Sentry-Dynamic" "$package_file" | cut -d '"' -f 2 | head -n 1)
81+
if [ "$UPDATED_PACKAGE_SHA" != "$EXPECTED_DYNAMIC_CHECKSUM" ]; then
82+
echo "::error::Expected dynamic checksum to be $EXPECTED_DYNAMIC_CHECKSUM but got $UPDATED_PACKAGE_SHA in $package_file"
83+
exit 1
84+
fi
85+
86+
# Verify dynamic with arm64e checksum
87+
UPDATED_PACKAGE_SHA=$(grep "checksum.*Sentry-Dynamic-WithARM64e" "$package_file" | cut -d '"' -f 2)
88+
if [ "$UPDATED_PACKAGE_SHA" != "$EXPECTED_DYNAMIC_WITH_ARM64E_CHECKSUM" ]; then
89+
echo "::error::Expected checksum to be $EXPECTED_DYNAMIC_WITH_ARM64E_CHECKSUM but got $UPDATED_PACKAGE_SHA in $package_file"
90+
exit 1
91+
fi
92+
93+
echo "✓ All checksums verified in $package_file"
94+
done
95+
96+
8097

8198
echo "Verify last-release-runid"
8299
LAST_RELEASE_RUNID=$(cat .github/last-release-runid)

0 commit comments

Comments
 (0)