From 93e04d6659be16c4ad46d897f6934c983aa057a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Collonval?= Date: Tue, 13 Sep 2022 09:32:43 +0200 Subject: [PATCH 1/3] Ignore metadata.json when checking sha --- jupyter_releaser/lib.py | 4 ++-- jupyter_releaser/util.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/jupyter_releaser/lib.py b/jupyter_releaser/lib.py index 529fe579..645cb2bc 100644 --- a/jupyter_releaser/lib.py +++ b/jupyter_releaser/lib.py @@ -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) @@ -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 diff --git a/jupyter_releaser/util.py b/jupyter_releaser/util.py index 29b3c9f3..58f5aecd 100644 --- a/jupyter_releaser/util.py +++ b/jupyter_releaser/util.py @@ -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" @@ -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}...") @@ -464,7 +465,7 @@ 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: From ee9f075604021117d4eac89576c4e3b977691a92 Mon Sep 17 00:00:00 2001 From: Frederic COLLONVAL Date: Tue, 13 Sep 2022 09:54:43 +0200 Subject: [PATCH 2/3] Add target to Full Release workflow --- .github/workflows/full-release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/full-release.yml b/.github/workflows/full-release.yml index 9a08df3a..449a6c1d 100644 --- a/.github/workflows/full-release.yml +++ b/.github/workflows/full-release.yml @@ -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 **" From 3124bafc5129c87ac1f7fb49f8382ce961e6bb3a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 13 Sep 2022 07:58:19 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- jupyter_releaser/util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jupyter_releaser/util.py b/jupyter_releaser/util.py index 58f5aecd..b4843f22 100644 --- a/jupyter_releaser/util.py +++ b/jupyter_releaser/util.py @@ -465,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.name}" 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: