diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 90eb1c6e..13dc2cb5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -132,7 +132,7 @@ jobs: run: | ./script/install-dependencies.sh python -m pip install -r docs-requirements.txt - python -m pip install --upgrade Jinja2 wheel twine + python -m pip install --upgrade Jinja2 build wheel twine - name: Build shell completions run: ./script/build-shell-completions.sh - name: Build man page diff --git a/script/build-and-sign.sh b/script/build-and-sign.sh index c25cf38b..f0ebe8d8 100755 --- a/script/build-and-sign.sh +++ b/script/build-and-sign.sh @@ -3,12 +3,10 @@ shopt -s nullglob set -e -for dep in setuptools wheel; do - if ! python -m pip -q show "${dep}"; then - echo "build: missing dependency '${dep}'" >&2; - exit 1; - fi -done +if ! python -m pip -q show "build"; then + echo >&2 "build: missing dependency 'build'" + exit 1 +fi KEY_ID=${SIGNING_KEY_ID:-2E390FA0} @@ -22,20 +20,20 @@ wheel_platforms_windows=("win32" "win-amd64") mkdir -p "${dist_dir}" -echo "build: Building Streamlink sdist" >&2 -python setup.py sdist --dist-dir "${dist_dir}" +echo >&2 "build: Building Streamlink sdist" +python -m build --outdir "${dist_dir}" --sdist -echo "build: Building Streamlink bdist_wheel" >&2 -python setup.py bdist_wheel --dist-dir "${dist_dir}" +echo >&2 "build: Building Streamlink wheel" +python -m build --outdir "${dist_dir}" --wheel for platform in "${wheel_platforms_windows[@]}"; do - echo "build: Building Streamlink bdist_wheel (${platform})" >&2 - python setup.py bdist_wheel --plat-name "${platform}" --dist-dir "${dist_dir}" + echo >&2 "build: Building Streamlink wheel (${platform})" + python -m build --outdir "${dist_dir}" --wheel --config-setting="--build-option=--plat-name=${platform}" done if [[ "${CI}" = true ]] || [[ -n "${GITHUB_ACTIONS}" ]]; then - echo "build: Decrypting signing key" >&2 + echo >&2 "build: Decrypting signing key" gpg --quiet --batch --yes --decrypt \ --passphrase="${RELEASE_KEY_PASSPHRASE}" \ --output "${KEY_FILE}" \ @@ -43,9 +41,9 @@ if [[ "${CI}" = true ]] || [[ -n "${GITHUB_ACTIONS}" ]]; then fi if ! [[ -f "${KEY_FILE}" ]]; then - echo "warning: No signing key, files not signed" >&2 + echo >&2 "warning: No signing key, files not signed" else - echo "build: Signing sdist and wheel files" >&2 + echo >&2 "build: Signing sdist and wheel files" temp_keyring=$(mktemp -d) && trap "rm -rf ${temp_keyring}" EXIT || exit 255 gpg --homedir "${temp_keyring}" --import "${KEY_FILE}" 2>&1 >/dev/null for file in "${dist_dir}"/streamlink-"${version}"{.tar.gz,-*.whl}; do