예제 #1
0
def create_release(ctx: TagContext) -> None:
    click.secho("> Creating the release.")

    ctx.github_release = ctx.github.create_release(
        repository=ctx.upstream_repo,
        tag_name=ctx.release_tag,
        target_commitish=ctx.release_pr["merge_commit_sha"],
        name=ctx.release_tag,
        body=ctx.release_notes,
    )

    release_location_string = f"Release is at {ctx.github_release['html_url']}"
    click.secho(release_location_string)

    ctx.github.create_pull_request_comment(
        ctx.upstream_repo, ctx.release_pr["number"], release_location_string
    )

    repo_short_name = ctx.upstream_repo.split("/")[-1]
    ctx.kokoro_job_name = (
        f"cloud-devrel/client-libraries/java/{repo_short_name}/release/stage"
    )
    ctx.github.update_pull_labels(
        ctx.release_pr, add=["autorelease: tagged"], remove=["autorelease: pending"]
    )
    releasetool.commands.common.publish_via_kokoro(ctx)
예제 #2
0
def create_release(ctx: TagContext) -> None:
    click.secho("> Creating the release.")

    if "google-cloud-python" in ctx.upstream_repo:
        release_name = f"google-cloud-{ctx.package_name} {ctx.release_version}"
    else:
        release_name = f"v{ctx.release_version}"
    ctx.github_release = ctx.github.create_release(
        repository=ctx.upstream_repo,
        tag_name=ctx.release_tag,
        target_commitish=ctx.release_pr["merge_commit_sha"],
        name=release_name,
        body=ctx.release_notes,
    )

    release_location_string = f"Release is at {ctx.github_release['html_url']}"
    click.secho(release_location_string)

    ctx.github.create_pull_request_comment(ctx.upstream_repo,
                                           ctx.release_pr["number"],
                                           release_location_string)

    ctx.github.update_pull_labels(ctx.release_pr,
                                  add=["autorelease: tagged"],
                                  remove=["autorelease: pending"])
예제 #3
0
def create_release(ctx: TagContext) -> None:
    click.secho("> Creating the release.")

    ctx.github_release = ctx.github.create_release(
        repository=ctx.upstream_repo,
        tag_name=ctx.release_tag,
        target_commitish=ctx.release_pr["merge_commit_sha"],
        name=ctx.release_tag,
        body=ctx.release_notes,
    )

    release_location_string = f"Release is at {ctx.github_release['html_url']}"
    click.secho(release_location_string)

    ctx.github.create_pull_request_comment(
        ctx.upstream_repo, ctx.release_pr["number"], release_location_string
    )
예제 #4
0
def create_release(ctx: TagContext) -> None:
    click.secho("> Creating the release.")

    if ctx.upstream_repo in manifest_release:
        # delegate releaase tagging to release-please
        default_branch = ctx.release_pr["base"]["ref"]
        repo = ctx.release_pr["base"]["repo"]["full_name"]

        with tempfile.NamedTemporaryFile("w+t", delete=False) as fp:
            fp.write(ctx.token)
            token_file = fp.name

        subprocess.check_output([
            # TODO(sofisl): remove pinning to a specific version
            # once we've tested:
            "npx",
            "release-please",
            "manifest-release",
            f"--token={token_file}",
            f"--default-branch={default_branch}",
            f"--repo-url={repo}",
            "--debug",
        ])
    else:
        # TODO(sofisl): move the non-manifest release to release-please too
        # for consistency:
        ctx.github_release = ctx.github.create_release(
            repository=ctx.upstream_repo,
            tag_name=ctx.release_version,
            target_commitish=ctx.release_pr["merge_commit_sha"],
            name=f"{ctx.release_version}",
            body=ctx.release_notes,
        )

        release_location_string = f"Release is at {ctx.github_release['html_url']}"
        click.secho(release_location_string)
        click.secho("CI will handle publishing the package to npm.")

        ctx.github.create_pull_request_comment(ctx.upstream_repo,
                                               ctx.release_pr["number"],
                                               release_location_string)

        ctx.github.update_pull_labels(ctx.release_pr,
                                      add=["autorelease: tagged"],
                                      remove=["autorelease: pending"])
예제 #5
0
def create_release(ctx: TagContext) -> None:
    click.secho("> Creating the release.")

    ctx.github_release = ctx.github.create_release(
        repository=ctx.upstream_repo,
        tag_name=ctx.release_tag,
        target_committish=ctx.release_pr["merge_commit_sha"],
        name=f"google-cloud-{ctx.package_name} {ctx.release_version}",
        body=ctx.release_notes,
    )

    release_location_string = f"Release is at {ctx.github_release['html_url']}"
    click.secho(release_location_string)
    click.secho("CI will handle publishing the package to PyPI.")

    ctx.github.create_pull_request_comment(
        ctx.upstream_repo, ctx.release_pr["number"], release_location_string
    )
예제 #6
0
def create_release(ctx: TagContext) -> None:
    click.secho("> Creating the release.")

    ctx.github_release = ctx.github.create_release(
        repository=ctx.upstream_repo,
        tag_name=ctx.release_version,
        target_commitish=ctx.release_pr["merge_commit_sha"],
        name=f"{ctx.release_version}",
        body=ctx.release_notes,
    )

    release_location_string = f"Release is at {ctx.github_release['html_url']}"
    click.secho(release_location_string)
    click.secho("CI will handle publishing the package to npm.")

    ctx.github.create_pull_request_comment(
        ctx.upstream_repo, ctx.release_pr["number"], release_location_string
    )

    ctx.github.update_pull_labels(
        ctx.release_pr, add=["autorelease: tagged"], remove=["autorelease: pending"]
    )