Skip to content

Commit

Permalink
lint: Apply lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Douile committed Oct 22, 2023
1 parent 80f6b89 commit b4a30cf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@

_Disclamer: this project has no affiliation with the official Rust project or trademark._

Automate publishing Rust build artifacts for GitHub releases through GitHub Actions (Based on [go-release.action](https://github.com/ngs/go-release.action))
Automate publishing Rust build artifacts for GitHub releases through GitHub
Actions (Based on
[go-release.action](https://github.com/ngs/go-release.action))

For an example/template repo see [rust-build.test](https://github.com/rust-build/rust-build.test)
For an example/template repo see
[rust-build.test](https://github.com/rust-build/rust-build.test)

This action will only work when you release a project as it uploads the artifacts to the release.
This action will only work when you release a project as it uploads the
artifacts to the release.

## Environment variables

Expand Down Expand Up @@ -60,6 +64,7 @@ jobs:
```
### Build windows, linux and mac with native zip types
Will build native binaries for windows, linux and mac. Windows will upload as .zip, linux as .tar.gz, .tar.xz and
.tar.zst, and mac as .zip.
Expand Down Expand Up @@ -129,15 +134,18 @@ jobs:
_Many target triples do not work, see #4_
## Supported targets
- `x86_64-pc-windows-gnu`
- `x86_64-unknown-linux-musl`
- `wasm32-wasi`
- `x86_64-apple-darwin`

# Static linking
## Static linking

Some libraries (like openssl, see #49, #66, #79) don't statically link
correctly on alpine. If you experience issues you can try disabling static
linking with

Some libraries (like openssl, see #49, #66, #79) don't statically link correctly on alpine. If you
experience issues you can try disabling static linking with
```yml
- name: Compile
id: compile
Expand Down
3 changes: 3 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ for BINARY in $BINARIES; do
if [ -x "./build.sh" ]; then
OUTPUT=$(./build.sh "${CMD_PATH}" "${OUTPUT_DIR}")
else
# We need globbing here to expand the extra flags
# shellcheck disable=SC2086
OPENSSL_LIB_DIR=/usr/lib OPENSSL_INCLUDE_DIR=/usr/include/openssl PKG_CONFIG_PATH=/usr/lib/pkgconfig CARGO_TARGET_DIR="./target" cargo build --release --target "$RUSTTARGET" --bin "$BINARY" $EXTRA_COMMAND_FLAGS >&2
OUTPUT=$(find "target/${RUSTTARGET}/release/" -maxdepth 1 -type f -executable \( -name "${BINARY}" -o -name "${BINARY}.*" \) -print0 | xargs -0)
fi
Expand All @@ -98,6 +100,7 @@ for BINARY in $BINARIES; do

info "Saving $OUTPUT..."

# We need globbing here to move all files
# shellcheck disable=SC2086
mv $OUTPUT "$OUTPUT_DIR" || error "Unable to copy binary"

Expand Down

0 comments on commit b4a30cf

Please sign in to comment.