Add sync workflow #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Build Swift | |
on: | |
pull_request: | |
push: | |
branches: | |
- "master" | |
- "DEVOPS-1577-sync-swift-cross-repo" | |
jobs: | |
sync: | |
runs-on: ubuntu-22.04 | |
env: | |
_KEY_VAULT: "bitwarden-ci" | |
_BOT_EMAIL: [email protected] | |
_BOT_NAME: bitwarden-devops-bot | |
steps: | |
- name: Checkout SDK repo | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 | |
with: | |
path: sdk | |
- name: Checkout SDK-Swift repo | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 | |
with: | |
repository: bitwarden/sdk-swift | |
path: sdk-swift | |
ref: main | |
- name: Login to Azure - Prod Subscription | |
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7 | |
with: | |
creds: ${{ secrets.AZURE_CI_SERVICE_PRINCIPAL }} | |
- name: Retrieve secrets | |
id: retrieve-secrets | |
uses: bitwarden/gh-actions/get-keyvault-secrets@62d1bf7c3e31c458cc7236b1e69a475d235cd78f | |
with: | |
keyvault: ${{ env._KEY_VAULT }} | |
secrets: "github-pat-bitwarden-devops-bot-repo-scope" | |
- name: Setup Git | |
working-directory: sdk-swift | |
run: | | |
git config --local user.email "${{ env._BOT_EMAIL }}" | |
git config --local user.name "${{ env._BOT_NAME }}" | |
- name: Update files | |
run: | | |
cp -r sdk/languages/swift/README.md sdk-swift/README.md | |
cp -r sdk/languages/swift/Package.swift sdk-swift/Package.swift | |
cp -r sdk/languages/swift/Sources sdk-swift/Sources | |
cp -r sdk/languages/swift/Tests sdk-swift/Tests | |
- name: Push changes | |
working-directory: sdk-swift | |
run: | | |
git add . | |
git commit -m "Update Swift SDK to ${{ github.sha }}" | |
# Validate changes during testing | |
git status | |