Skip to content

Commit

Permalink
Merge pull request #260 from DaveMcEwan/bundleRulesets
Browse files Browse the repository at this point in the history
Improvement: Bundle rulesets in release ZIP files.
  • Loading branch information
dalance authored Aug 9, 2023
2 parents 56108b8 + 24fd436 commit c373857
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 13 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:

jobs:
build_pdf:
Expand Down
39 changes: 30 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,39 @@ RELEASE_MANUAL := pdf/svlint_MANUAL_${VERSION}.pdf

release_lnx:
cargo build --release --target=x86_64-unknown-linux-musl
zip -j ${BIN_NAME}-${VERSION}-x86_64-lnx.zip \
${RELEASE_MANUAL} \
target/x86_64-unknown-linux-musl/release/${BIN_NAME}
rm -rf tmp
mkdir -p tmp/bin/ tmp/doc/
cp ${RELEASE_MANUAL} tmp/doc/
cp rulesets/*.toml tmp/bin/
cp $$(find rulesets/ -type f -perm -u+x) tmp/bin/
cp target/x86_64-unknown-linux-musl/release/${BIN_NAME} tmp/bin/
cd tmp/ && \
zip ${BIN_NAME}-${VERSION}-x86_64-lnx.zip -r *
mv tmp/${BIN_NAME}-${VERSION}-x86_64-lnx.zip ./
rm -rf tmp/

release_win:
cargo build --release --target=x86_64-pc-windows-msvc
7z a ${BIN_NAME}-${VERSION}-x86_64-win.zip \
${RELEASE_MANUAL} \
target/x86_64-pc-windows-msvc/release/${BIN_NAME}.exe
rm -rf tmp
mkdir -p tmp/bin/ tmp/doc/
cp ${RELEASE_MANUAL} tmp/doc/
cp rulesets/*.toml tmp/bin/
cp rulesets/*.cmd tmp/bin/
cp target/x86_64-pc-windows-msvc/release/${BIN_NAME}.exe tmp/bin/
cd tmp && \
7z a ${BIN_NAME}-${VERSION}-x86_64-win.zip *
mv tmp/${BIN_NAME}-${VERSION}-x86_64-win.zip ./
rm -rf tmp/

release_mac:
cargo build --release --target=x86_64-apple-darwin
zip -j ${BIN_NAME}-${VERSION}-x86_64-mac.zip \
${RELEASE_MANUAL} \
target/x86_64-apple-darwin/release/${BIN_NAME}
rm -rf tmp
mkdir -p tmp/bin/ tmp/doc/
cp ${RELEASE_MANUAL} tmp/doc/
cp rulesets/*.toml tmp/bin/
cp $$(find rulesets/ -type f -perm -u+x) tmp/bin/
cp target/x86_64-apple-darwin/release/${BIN_NAME} tmp/bin/
cd tmp/ && \
zip ${BIN_NAME}-${VERSION}-x86_64-mac.zip -r *
mv tmp/${BIN_NAME}-${VERSION}-x86_64-mac.zip ./
rm -rf tmp/
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,18 @@ Svlint is also integrated with most text editors via
## Installation

svlint can be installed in several ways:
- Download a [release](https://github.com/dalance/svlint/releases/latest), and
extract to a directory in your `$PATH`.
- Download a [release](https://github.com/dalance/svlint/releases/latest),
extract, and add the `bin/` directory to your `$PATH`.
A PDF copy of the MANUAL is included in the `doc/` directory.
- If you have a [Rust toolchain](https://www.rust-lang.org/tools/install), then
you can install the binary with [cargo](https://crates.io/crates/svlint), via
`cargo install svlint`.
This will copy the `svlint` binary (and the dev-only `mdgen` binary) to
([usually](https://doc.rust-lang.org/cargo/commands/cargo-install.html#description))
`~/.cargo/bin`, but not the wrapper scripts (e.g. `svlint-parseonly`) or
pre-written configurations (e.g. `parseonly.toml`) from `rulesets/`.
- [snapcraft](https://snapcraft.io/svlint), via
`sudo snap install svlint`.
- [cargo](https://crates.io/crates/svlint), via
`cargo install svlint`.


## Usage
Expand Down

0 comments on commit c373857

Please sign in to comment.