Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/sdlc-sdk-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:

COMMIT_MESSAGE=$(gh api "repos/bitwarden/sdk-swift/commits/$SDK_SWIFT_REF" --jq '.commit.message')
echo "👀 sdk-swift ref commit message: \"$COMMIT_MESSAGE\""
SDK_INTERNAL_REF=$(echo "$COMMIT_MESSAGE" | grep -oE '[a-f0-9]{40}')
SDK_INTERNAL_REF=$(echo "$COMMIT_MESSAGE" | grep -oE '[a-f0-9]{40}' | head -n1)
if [ -z "$SDK_INTERNAL_REF" ]; then
echo "::error::Failed to parse sdk-internal ref from commit message."
exit 1
Expand Down Expand Up @@ -188,6 +188,7 @@ jobs:
git config user.email "$_BOT_EMAIL"

git add project-common.yml
git add Bitwarden.xcworkspace/xcshareddata/swiftpm/Package.resolved
git commit -m "SDK Update - $_SDK_SWIFT_REF_SHORT ($_SDK_VERSION)"
git push origin $_BRANCH_NAME

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions Scripts/update-sdk-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ SDK_VERSION="$3"
PROJECT_FILE="project-common.yml"
PACKAGE_RESOLVED="Bitwarden.xcworkspace/xcshareddata/swiftpm/Package.resolved"

# Show sdk-swift block before editing
CURRENT_SDK_SWIFT_BLOCK=$(jq -r '.pins[] | select(.identity == "sdk-swift")' "$PACKAGE_RESOLVED")
echo "🔎 Current sdk_swift block Package.resolved:"
echo $CURRENT_SDK_SWIFT_BLOCK

# Update project-common.yml
echo "🔧 Updating revision in $PROJECT_FILE..."
yq -i ".packages[\"$SDK_PACKAGE\"].revision = \"$SDK_SWIFT_REF\" | .packages[\"$SDK_PACKAGE\"].revision line_comment = \"$SDK_VERSION\"" "$PROJECT_FILE"
Expand All @@ -27,3 +32,8 @@ CURRENT_HASH=$(jq -r '.pins[] | select(.identity == "sdk-swift") | .state.revisi
echo "Current hash in Package.resolved: $CURRENT_HASH"
sed -i.bak "s/$CURRENT_HASH/$SDK_SWIFT_REF/g" "$PACKAGE_RESOLVED"
echo "✅ Updated revision in $PACKAGE_RESOLVED"

# Show sdk-swift block after editing
CURRENT_SDK_SWIFT_BLOCK=$(jq -r '.pins[] | select(.identity == "sdk-swift")' "$PACKAGE_RESOLVED")
echo "🔎 Current sdk_swift block Package.resolved:"
echo $CURRENT_SDK_SWIFT_BLOCK
2 changes: 1 addition & 1 deletion project-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ include:
packages:
BitwardenSdk:
url: https://github.com/bitwarden/sdk-swift
revision: f3c527ff2c53b576743e090ed118f0a5a7c613d3 # 1.0.0-2469-1ca5a58
revision: b10919f8b50d3d27b7d3e0d9f674203c0f0bd9ec # 1.0.0-2487-c975847
branch: unstable
Firebase:
url: https://github.com/firebase/firebase-ios-sdk
Expand Down
Loading