feat: Support VERSION file and auto release#262
Conversation
Use VERSION file to manage DTK version. Add auto release workflow. Signed-off-by: Yixue Wang <wangyixue@uniontech.com>
deepin pr auto review代码审查意见:
总体来说,代码改动看起来是合理的,但是需要注意一些细节问题,以提高代码的可维护性和可读性。 |
Reviewer's GuideThis PR refactors project version management to use an external VERSION file instead of a hardcoded value and introduces an automated GitHub Actions workflow for releasing new versions. Sequence Diagram: Auto Release Workflow ExecutionsequenceDiagram
actor User_Event as "User / Triggering Event"
participant WF_Call_Auto_Release as "call-auto-release.yml (This PR)"
participant WF_Reusable_Auto_Release as "Reusable auto-release.yml (linuxdeepin/.github)"
User_Event->>+WF_Call_Auto_Release: Trigger (workflow_dispatch or workflow_call) with inputs (version, name, email, timezone)
WF_Call_Auto_Release->>+WF_Reusable_Auto_Release: Call with resolved inputs and secrets
WF_Reusable_Auto_Release-->>-WF_Call_Auto_Release: (Performs release steps)
WF_Call_Auto_Release-->>-User_Event: (Workflow completes)
Flow Diagram: CMake Project Version Retrieval from VERSION filegraph TD
A[Build Process Starts] --> B{Read VERSION file content};
B --> C[Store content in DTK_FILE_VERSION];
C --> D{Strip leading/trailing whitespace from DTK_FILE_VERSION};
D --> E[Set DTK_VERSION project variable from cleaned DTK_FILE_VERSION];
E --> F[Continue Build Process];
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @asterwyx - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
|
||
| jobs: | ||
| auto_release: | ||
| uses: linuxdeepin/.github/.github/workflows/auto-release.yml@master |
There was a problem hiding this comment.
suggestion: Pin reusable workflow reference
Use a commit SHA or tag instead of 'master' to avoid unexpected changes and ensure consistent workflow runs.
Suggested implementation:
auto_release:
uses: linuxdeepin/.github/.github/workflows/auto-release.yml@<COMMIT_SHA>
secrets: inherit
with:
Replace <COMMIT_SHA> with the actual commit SHA or a specific tag from the linuxdeepin/.github repository that you want to pin to. This ensures the workflow always uses the intended version.
| file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" DTK_FILE_VERSION) | ||
| string(STRIP "${DTK_FILE_VERSION}" DTK_FILE_VERSION) | ||
| set(DTK_VERSION "${DTK_FILE_VERSION}" CACHE STRING "Define project version") |
There was a problem hiding this comment.
suggestion: Consider documenting the management of the new version files.
Please add a brief note on how the VERSION file should be managed, either as a comment in CMakeLists.txt or in the developer documentation.
| file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" DTK_FILE_VERSION) | |
| string(STRIP "${DTK_FILE_VERSION}" DTK_FILE_VERSION) | |
| set(DTK_VERSION "${DTK_FILE_VERSION}" CACHE STRING "Define project version") | |
| # The project version is read from the VERSION file in the source directory. | |
| # To update the project version, edit the VERSION file and commit the change. | |
| # The VERSION file should contain only the version string (e.g., 5.6.23) with no extra whitespace. | |
| file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" DTK_FILE_VERSION) | |
| string(STRIP "${DTK_FILE_VERSION}" DTK_FILE_VERSION) | |
| set(DTK_VERSION "${DTK_FILE_VERSION}" CACHE STRING "Define project version") |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: asterwyx, zccrs The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Use VERSION file to manage DTK version.
Add auto release workflow.
Signed-off-by: Yixue Wang wangyixue@uniontech.com
Summary by Sourcery
Use a dedicated VERSION file for project version management in CMake and introduce an automated GitHub Actions workflow for releasing new versions.
Enhancements:
CI: