Skip to content

Releases: BD103/cargo-sweep

v2.1.0

01 Nov 18:07
Compare
Choose a tag to compare

This is a small feature release that includes a small quality-of-life improvement.

  • This action now prints the amount of bytes saved by sweeping build artifacts, calculating by summing the sizes of all deleted files.
  • Thanks to @tbillington, this action has been converted to Typescript in #9. They also switched the asynchronous file deleting code to be more idiomatic. Thanks!

New Contributors

Full Changelog: v2.0.0...v2.1.0

v2.0.0

30 Oct 20:38
Compare
Choose a tag to compare

This is a major version of cargo-sweep that sports a complete program redesign, faster runtimes, and stability fixes.

- name: Sweep cache for stale files
  uses: BD103/cargo-sweep@v2.0.0

If you'd like to opt-in to bug fixes and non-breaking changes, you can also specify the v2 tag:

- name: Sweep cache for stale files
  uses: BD103/cargo-sweep@v2

Removal of cargo-sweep

This action no longer installs the cargo-sweep binary. Instead, it implements cargo-sweep's logic completely from scratch in Javascript. This completely removes the need to compile, cache, or download anything other than this action, resulting in much faster runtimes. (Both the main and post actions now take less than a second to complete. In comparison, v1.3.0 took about 3 seconds to when cargo-sweep was cached and 17 seconds when it was not.)

Even with this removal in mind, the action name of BD103/cargo-sweep will still be kept in order to prevent breaking changes for existing projects.

Specify Manifest Path

It is now possible to specify the path to Cargo.toml when calling this action. This path is used to locate the target directory that will be swept:

- name: Sweep cache for stale files
  uses: BD103/cargo-sweep@v2
  with:
    manifest-path: path/to/Cargo.toml

All other inputs (use-cache, use-prebuilt, and gh-token) have been removed.

Size Pruning

Many dependencies have been removed, significantly decreasing the size of the bundled Javascript. The source code itself has also been shrunk, as the logic has become simpler, reducing the chances of bugs and edge-cases.

Bundled Javascript v1.3.0 v2.0.0
main/index.js 4.9 MB 970 KB
post/index.js 2.6 MB 973 KB

Diagnostics Improvements

This action now has better diagnostics when debug logging is enabled, meaning failures should be easier to inspect and troubleshoot. Because the sweeping functionality is hand rolled, this action currently does not compute the total amount of bytes cleaned, but that is planned for a future update.

Prebuilt Binaries are now Disabled

Ever since the original v1.0.0 this action had support for installing prebuilt versions of cargo-sweep. Because this action no longer uses cargo-sweep, prebuilt binaries are no longer being generated. The latest run ran last Sunday, on the 27th of October. Its artifacts will expire in 3 weeks, on the 17th of November, meaning all pre-v2.0.0 versions with prebuilt enabled will fail after then.

If you do not want to migrate to v2.0.0, I strongly suggest upgrading to v1.3.0 and using cached binaries instead.

Full Changelog: v1.3.0...v2.0.0

v1.3.0

24 Aug 19:56
Compare
Choose a tag to compare

This release introduces cargo-sweep caching, a better alternative to prebuilt binaries.

- name: Sweep cache for stale files
  uses: BD103/cargo-sweep@v1.3.0
  with:
    use-cache: true

When use-cache is true, which is the default, this action will save the installed binary to the Github Actions cache. This will result in cargo install cargo-sweep only being run once, with subsequent runs downloading the cached output.

This change makes prebuilt binaries far less useful. They are now discouraged due to their potential security risks, though will be supported for the time being.

This release also makes the gh-token input optional if use-prebuilt: false. Since this input is provided by default from ${{ github.token }}, you do not need to change anything.

Full Changelog: v1.2.0...v1.3.0

v1.2.0

21 Aug 01:55
Compare
Choose a tag to compare

This is a small feature-full release that includes:

  • cargo-sweep is now installed to ~/.cargo/bin instead of the target folder, mimicking cargo install's default behavior.
  • GH_TOKEN is now removed from the environment after it is no longer needed, so that spawned processes other than the intended gh attestation cannot access it.
    • This is a preemptive measure, and not likely nor easy to exploit.
  • An increase in information being logged to the terminal, improving diagnostics and providing a peak into the internals of this action.
  • General improvements to code quality, organization, and documentation.

Full Changelog: v1...v1.2.0

v1.1.0

16 Aug 20:11
Compare
Choose a tag to compare

This release adds support for artifact attestations for prebuilt cargo-sweep binaries, meaning:

  • All prebuilt binaries now have attestations made for them using actions/attest-build-provenance.
    • You can view these attestations here.
  • After downloading prebuilt binaries, this action will now run gh attestation verify to ensure the downloaded cargo-sweep was truly built by this repository.
    • If verification fails, cargo-sweep will not be run.

Full Changelog: v1.0.0...v1.1.0

v1.0.0

14 Aug 19:40
ae79669
Compare
Choose a tag to compare