Skip to content

Commit

Permalink
Always upload to production zenodo
Browse files Browse the repository at this point in the history
The deposition is not published automatically, so it's still a good way
of checking the metadata before publishing the full release.
  • Loading branch information
sk1p authored and uellue committed Apr 17, 2024
1 parent b752bae commit 0299bed
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions scripts/release
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def get_archive(tag):
yield full_fn


def upload_to_zenodo(verbose, parent, token, sandbox_token):
def upload_to_zenodo(verbose, parent, token):
"""
Upload wheel, sdist and repo archive to zenodo. Only works if
there is a matching GitHub release already created.
Expand All @@ -310,10 +310,7 @@ def upload_to_zenodo(verbose, parent, token, sandbox_token):

if release == "dev":
raise click.ClickException("don't want to upload to zenodo from dev release")
elif release == "rc":
url = "https://sandbox.zenodo.org/api/"
os.environ['ZENODO_OAUTH_TOKEN'] = sandbox_token
elif release == "release":
elif release in ["rc", "release"]:
url = "https://zenodo.org/api/"
os.environ['ZENODO_OAUTH_TOKEN'] = token

Expand Down Expand Up @@ -524,18 +521,14 @@ def is_rc(ctx):
@click.option('--pypi-test-password', type=str, show_envvar=True)
@click.option('--token', type=str, show_envvar=True,
help='Github token for creating releases')
@click.option('--zenodo-sandbox-token', type=str, show_envvar=True,
help='Zenodo sandbox token for RC upload testing')
@click.option('--zenodo-token', type=str, show_envvar=True,
help='Zenodo production token for final release upload')
@click.option('--zenodo-parent', type=str, show_envvar=True,
help='Zenodo production parent deposition id')
@click.option('--zenodo-sandbox-parent', type=str, show_envvar=True,
help='Zenodo sandbox parent deposition id')
@click.pass_context
def upload(ctx, dry_run, build_appimage, pypi_user, pypi_password,
pypi_test_user, pypi_test_password, token, zenodo_sandbox_token,
zenodo_token, zenodo_parent, zenodo_sandbox_parent):
pypi_test_user, pypi_test_password, token,
zenodo_token, zenodo_parent):
"""
prepare, build and upload to github, zenodo and pypi
(if release candidate, to the test instance(s))
Expand Down Expand Up @@ -603,8 +596,8 @@ def upload(ctx, dry_run, build_appimage, pypi_user, pypi_password,

if not dry_run and (is_release or is_rc):
upload_to_zenodo(verbose=ctx.obj['verbose'],
parent=zenodo_sandbox_parent if is_rc else zenodo_parent,
token=zenodo_token, sandbox_token=zenodo_sandbox_token)
parent=zenodo_parent,
token=zenodo_token)


@cli.command()
Expand Down

0 comments on commit 0299bed

Please sign in to comment.