mirror of
https://github.com/lexmount/moli.git
synced 2026-10-03 00:00:44 +00:00
fix(release): restore bookworm build environment
This commit is contained in:
@@ -94,7 +94,7 @@ jobs:
|
||||
runner: ubuntu-24.04-arm
|
||||
target: aarch64-unknown-linux-gnu
|
||||
artifact: release-linux-aarch64
|
||||
container: rust:1.96.1-bullseye
|
||||
container: rust:1.96.1-bookworm
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
+9
-35
@@ -4,7 +4,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import shlex
|
||||
@@ -13,6 +12,7 @@ import subprocess
|
||||
import sys
|
||||
import tarfile
|
||||
import tempfile
|
||||
import tomllib
|
||||
import zipfile
|
||||
from pathlib import Path
|
||||
from typing import Sequence
|
||||
@@ -72,41 +72,15 @@ def normalize_version(raw_version: str) -> str:
|
||||
|
||||
|
||||
def manifest_version() -> str:
|
||||
output = run_checked(
|
||||
[
|
||||
"cargo",
|
||||
"metadata",
|
||||
"--format-version",
|
||||
"1",
|
||||
"--no-deps",
|
||||
"--manifest-path",
|
||||
str(MANIFEST_PATH),
|
||||
],
|
||||
capture_output=True,
|
||||
).stdout
|
||||
with MANIFEST_PATH.open("rb") as manifest_file:
|
||||
manifest = tomllib.load(manifest_file)
|
||||
try:
|
||||
metadata = json.loads(output)
|
||||
except json.JSONDecodeError as error:
|
||||
raise ReleaseError("cargo metadata returned an invalid package list") from error
|
||||
packages = metadata.get("packages") if isinstance(metadata, dict) else None
|
||||
if not isinstance(packages, list):
|
||||
raise ReleaseError("cargo metadata returned an invalid package list")
|
||||
|
||||
for package in packages:
|
||||
if not isinstance(package, dict):
|
||||
continue
|
||||
if package.get("name") != "moli":
|
||||
continue
|
||||
manifest_path = package.get("manifest_path")
|
||||
version = package.get("version")
|
||||
if (
|
||||
isinstance(manifest_path, str)
|
||||
and Path(manifest_path).resolve() == MANIFEST_PATH
|
||||
and isinstance(version, str)
|
||||
):
|
||||
return version
|
||||
|
||||
raise ReleaseError(f"package.version is missing from {MANIFEST_PATH}")
|
||||
value = manifest["package"]["version"]
|
||||
except (KeyError, TypeError) as error:
|
||||
raise ReleaseError(f"package.version is missing from {MANIFEST_PATH}") from error
|
||||
if not isinstance(value, str):
|
||||
raise ReleaseError(f"package.version in {MANIFEST_PATH} is not a string")
|
||||
return value
|
||||
|
||||
|
||||
def rust_host_target() -> str:
|
||||
|
||||
Reference in New Issue
Block a user