Skip to content

Commit 72f4866

Browse files
authored
[PM-20288] Automate iOS repo update and improve release-swift process (#439)
## 🎟️ Tracking PM-20288 ## 📔 Objective The initial goal was to trigger an iOS repo SDK update when sdk-internal `main` is updated, implementing that led to hard to maintain duplicate steps that were also slowing down the whole process even further, ended up refactoring multiple bits that would be hard to review independently. My suggestion for reviewers is to go through it as a new file instead of change-by-change. With that, here's a summary of updates: ### Structural 1. Consolidated jobs into a single one to reduce duplicate steps 1. Removed duplicated / unused steps like retrieving secrets, retrieving a run-id if missing, downloading BitwardenFFI file 1. Use the new BW App pattern for github authentication - still using the devops bot for commit signing 1. Removed swiftformat clone and build - took 50-60% of the average runtime just to format [Package.swift](https://github.com/bitwarden/sdk-internal/blob/main/crates/bitwarden-uniffi/swift/Package.swift) on each run, we should instead format it in this repo once. 1. Moved inline github template variables to env vars to mitigate script injections 1. Following @mandreko-bitwarden pro-tip, ran zizmor and addressed feedback like `persist-credentials: false` on `action/checkout` when we just need to checkout the repo 1. Update crazy-max/ghaction-import-gpg to 6.3.0 ## Functional 1. Average runtime reduced from 4m45s to 1m10s. 3. Triggers an iOS SDK update when new sdk-internal PRs are merged to `main` 4. Updates the sdk-swift commit message with additional sdk-internal info using [GitHub Autolink ](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/autolinked-references-and-urls) patterns, enabling ios devs to quickly go to the original commit or PR. [screenshot#1] 5. Added step logs and quick links to the Action Summary [screenshot#2] 6. Sets `run-as` to communicate the Build we're releasing. [screenshot#3 - old vs new] 7. Branch Name input added to enable testing and set us up to support publishing feature branches in the future, like we've been doing for [Android](https://github.com/bitwarden/sdk-internal/packages/2591890), enabling quick feature branch testing. Test Run: * https://github.com/bitwarden/sdk-internal/actions/runs/17655035226 * triggered -> https://github.com/bitwarden/ios/actions/runs/17655061169 * opened -> bitwarden/ios#1928 [screenshot#1 - sdk-swift new commit message format] <img width="823" height="101" alt="image" src="https://github.com/user-attachments/assets/25aa2668-123f-46a2-9470-e3be2c4c94ab" /> [screenshot#2 - Action Summary] <img width="568" height="322" alt="image" src="https://github.com/user-attachments/assets/796589b4-0897-4952-a15a-1cf756395380" /> [screenshot#3 - Action `run-as`] <img width="447" height="151" alt="image" src="https://github.com/user-attachments/assets/f6bf1872-61c3-406b-9840-7a0c22154d0d" /> ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+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 confirmed issue 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
1 parent 9b1253a commit 72f4866

File tree

2 files changed

+156
-180
lines changed

2 files changed

+156
-180
lines changed

.github/workflows/build-swift.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ jobs:
132132
ref: 'main',
133133
inputs: {
134134
'build-run-id': '${{ github.run_id }}',
135-
'pre-release': 'true'
135+
'build-run-number': '${{ github.run_number }}',
136+
'sdk-swift-branch-name': 'unstable',
137+
'update-ios-repo': 'true',
136138
}
137139
})

0 commit comments

Comments
 (0)