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

Fix publish-release #378

Merged
merged 3 commits into from
Sep 13, 2022
Merged
Show file tree
Hide file tree
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
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