diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index fee42b6a3..d7a24c009 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -91,18 +91,14 @@ jobs: OUCH_ARTIFACTS_FOLDER: artifacts RUSTFLAGS: -C strip=symbols - - name: Upload binary + - name: Upload artifacts uses: actions/upload-artifact@v3 with: name: ouch-${{ matrix.target }}${{ matrix.ext }} - path: target/${{ matrix.target }}/release/ouch${{ matrix.ext }} + path: | + target/${{ matrix.target }}/release/ouch${{ matrix.ext }} + artifacts/ - - name: Upload artifacts (musl) - if: matrix.target == 'x86_64-unknown-linux-musl' - uses: actions/upload-artifact@v3 - with: - name: artifacts - path: artifacts clippy-rustfmt: name: clippy-rustfmt diff --git a/Cross.toml b/Cross.toml index 1a4557b51..f9c026f64 100644 --- a/Cross.toml +++ b/Cross.toml @@ -1,2 +1,2 @@ [build.env] -passthrough = ["RUSTFLAGS"] +passthrough = ["RUSTFLAGS", "OUCH_ARTIFACTS_FOLDER"] diff --git a/scripts/package-release-assets.sh b/scripts/package-release-assets.sh index d9875abb7..c2e1ba9cb 100755 --- a/scripts/package-release-assets.sh +++ b/scripts/package-release-assets.sh @@ -6,16 +6,22 @@ mkdir release cd artifacts for dir in ouch-*; do - cp -r artifacts "$dir/completions" + cp -r "$dir/artifacts" "$dir/completions" mkdir "$dir/man" mv "$dir"/completions/*.1 "$dir/man" + cp ../{README.md,LICENSE,CHANGELOG.md} "$dir" + rm -r "$dir/artifacts" if [[ "$dir" = *.exe ]]; then target=${dir%.exe} + mv "$dir/target/${target/ouch-/}/release/ouch.exe" "$dir" + rm -r "$dir/target" mv "$dir" "$target" zip -r "../release/$target.zip" "$target" else + mv "$dir/target/${dir/ouch-/}/release/ouch" "$dir" + rm -r "$dir/target" chmod +x "$dir/ouch" tar czf "../release/$dir.tar.gz" "$dir" fi