Skip to content

Conversation

@DanTheMan827
Copy link

@DanTheMan827 DanTheMan827 commented Apr 23, 2025

Summary

This update introduces GitHub Actions workflows to streamline the build and release processes for the wsl-usb-manager project.

Changes

  1. Added GitHub Actions Workflows:

    • Build Workflow (.github/workflows/build.yaml):
      • Configures a matrix build for both debug and release modes on Windows.
      • Implements caching for build artifacts and dependencies to improve efficiency.
      • Uploads build artifacts for further use.
    • Release Workflow (.github/workflows/release.yaml):
      • Triggers on published releases.
      • Integrates the build workflow and manages artifact downloads.
      • Supports releases via GitHub and optional submission to the Windows Package Manager (winget) if credentials are provided.
  2. Optimized Cargo Build Configuration:

    • Added optimizations in Cargo.toml under [profile.release]:
      • Strip symbols from binaries.
      • Enabled link-time optimization (LTO).
      • Limited codegen units to 1 for better optimization.

Impact

These changes automate and enhance the project's CI/CD pipeline, reducing manual intervention during builds and releases while providing improved build efficiency and binary optimization for production releases.

Copy link
Owner

@nickbeth nickbeth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for submitting this PR, I've actually wanted to setup proper CI for a long time but never got around doing it.
Sorry for the late reply, I've been quite busy in the past months, so I appreciate any form of contribution.

license = "MIT"

[profile.release]
strip = true # Automatically strip symbols from the binary.
Copy link
Owner

@nickbeth nickbeth Jul 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no real reason to strip debugging symbols from the binary, even for release builds. The executable is already very small, and in the past I had to debug a release build of the app, symbols were really useful in that situation.

with:
files: artifacts/**/*

winget:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't want this job yet in the repo, I'd suggest to drop it for now so that we can merge the rest of the CI and then once winget is in place, we can re-add it later on.

- name: Release Artifact Upload
uses: softprops/action-gh-release@v2
with:
files: artifacts/**/*
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how this action works, but is there any way to strip the -release part from the executable name? I'd like the release artifact to just be called wsl-usb-manager.exe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants