Skip to content

Commit

Permalink
Merge pull request #69 from Hind-M/fix_rel_latest
Browse files Browse the repository at this point in the history
Make latest only with major releases ==2
  • Loading branch information
Hind-M authored Nov 26, 2024
2 parents 19b523b + 242e05a commit ece4972
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
with:
name: "micromamba ${{ steps.fetch-release.outputs.MICROMAMBA_VERSION }}"
prerelease: ${{ steps.fetch-release.outputs.MICROMAMBA_NEW_PRERELEASE == 'true' }}
make_latest: ${{ steps.fetch-release.outputs.MICROMAMBA_LATEST }}
body: |
Release artifacts for micromamba ${{ steps.fetch-release.outputs.MICROMAMBA_VERSION }}, mirrored from conda-forge.
The full changelog can be found [here](https://github.com/mamba-org/mamba/releases).
Expand Down
14 changes: 11 additions & 3 deletions fetch_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ def get_micromamba(version, use_default_version):
assert len(all_versions) == 1
version = all_versions.pop()

if use_default_version and ((v := Version(version)).is_devrelease or v.is_prerelease):
v = Version(version)
is_stable = not (v.is_devrelease or v.is_prerelease)

if use_default_version and not is_stable:
print(f"Skipping dev and pre releases version '{version}'")
set_output("MICROMAMBA_NEW_VERSION", "false")
return
Expand Down Expand Up @@ -142,10 +145,15 @@ def get_micromamba(version, use_default_version):
with open(shafile, "w") as f:
f.write(sha256.hexdigest())

if (v := Version(version)).is_devrelease or v.is_prerelease:
if is_stable:
set_output("MICROMAMBA_NEW_PRERELEASE", "false")
else:
set_output("MICROMAMBA_NEW_PRERELEASE", "true")

if is_stable and v.major == 2:
set_output("MICROMAMBA_LATEST", "true")
else:
set_output("MICROMAMBA_NEW_PRERELEASE", "false")
set_output("MICROMAMBA_LATEST", "false")

set_output("MICROMAMBA_NEW_VERSION", "true")
set_output("MICROMAMBA_VERSION", f"{version}-{build_number}")
Expand Down

0 comments on commit ece4972

Please sign in to comment.