mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-05 02:55:31 +00:00
Releases: restore previous directory structure (#805)
This commit is contained in:
parent
0b122fa05c
commit
c3ff0e963f
46
scripts/package-release-assets.sh
Executable file → Normal file
46
scripts/package-release-assets.sh
Executable file → Normal file
@ -8,7 +8,7 @@ cd downloaded_artifacts
|
|||||||
echo "entered 'downloaded_artifacts/'"
|
echo "entered 'downloaded_artifacts/'"
|
||||||
ls -lA -w 1
|
ls -lA -w 1
|
||||||
|
|
||||||
TARGETS=(
|
PLATFORMS=(
|
||||||
"aarch64-pc-windows-msvc"
|
"aarch64-pc-windows-msvc"
|
||||||
"aarch64-unknown-linux-gnu"
|
"aarch64-unknown-linux-gnu"
|
||||||
"aarch64-unknown-linux-musl"
|
"aarch64-unknown-linux-musl"
|
||||||
@ -20,41 +20,41 @@ TARGETS=(
|
|||||||
"x86_64-unknown-linux-gnu"
|
"x86_64-unknown-linux-gnu"
|
||||||
"x86_64-unknown-linux-musl"
|
"x86_64-unknown-linux-musl"
|
||||||
)
|
)
|
||||||
# Temporary, we'll remove allow_piped_choice later
|
# TODO: remove allow_piped_choice later
|
||||||
DEFAULT_FEATURES="allow_piped_choice+unrar+use_zlib+use_zstd_thin"
|
DEFAULT_FEATURES="allow_piped_choice+unrar+use_zlib+use_zstd_thin"
|
||||||
|
|
||||||
for target in "${TARGETS[@]}"; do
|
for platform in "${PLATFORMS[@]}"; do
|
||||||
input_dir="ouch-${target}-${DEFAULT_FEATURES}"
|
path="ouch-${platform}"
|
||||||
|
|
||||||
if [ ! -d "$input_dir" ]; then
|
if [ ! -d "$path" ]; then
|
||||||
echo "ERROR: Could not find artifact directory for $target with default features ($input_dir)"
|
echo "ERROR: Could not find artifact directory for $platform with default features ($path)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Processing $input_dir"
|
# remove the suffix
|
||||||
|
mv "ouch-${platform}-${DEFAULT_FEATURES}" "$path"
|
||||||
|
echo "Processing $path"
|
||||||
|
|
||||||
cp ../{README.md,LICENSE,CHANGELOG.md} "$input_dir"
|
cp ../{README.md,LICENSE,CHANGELOG.md} "$path"
|
||||||
mkdir -p "$input_dir/man"
|
mkdir -p "$path/man"
|
||||||
mkdir -p "$input_dir/completions"
|
mkdir -p "$path/completions"
|
||||||
|
|
||||||
mv "$input_dir"/man-page-and-completions-artifacts/*.1 "$input_dir/man"
|
mv "$path"/man-page-and-completions-artifacts/*.1 "$path/man"
|
||||||
mv "$input_dir"/man-page-and-completions-artifacts/* "$input_dir/completions"
|
mv "$path"/man-page-and-completions-artifacts/* "$path/completions"
|
||||||
rm -r "$input_dir/man-page-and-completions-artifacts"
|
rm -r "$path/man-page-and-completions-artifacts"
|
||||||
|
|
||||||
output_name="ouch-${target}"
|
if [[ "$platform" == *"-windows-"* ]]; then
|
||||||
|
mv "$path/target/$platform/release/ouch.exe" "$path"
|
||||||
|
rm -rf "$path/target"
|
||||||
|
|
||||||
if [[ "$target" == *"-windows-"* ]]; then
|
zip -r "../output_assets/${output_name}.zip" "$path"
|
||||||
mv "$input_dir/target/$target/release/ouch.exe" "$input_dir"
|
|
||||||
rm -rf "$input_dir/target"
|
|
||||||
|
|
||||||
zip -r "../output_assets/${output_name}.zip" "$input_dir"
|
|
||||||
echo "Created output_assets/${output_name}.zip"
|
echo "Created output_assets/${output_name}.zip"
|
||||||
else
|
else
|
||||||
mv "$input_dir/target/$target/release/ouch" "$input_dir"
|
mv "$path/target/$platform/release/ouch" "$path"
|
||||||
rm -rf "$input_dir/target"
|
rm -rf "$path/target"
|
||||||
chmod +x "$input_dir/ouch"
|
chmod +x "$path/ouch"
|
||||||
|
|
||||||
tar czf "../output_assets/${output_name}.tar.gz" "$input_dir"
|
tar czf "../output_assets/${output_name}.tar.gz" "$path"
|
||||||
echo "Created output_assets/${output_name}.tar.gz"
|
echo "Created output_assets/${output_name}.tar.gz"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user