Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes CI artifacts and the manual-release workflow #556

Merged
merged 4 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Cross.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[build.env]
passthrough = ["RUSTFLAGS"]
passthrough = ["RUSTFLAGS", "OUCH_ARTIFACTS_FOLDER"]
8 changes: 7 additions & 1 deletion scripts/package-release-assets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down