diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2aafcdf..fffc758 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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). diff --git a/fetch_release.py b/fetch_release.py index 216c298..100efe2 100644 --- a/fetch_release.py +++ b/fetch_release.py @@ -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 @@ -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}")