diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 321e98f..210b8d5 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -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 @@ -67,7 +67,7 @@ jobs: - Upload URL: ${{ github.event.release.upload_url }} # endregion - + # region Compiling - name: Rustup Self Update @@ -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 }} @@ -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 @@ -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 @@ -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 @@ -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: @@ -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 diff --git a/.github/workflows/build-test-and-lint.yml b/.github/workflows/build-test-and-lint.yml index 273ed48..1c0034a 100644 --- a/.github/workflows/build-test-and-lint.yml +++ b/.github/workflows/build-test-and-lint.yml @@ -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; @@ -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' @@ -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 @@ -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 diff --git a/.vscode/settings.json b/.vscode/settings.json index 04ddd37..fc2b4b7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -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, diff --git a/Cargo.toml b/Cargo.toml index 9e760d4..9c0e22a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "solrcopy" -version = "0.7.0" +version = "0.8.1" edition = "2024" rust-version = "1.85.1" @@ -8,10 +8,24 @@ authors = ["Juarez Rudsatz "] 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"] } @@ -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 @@ -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] diff --git a/Makefile.toml b/Makefile.toml index 1bdac4b..1c5f8fa 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -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" @@ -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" @@ -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" diff --git a/changelog.txt b/changelog.txt index c68227a..c3175dd 100644 --- a/changelog.txt +++ b/changelog.txt @@ -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 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 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 Wed, 19 Mar 2025 00:06:12 -0300 + debian (0.6.0) stable; urgency=low * improved: upgraded clap to 4.5