Skip to content
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
45 changes: 32 additions & 13 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ jobs:
TARGET_DIR: target/release
ARTIFACT_DIR: target/artifacts
ARTIFACT_NAME: solrcopy-${{ inputs.release_version_tag || github.event.release.tag_name }}-${{ matrix.target }}

steps:
# region Workflow information

- name: Checkout sources
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch_commit_or_ref || '' }}

- name: Report Workflow Information
id: workflow_report
uses: ./.github/actions/workflow-info
Expand All @@ -67,7 +67,7 @@ jobs:
- Upload URL: ${{ github.event.release.upload_url }}

# endregion

# region Compiling

- name: Rustup Self Update
Expand All @@ -76,7 +76,7 @@ jobs:
run: |
rustup self update

- name: Update Rust toolchain from channel ${{ matrix.channel }}
- name: Update Rust toolchain from channel ${{ matrix.channel }}
shell: bash
run: |
rustup update ${{ matrix.channel }}
Expand All @@ -93,10 +93,10 @@ jobs:
- name: Install cargo plugins
if: matrix.platform == 'linux'
shell: bash
run: cargo install cargo-deb cargo-generate-rpm
run: cargo install cargo-deb cargo-generate-rpm cargo-get

# endregion

# region Compiling

- name: Create local artifact folders
Expand All @@ -114,9 +114,9 @@ jobs:
run: cargo build --release

# endregion

# region Packaging

- name: Make a tar package for release (linux and macos)
if: matrix.platform == 'linux' || matrix.platform == 'macos'
shell: bash
Expand All @@ -126,7 +126,7 @@ jobs:
if: matrix.platform == 'linux'
shell: bash
run: cargo deb --profile release --verbose --no-build --output ${{ env.ARTIFACT_DIR }}/${{ env.ARTIFACT_NAME }}.deb

- name: Make a rpm package
if: matrix.platform == 'linux'
shell: bash
Expand All @@ -141,9 +141,19 @@ jobs:
7z a -y -tzip ${{ env.ARTIFACT_DIR }}/${{ env.ARTIFACT_NAME }}.zip ${{ env.TARGET_DIR }}/solrcopy.exe

# endregion

# region Upload Artifact


# region Upload Artifacts

- name: Check release version number before publishing
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
CARGO_VERSION=$(cargo get package.version --pretty)
echo "CARGO_VERSION=$CARGO_VERSION"
echo "RELEASE_VERSION=${{ env.RELEASE_VERSION }}"

test "$CARGO_VERSION" = "${{ env.RELEASE_VERSION }}"

- name: Upload Debian, RPM and tar.gz Packages
if: matrix.platform == 'linux'
env:
Expand Down Expand Up @@ -178,4 +188,13 @@ jobs:

# endregion

# region Publish

- name: Publish to crates.io
if: matrix.os == 'ubuntu-latest'
shell: bash
run: cargo publish --all-features --token "${{ secrets.CRATESIO_GITHUB_SOLRCOPY_PUBLISH }}"

# endregion

# end of file
15 changes: 12 additions & 3 deletions .github/workflows/build-test-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ jobs:

printf '\n## Future Incompatibilities Report\n\n' >> "${GITHUB_STEP_SUMMARY}";

if cargo report future-incompatibilities --color never >> "${GITHUB_STEP_SUMMARY}"; then
if cargo report future-incompatibilities --color never >> "${GITHUB_STEP_SUMMARY}"; then
echo "FUTURE_INCOMPATIBILITIES=1" >> "${GITHUB_OUTPUT}";
echo "::warning file=Cargo.toml,line=15,col=2,endColumn=24,title=FUTURE-INCOMPATIBILITIES::Future imcompatibilities found in source code or dependencies.";
false;
Expand Down Expand Up @@ -193,7 +193,7 @@ jobs:
- name: Run coverage report
if: matrix.os == 'ubuntu-latest'
shell: bash
run: cargo llvm-cov --all-features --workspace --lcov --no-cfg-coverage-nightly --output-path lcov.info
run: cargo llvm-cov --all-features --lcov --output-path lcov.info

- name: Coveralls
if: matrix.os == 'ubuntu-latest'
Expand All @@ -210,6 +210,15 @@ jobs:

# endregion

# region Test Publishing

- name: Verify if source code is ready to publish to crates.io
if: matrix.os == 'ubuntu-latest'
shell: bash
run: cargo publish --all-features --dry-run

# endregion

deps:
needs: ci
runs-on: ubuntu-latest
Expand All @@ -225,7 +234,7 @@ jobs:
with:
ref: ${{ inputs.branch_commit_or_ref || '' }}

- name: Update Rust toolchain from channel ${{ matrix.channel }}
- name: Update Rust toolchain from channel ${{ matrix.channel }}
shell: bash
run: |
rustup self update
Expand Down
35 changes: 27 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,34 @@
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
// Search settings
// Browse/Watch/Search settings
"files.exclude": {
"**/node_modules/*": true,
"**/.git": true,
"**/.ssh": true,
"**/*.lock": true
},
"search.exclude": {
"node_modules/**/*": true,
"target/**/*": true,
"sketch/**/*": true,
"**/sketch*": true,
"**/*sketch.*": true,
"**/.log": true,
"**/.lock": true
"**/node_modules/*": true,
"**/target/*": true,
"**/tmp": true,
"**/temp": true,
"**/.git": true,
"**/.ssh": true,
"**/.tmp": true,
"**/*.log": true,
"**/*.lock": true
},
"files.watcherExclude": {
"**/node_modules/*": true,
"**/target/*": true,
"**/tmp": true,
"**/temp": true,
"**/.git": true,
"**/.ssh": true,
"**/.tmp": true,
"**/*.log": true,
"**/*.lock": true
},
// Controls whether the coverage toolbar is shown in the editor.
"testing.coverageToolbarEnabled": true,
Expand Down
32 changes: 28 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
[package]
name = "solrcopy"
version = "0.7.0"
version = "0.8.1"
edition = "2024"
rust-version = "1.85.1"

authors = ["Juarez Rudsatz <juarezr@gmail.com>"]
description = "Command line tool useful for migration, transformations, backup, and restore of documents stored inside cores of Apache Solr"
homepage = "https://github.com/juarezr/solrcopy"
repository = "https://github.com/juarezr/solrcopy"
license = "gpl-3.0-or-later"
documentation = "https://docs.rs/solrcopy"
license = "GPL-3.0-only"
# license-file = "LICENSE"

readme = "README.md"
categories = ["command-line-utilities"]
keywords = ["solr", "dataimport", "dih", "fulltext-search", "apache-solr", "data-engineering"]
keywords = ["solr", "dataimport", "fulltext-search", "apache-solr", "data-engineering"]

exclude = [
".vscode/",
".github/",
"coverage/",
"sketch/",
"Cargo.lock",
"**/sketch*",
"**/*.log",
"**/*.zip",
]

[dependencies]
clap = { version = "4.5.*", features = ["derive", "env", "color"] }
Expand Down Expand Up @@ -46,6 +60,16 @@ travis-ci = { repository = "juarezr/solrcopy", branch = "master" }
strip = "debuginfo"
lto = true

[[bin]]
path = "src/main.rs"
name = "solrcopy"
bench = false
test = true
doc = true

[lints.rust]
unsafe_code = "forbid"

# Shell completions are generated by running:
# $ cargo run --release -- completion -all -o target

Expand Down Expand Up @@ -82,7 +106,7 @@ assets = [
{ source = "target/assets/solrcopy.bash", dest = "/usr/share/bash-completion/completions/solrcopy", mode = "644" },
{ source = "target/assets/solrcopy.fish", dest = "/usr/share/fish/vendor_completions.d/solrcopy.fish", mode = "644" },
{ source = "target/assets/_solrcopy", dest = "/usr/share/zsh/vendor-completions/", mode = "644" },
{ source = "target/assets/solrcopy.1", dest = "/usr/share/man/man1/", mode = "644"},
{ source = "target/assets/solrcopy.1", dest = "/usr/share/man/man1/", mode = "644" },
]

# [profile.release]
Expand Down
37 changes: 21 additions & 16 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,7 @@ run_task = { name = [
category = "Test Coverage"
description = "Generate coverage for the source code test that does not require Solr"
command = "cargo"
args = [
"llvm-cov",
"--lcov",
"--output-path",
"coverage/lcov.info",
]
args = ["llvm-cov", "--lcov", "--output-path", "target/lcov.info"]

[tasks.coverage-full]
category = "Test Coverage"
Expand All @@ -145,20 +140,14 @@ args = [
"--all-features",
"--lcov",
"--output-path",
"coverage/lcov.info",
"target/lcov.info",
]

[tasks.coverage-report]
category = "Test Coverage"
description = "Generate a coverage report while testing Solr"
command = "cargo"
args = [
"llvm-cov",
"--all-features",
"--html",
"--output-dir",
"coverage",
]
args = ["llvm-cov", "--all-features", "--html", "--output-dir", "target/coverage-report"]

[tasks.coverage]
category = "Test Coverage"
Expand All @@ -170,14 +159,30 @@ run_task = { name = [

#endregion Coverage

#region Lint
#region Publish

[tasks.clean]
category = "Lint"
category = "Publish"
description = "Clean all compiled artifacts"
command = "cargo"
args = ["clean"]

[tasks.verify]
category = "Publish"
description = "Verify packaging"
command = "cargo"
args = ["publish", "--dry-run", "--allow-dirty"]

[tasks.publish]
category = "Publish"
description = "Publish to crates.io"
command = "cargo"
args = ["publish"]

#endregion Publish

#region Lint

[tasks.check-compile]
category = "Lint"
description = "Check if the source code compiles"
Expand Down
28 changes: 28 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
debian (0.8.0) stable; urgency=low

* improved: added --archive-compression flag to the backup command
* improved: added ability to use .env file by @paulheijman
* chore: added comprehensive Makefile.toml with organized task categories
* chore: added VS Code settings with recommended extensions

-- Juarez Rudsatz <juarezr@gmail.com> Thu, 8 Oct 2025 00:08:00 -0300

debian (0.7.1) stable; urgency=low

* improved: add option to exclude fields by @paulheijman
* improved: added fq option by @paulheijman
* improved: added ability to use .env file by @paulheijman
* chore: upgraded rust crates to latest version
* chore: added verification of Rust MSRV

-- Juarez Rudsatz <juarezr@gmail.com> Thu, 18 Set 2025 00:07:01 -0300

debian (0.6.12) stable; urgency=low

* ci: refactored improved github action workflows
* chore: upgraded dependencies to latest version
* chore: Upgrade to edition 2024
* chore: fix: small errors by @0xflotus

-- Juarez Rudsatz <juarezr@gmail.com> Wed, 19 Mar 2025 00:06:12 -0300

debian (0.6.0) stable; urgency=low

* improved: upgraded clap to 4.5
Expand Down
Loading