From 9918693037dce8aa4bb6f08741b6812923486c18 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 19 Jun 2024 11:26:03 +0200 Subject: Merging upstream version 1.76.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/mdbook/ci/install-hub.sh | 24 --------------- vendor/mdbook/ci/make-release-asset.sh | 53 ++++++++++++++++++++++++++++++++++ vendor/mdbook/ci/make-release.sh | 52 --------------------------------- 3 files changed, 53 insertions(+), 76 deletions(-) delete mode 100755 vendor/mdbook/ci/install-hub.sh create mode 100755 vendor/mdbook/ci/make-release-asset.sh delete mode 100755 vendor/mdbook/ci/make-release.sh (limited to 'vendor/mdbook/ci') diff --git a/vendor/mdbook/ci/install-hub.sh b/vendor/mdbook/ci/install-hub.sh deleted file mode 100755 index 38da2c8cb..000000000 --- a/vendor/mdbook/ci/install-hub.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash -# Installs the `hub` executable into hub/bin -set -ex -case $1 in - ubuntu*) - curl -LsSf https://github.com/github/hub/releases/download/v2.12.8/hub-linux-amd64-2.12.8.tgz -o hub.tgz - mkdir hub - tar -xzvf hub.tgz --strip=1 -C hub - ;; - macos*) - curl -LsSf https://github.com/github/hub/releases/download/v2.12.8/hub-darwin-amd64-2.12.8.tgz -o hub.tgz - mkdir hub - tar -xzvf hub.tgz --strip=1 -C hub - ;; - windows*) - curl -LsSf https://github.com/github/hub/releases/download/v2.12.8/hub-windows-amd64-2.12.8.zip -o hub.zip - 7z x hub.zip -ohub - ;; - *) - echo "OS should be first parameter, was: $1" - ;; -esac - -echo "$PWD/hub/bin" >> $GITHUB_PATH diff --git a/vendor/mdbook/ci/make-release-asset.sh b/vendor/mdbook/ci/make-release-asset.sh new file mode 100755 index 000000000..1fb06ce81 --- /dev/null +++ b/vendor/mdbook/ci/make-release-asset.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash +# Builds the release and creates an archive and optionally deploys to GitHub. +set -ex + +if [[ -z "$GITHUB_REF" ]] +then + echo "GITHUB_REF must be set" + exit 1 +fi +# Strip mdbook-refs/tags/ from the start of the ref. +TAG=${GITHUB_REF#*/tags/} + +host=$(rustc -Vv | grep ^host: | sed -e "s/host: //g") +target=$2 +if [ "$host" != "$target" ] +then + export "CARGO_TARGET_$(echo $target | tr a-z- A-Z_)_LINKER"=rust-lld +fi +export CARGO_PROFILE_RELEASE_LTO=true +cargo build --locked --bin mdbook --release --target $target +cd target/$target/release +case $1 in + ubuntu*) + asset="mdbook-$TAG-$target.tar.gz" + tar czf ../../$asset mdbook + ;; + macos*) + asset="mdbook-$TAG-$target.tar.gz" + # There is a bug with BSD tar on macOS where the first 8MB of the file are + # sometimes all NUL bytes. See https://github.com/actions/cache/issues/403 + # and https://github.com/rust-lang/cargo/issues/8603 for some more + # information. An alternative solution here is to install GNU tar, but + # flushing the disk cache seems to work, too. + sudo /usr/sbin/purge + tar czf ../../$asset mdbook + ;; + windows*) + asset="mdbook-$TAG-$target.zip" + 7z a ../../$asset mdbook.exe + ;; + *) + echo "OS should be first parameter, was: $1" + ;; +esac +cd ../.. + +if [[ -z "$GITHUB_ENV" ]] +then + echo "GITHUB_ENV not set, run: gh release upload $TAG target/$asset" +else + echo "MDBOOK_TAG=$TAG" >> $GITHUB_ENV + echo "MDBOOK_ASSET=target/$asset" >> $GITHUB_ENV +fi diff --git a/vendor/mdbook/ci/make-release.sh b/vendor/mdbook/ci/make-release.sh deleted file mode 100755 index 64ef84b92..000000000 --- a/vendor/mdbook/ci/make-release.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env bash -# Builds the release and creates an archive and optionally deploys to GitHub. -set -ex - -if [[ -z "$GITHUB_REF" ]] -then - echo "GITHUB_REF must be set" - exit 1 -fi -# Strip mdbook-refs/tags/ from the start of the ref. -TAG=${GITHUB_REF#*/tags/} - -host=$(rustc -Vv | grep ^host: | sed -e "s/host: //g") -target=$2 -if [ "$host" != "$target" ] -then - export "CARGO_TARGET_$(echo $target | tr a-z- A-Z_)_LINKER"=rust-lld -fi -export CARGO_PROFILE_RELEASE_LTO=true -cargo build --locked --bin mdbook --release --target $target -cd target/$target/release -case $1 in - ubuntu*) - asset="mdbook-$TAG-$target.tar.gz" - tar czf ../../$asset mdbook - ;; - macos*) - asset="mdbook-$TAG-$target.tar.gz" - # There is a bug with BSD tar on macOS where the first 8MB of the file are - # sometimes all NUL bytes. See https://github.com/actions/cache/issues/403 - # and https://github.com/rust-lang/cargo/issues/8603 for some more - # information. An alternative solution here is to install GNU tar, but - # flushing the disk cache seems to work, too. - sudo /usr/sbin/purge - tar czf ../../$asset mdbook - ;; - windows*) - asset="mdbook-$TAG-$target.zip" - 7z a ../../$asset mdbook.exe - ;; - *) - echo "OS should be first parameter, was: $1" - ;; -esac -cd ../.. - -if [[ -z "$GITHUB_TOKEN" ]] -then - echo "$GITHUB_TOKEN not set, skipping deploy." -else - hub release edit -m "" --attach $asset $TAG -fi -- cgit v1.2.3