Skip to content

Commit

Permalink
Fix publish-release (#378)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
fcollonval and pre-commit-ci[bot] authored Sep 13, 2022
1 parent 0ca050b commit a30d0d2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/full-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
uses: ./.github/actions/publish-release
with:
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
target: ${{ github.event.inputs.target }}
release_url: ${{ steps.draft-release.outputs.release_url }}

- name: "** Next Step **"
Expand Down
4 changes: 2 additions & 2 deletions jupyter_releaser/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def draft_changelog(
current_sha=current_sha,
)
with tempfile.TemporaryDirectory() as d:
metadata_path = Path(d) / "metadata.json"
metadata_path = Path(d) / util.METADATA_JSON
with open(metadata_path, "w") as fid:
json.dump(data, fid)

Expand Down Expand Up @@ -432,7 +432,7 @@ def extract_release(
commit_message = ""
commit_message = util.run(f"git log --format=%B -n 1 {sha}")

for asset in assets:
for asset in filter(lambda a: a.name != util.METADATA_JSON.name, assets):
# Check the sha against the published sha
valid = False
path = dist / asset.name
Expand Down
7 changes: 5 additions & 2 deletions jupyter_releaser/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
MANIFEST = Path("MANIFEST.in")
YARN_LOCK = Path("yarn.lock")
JUPYTER_RELEASER_CONFIG = Path(".jupyter-releaser.toml")
METADATA_JSON = Path("metadata.json")

BUF_SIZE = 65536
TBUMP_CMD = "tbump --non-interactive --only-patch"
Expand Down Expand Up @@ -448,7 +449,7 @@ def extract_metadata_from_release_url(gh, release_url, auth):

data = None
for asset in release.assets:
if asset.name != "metadata.json":
if asset.name != METADATA_JSON.name:
continue

log(f"Fetching {asset.name}...")
Expand All @@ -464,7 +465,9 @@ def extract_metadata_from_release_url(gh, release_url, auth):
data = json.loads(sink.read().decode("utf-8"))

if data is None:
raise ValueError(f'Could not find "metadata.json" file in draft release {release_url}')
raise ValueError(
f'Could not find "{METADATA_JSON.name}" file in draft release {release_url}'
)

# Update environment variables.
if "post_version_spec" in data:
Expand Down

0 comments on commit a30d0d2

Please sign in to comment.