-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BRE-113] Publish SWIFT sdk releases to bitwarden/sdk-swift #956
[BRE-113] Publish SWIFT sdk releases to bitwarden/sdk-swift #956
Conversation
- Add default environment variables - Update branch check - Point Bitwarden actions to main - Move github-release step to last - Create release on sdk-swift project
- Lint
Thank you! Co-authored-by: Vince Grassia <[email protected]>
Co-authored-by: Vince Grassia <[email protected]>
- Using the requirement of hosting these artifacts with GitHub releases, push each commit in main to the sdk-swift repo. - Supports this implementation with requirements of GitHub releases as storage, along with pushing commits from main to sdk-swift #268 (comment)
New Issues
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #956 +/- ##
==========================================
- Coverage 57.98% 57.96% -0.02%
==========================================
Files 197 197
Lines 13647 13651 +4
==========================================
Hits 7913 7913
- Misses 5734 5738 +4 ☔ View full report in Codecov by Sentry. |
.github/workflows/build-swift.yml
Outdated
- name: Get Package Version | ||
id: retrieve-version | ||
run: | | ||
VERSION=$(grep -o '^version = ".*"' crates/bws/Cargo.toml | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be the bitwarden crate not the cli.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops.... Fixed 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michalchecinski it occured to me know that the bitwarden verison is inherited from the workspace version. https://github.com/bitwarden/sdk/blob/main/Cargo.toml#L8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Hinton got it! Also, should the version for SWIFT SDK be the same as Rust crates?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can use that for now.
.github/workflows/release-swift.yml
Outdated
- name: Update files | ||
run: | | ||
# Update BitwardenFFI path | ||
sed -i '' 's|.binaryTarget(name: "BitwardenFFI", path: "BitwardenFFI.xcframework")|.binaryTarget(\ | ||
name: "BitwardenFFI",\ | ||
url: "https://github.com/bitwarden/sdk-swift/releases/download/v${{ env._RELEASE_NAME }}/BitwardenFFI-${{ env._PKG_VERSION }}-${{ needs.validate.outputs.short_sha }}.xcframework.zip",|' sdk/languages/swift/Package.swift | ||
|
||
# Run swiftformat | ||
swiftformat sdk/languages/swift/Package.swift | ||
|
||
# Copy files to local sdk-swift repo path | ||
cp --verbose -rf sdk/languages/swift/README.md sdk-swift/README.md | ||
cp --verbose -rf sdk/languages/swift/Package.swift sdk-swift/Package.swift | ||
cp --verbose -rf sdk/languages/swift/Sources sdk-swift/Sources | ||
cp --verbose -rf sdk/languages/swift/Tests sdk-swift/Tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we calculating the checksum somewhere?'
I usually have to edit these two lines
url: "https://bwlivefronttest.blob.core.windows.net/sdk/de3b6e2-BitwardenFFI.xcframework.zip",
checksum: "37e884d820907af85e788b5e0ab483bfc5aa0299e5d6b39865ad70659322a202"),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To calculate the value I use swift package compute-checksum <path>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought I did it... It's fixed now. :)
…ps://github.com/bitwarden/sdk into BRE-113-Publish-Swift-SDK-releases-to-sdk-swift
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, please wait for Oscar to review.
.github/workflows/release-swift.yml
Outdated
fi | ||
|
||
- name: Calculate swift file checksum | ||
run: | | ||
CHECKSUM=$(swift package compute-checksum BitwardenFFI-${{ steps.version.outputs.version }}-${{ steps.set-sha.outputs.short_sha }}.xcframework) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the hash of the zip file? I always run the compute-checksum on the already zipped framework.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I thought that needs to be on pre-zipped file. I'll change that.
Co-authored-by: Vince Grassia <[email protected]>
🎟️ Tracking
https://bitwarden.atlassian.net/browse/BRE-113
📔 Objective
Automate publishing SWIFT SDK to bitwarden/sdk-swift repo. Thanks @mimartin12 for the initial work on that!
📸 Screenshots
⏰ Reminders before review
team
🦮 Reviewer guidelines
:+1:
) or similar for great changes:memo:
) or ℹ️ (:information_source:
) for notes or general info:question:
) for questions:thinking:
) or 💭 (:thought_balloon:
) for more open inquiry that's not quite a confirmedissue and could potentially benefit from discussion
:art:
) for suggestions / improvements:x:
) or:warning:
) for more significant problems or concerns needing attention:seedling:
) or ♻️ (:recycle:
) for future improvements or indications of technical debt:pick:
) for minor or nitpick changes