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

Publish to PyPI immediately before pushing to main branch #299

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
13 changes: 6 additions & 7 deletions src/oca_github_bot/tasks/merge_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from enum import Enum

from .. import github
from ..build_wheels import build_and_check_wheel, build_and_publish_wheel
from ..build_wheels import build_and_publish_wheel
from ..config import (
GITHUB_CHECK_SUITES_IGNORED,
GITHUB_STATUS_IGNORED,
Expand Down Expand Up @@ -177,8 +177,12 @@ def _merge_bot_merge_pr(org, repo, merge_bot_branch, cwd, dry_run=False):
check_call(["git", "reset", "--soft", head_sha], cwd=cwd)
check_call(["git", "commit", "-m", "[BOT] post-merge updates"], cwd=cwd)

# We publish to PyPI before merging, because we don't want to merge
# if PyPI rejects the upload for any reason. There is a possibility
# that the upload succeeds and then the merge fails, but that should be
# exceptional, and it is better than the contrary.
for addon_dir in modified_installable_addon_dirs:
build_and_check_wheel(addon_dir)
build_and_publish_wheel(addon_dir, dist_publisher, dry_run)

if dry_run:
_logger.info(f"DRY-RUN git push in {org}/{repo}@{target_branch}")
Expand All @@ -188,11 +192,6 @@ def _merge_bot_merge_pr(org, repo, merge_bot_branch, cwd, dry_run=False):
["git", "push", "origin", f"{merge_bot_branch}:{target_branch}"], cwd=cwd
)

# build and publish wheel
if modified_installable_addon_dirs:
for addon_dir in modified_installable_addon_dirs:
build_and_publish_wheel(addon_dir, dist_publisher, dry_run)

# TODO wlc unlock modified_addons

# delete merge bot branch
Expand Down
Loading