Skip to content

Commit a30d0d2

Browse files
Fix publish-release (#378)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 0ca050b commit a30d0d2

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

.github/workflows/full-release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
uses: ./.github/actions/publish-release
4646
with:
4747
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
48+
target: ${{ github.event.inputs.target }}
4849
release_url: ${{ steps.draft-release.outputs.release_url }}
4950

5051
- name: "** Next Step **"

jupyter_releaser/lib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def draft_changelog(
169169
current_sha=current_sha,
170170
)
171171
with tempfile.TemporaryDirectory() as d:
172-
metadata_path = Path(d) / "metadata.json"
172+
metadata_path = Path(d) / util.METADATA_JSON
173173
with open(metadata_path, "w") as fid:
174174
json.dump(data, fid)
175175

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

435-
for asset in assets:
435+
for asset in filter(lambda a: a.name != util.METADATA_JSON.name, assets):
436436
# Check the sha against the published sha
437437
valid = False
438438
path = dist / asset.name

jupyter_releaser/util.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
MANIFEST = Path("MANIFEST.in")
4040
YARN_LOCK = Path("yarn.lock")
4141
JUPYTER_RELEASER_CONFIG = Path(".jupyter-releaser.toml")
42+
METADATA_JSON = Path("metadata.json")
4243

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

449450
data = None
450451
for asset in release.assets:
451-
if asset.name != "metadata.json":
452+
if asset.name != METADATA_JSON.name:
452453
continue
453454

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

466467
if data is None:
467-
raise ValueError(f'Could not find "metadata.json" file in draft release {release_url}')
468+
raise ValueError(
469+
f'Could not find "{METADATA_JSON.name}" file in draft release {release_url}'
470+
)
468471

469472
# Update environment variables.
470473
if "post_version_spec" in data:

0 commit comments

Comments
 (0)