Skip to content
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

Fix update_upstream_sdks CI job #862

Merged
merged 2 commits into from
May 20, 2022
Merged
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
5 changes: 4 additions & 1 deletion tools/distribution/src/dogfood/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
from git import Repo, Actor


default_git_author = Actor(name='mobile-app-ci', email='')


class Repository:
"""
Abstracts operations on the target repository.
Expand Down Expand Up @@ -64,7 +67,7 @@ def commit(self, message: str, author: Union[None, 'Actor'] = None):
print(' → commit message:')
print(message)
self.repo.git.add(update=True)
self.repo.index.commit(message=message, author=author)
self.repo.index.commit(message=message, author=author, committer=author)

def push(self):
"""
Expand Down
7 changes: 5 additions & 2 deletions tools/distribution/update_upstream_sdks.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import traceback
from tempfile import TemporaryDirectory
from src.release.semver import Version
from src.dogfood.repository import Repository
from src.dogfood.repository import Repository, default_git_author
from src.utils import remember_cwd, shell


Expand Down Expand Up @@ -56,6 +56,7 @@ def update_flutter_sdk(ios_sdk_git_tag: str, dry_run: bool):
pass

podspec.seek(0)
podspec.truncate()
podspec.write(''.join(lines))

# Update the README.md with the current version
Expand All @@ -81,6 +82,7 @@ def update_flutter_sdk(ios_sdk_git_tag: str, dry_run: bool):
in_table = True

readme.seek(0)
readme.truncate()
readme.write(''.join(lines))

shell(command='pod repo update')
Expand Down Expand Up @@ -109,7 +111,8 @@ def update_flutter_sdk(ios_sdk_git_tag: str, dry_run: bool):
# Commit changes:
repository.commit(
message=f'Update version of dd-sdk-ios to {ios_sdk_git_tag}\n\n'
f'This commit was created by automation from the dd-sdk-ios repo.'
f'This commit was created by automation from the dd-sdk-ios repo.',
author=default_git_author
)

# Push branch and create PR:
Expand Down