mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-07 12:05:46 +00:00
move adjustments
This commit is contained in:
parent
0d3b398014
commit
aa28d7c54a
@ -136,7 +136,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
${{ env.CARGO }} +stable build --release --target ${{ matrix.target }} $EXTRA_CARGO_FLAGS
|
${{ env.CARGO }} +stable build --release --target ${{ matrix.target }} $EXTRA_CARGO_FLAGS
|
||||||
env:
|
env:
|
||||||
OUCH_ARTIFACTS_FOLDER: artifacts
|
OUCH_ARTIFACTS_FOLDER: man-page-and-completions-artifacts
|
||||||
|
|
||||||
- name: Upload release artifacts
|
- name: Upload release artifacts
|
||||||
if: |
|
if: |
|
||||||
|
@ -34,4 +34,4 @@ jobs:
|
|||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
draft: true
|
draft: true
|
||||||
files: assets/ouch-*
|
files: output_assets/ouch-*
|
||||||
|
@ -70,7 +70,7 @@ regex = "1.10.4"
|
|||||||
test-strategy = "0.4.0"
|
test-strategy = "0.4.0"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["use_zlib", "use_zstd_thin", "unrar"]
|
default = ["unrar", "use_zlib", "use_zstd_thin"]
|
||||||
use_zlib = ["flate2/zlib", "gzp/deflate_zlib", "zip/deflate-zlib"]
|
use_zlib = ["flate2/zlib", "gzp/deflate_zlib", "zip/deflate-zlib"]
|
||||||
use_zstd_thin = ["zstd/thin"]
|
use_zstd_thin = ["zstd/thin"]
|
||||||
allow_piped_choice = []
|
allow_piped_choice = []
|
||||||
|
10
build.rs
10
build.rs
@ -5,18 +5,12 @@
|
|||||||
/// Set `OUCH_ARTIFACTS_FOLDER` to the name of the destination folder:
|
/// Set `OUCH_ARTIFACTS_FOLDER` to the name of the destination folder:
|
||||||
///
|
///
|
||||||
/// ```sh
|
/// ```sh
|
||||||
/// OUCH_ARTIFACTS_FOLDER=my-folder cargo build
|
/// OUCH_ARTIFACTS_FOLDER=man-page-and-completions-artifacts cargo build
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// All completion files will be generated inside of the folder "my-folder".
|
/// All completion files will be generated inside of the folder "man-page-and-completions-artifacts".
|
||||||
///
|
///
|
||||||
/// If the folder does not exist, it will be created.
|
/// If the folder does not exist, it will be created.
|
||||||
///
|
|
||||||
/// We recommend you naming this folder "artifacts" for the sake of consistency.
|
|
||||||
///
|
|
||||||
/// ```sh
|
|
||||||
/// OUCH_ARTIFACTS_FOLDER=artifacts cargo build
|
|
||||||
/// ```
|
|
||||||
use std::{
|
use std::{
|
||||||
env,
|
env,
|
||||||
fs::{create_dir_all, File},
|
fs::{create_dir_all, File},
|
||||||
|
@ -1,28 +1,57 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
mkdir -p output_assets
|
||||||
cd downloaded_artifacts
|
cd downloaded_artifacts
|
||||||
mkdir ../assets
|
|
||||||
|
|
||||||
for input_dir in ouch-*; do
|
TARGETS=(
|
||||||
|
"aarch64-pc-windows-msvc"
|
||||||
|
"aarch64-unknown-linux-gnu"
|
||||||
|
"aarch64-unknown-linux-musl"
|
||||||
|
"armv7-unknown-linux-gnueabihf"
|
||||||
|
"armv7-unknown-linux-musleabihf"
|
||||||
|
"x86_64-apple-darwin"
|
||||||
|
"x86_64-pc-windows-gnu"
|
||||||
|
"x86_64-pc-windows-msvc"
|
||||||
|
"x86_64-unknown-linux-gnu"
|
||||||
|
"x86_64-unknown-linux-musl"
|
||||||
|
)
|
||||||
|
DEFAULT_FEATURES="unrar+use_zlib+use_zstd_thin"
|
||||||
|
|
||||||
|
for target in "${TARGETS[@]}"; do
|
||||||
|
input_dir="ouch-${target}-${DEFAULT_FEATURES}"
|
||||||
|
|
||||||
|
if [ ! -d "$input_dir" ]; then
|
||||||
|
echo "ERROR: Could not find artifact directory for $target with default features ($input_dir)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Processing $input_dir"
|
||||||
|
|
||||||
cp ../{README.md,LICENSE,CHANGELOG.md} "$input_dir"
|
cp ../{README.md,LICENSE,CHANGELOG.md} "$input_dir"
|
||||||
mkdir "$input_dir/man"
|
mkdir -p "$input_dir/man"
|
||||||
mkdir "$input_dir/artifacts"
|
mkdir -p "$input_dir/completions"
|
||||||
|
|
||||||
mv "$input_dir"/artifacts/*.1 "$input_dir/man"
|
mv "$input_dir"/man-page-and-completions-artifacts/*.1 "$input_dir/man"
|
||||||
mv "$input_dir"/artifacts/* "$input_dir/completions"
|
mv "$input_dir"/man-page-and-completions-artifacts/* "$input_dir/completions"
|
||||||
rm -r "$input_dir/artifacts"
|
rm -r "$input_dir/man-page-and-completions-artifacts"
|
||||||
|
|
||||||
if [[ "$input_dir" = *.exe ]]; then
|
output_name="ouch-${target}"
|
||||||
target=${input_dir%.exe}
|
|
||||||
mv "$input_dir/target/${target/ouch-/}/release/ouch.exe" "$input_dir"
|
if [[ "$target" == *"-windows-"* ]]; then
|
||||||
rm -r "$input_dir/target"
|
mv "$input_dir/target/$target/release/ouch.exe" "$input_dir"
|
||||||
mv "$input_dir" "$target"
|
rm -rf "$input_dir/target"
|
||||||
zip -r "../assets/$target.zip" "$target"
|
|
||||||
|
zip -r "../output_assets/${output_name}.zip" "$input_dir"
|
||||||
|
echo "Created output_assets/${output_name}.zip"
|
||||||
else
|
else
|
||||||
mv "$input_dir/target/${input_dir/ouch-/}/release/ouch" "$input_dir"
|
mv "$input_dir/target/$target/release/ouch" "$input_dir"
|
||||||
rm -r "$input_dir/target"
|
rm -rf "$input_dir/target"
|
||||||
chmod +x "$input_dir/ouch"
|
chmod +x "$input_dir/ouch"
|
||||||
tar czf "../assets/$input_dir.tar.gz" "$input_dir"
|
|
||||||
|
tar czf "../output_assets/${output_name}.tar.gz" "$input_dir"
|
||||||
|
echo "Created output_assets/${output_name}.tar.gz"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo "Done."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user