Skip to content

Linux workflow template - #79

Merged
christianhelle merged 5 commits into
masterfrom
linux-deploy
May 8, 2025
Merged

christianhelle merged 5 commits into
masterfrom
linux-deploy

Conversation

@christianhelle

@christianhelle christianhelle commented May 8, 2025 •

Copy link
Copy Markdown
Owner

This pull request refactors the Linux build workflow by introducing a reusable workflow template and updates the release process to include Linux artifacts. The changes aim to simplify the workflow configuration and enhance the release automation.

Workflow Refactoring:

  • Added a new reusable workflow template in .github/workflows/linux-template.yml to handle Linux builds, parameterized with inputs for version and Qt version. This template includes steps for version updates, Qt installation, CMake build, packaging, and artifact publishing.
  • Updated .github/workflows/linux.yml to use the new Linux build template, replacing the inline steps with a reference to the reusable workflow.

Release Process Enhancements:

  • Modified .github/workflows/release.yml to include the Linux build workflow as part of the release process, ensuring Linux artifacts are generated alongside other platform builds.
  • Added steps in .github/workflows/release.yml to upload Linux DEB, RPM, and TGZ packages as release assets, improving the distribution of Linux builds.
    This pull request introduces a reusable GitHub Actions workflow for Linux builds, refactors existing workflows to use the new template, and enhances the release process by adding support for Linux packages. Below are the key changes grouped by theme:

Workflow Template Creation:

  • Added a new reusable workflow in .github/workflows/linux-template.yml to handle Linux builds. This includes steps for version updates, Qt installation, building with CMake, packaging with CPack, and publishing artifacts. The workflow supports configurable version and qt_version inputs.

Refactoring Existing Workflows:

  • Updated .github/workflows/linux.yml to use the new reusable Linux build workflow instead of duplicating the build logic. The version input is dynamically set using github.run_number.

Enhancements to Release Workflow:

  • Modified .github/workflows/release.yml to include a job for the Linux build using the new reusable workflow.
  • Added steps to upload Linux packages (DEB, RPM, and TGZ) to GitHub Releases as part of the release process.

Summary by CodeRabbit

  • New Features
    • Added automated Linux build and packaging to the release process, providing DEB, RPM, and TGZ package formats for download.
  • Chores
    • Simplified and modularized the Linux build workflow for easier maintenance and reuse across workflows.

@christianhelle
christianhelle requested a review from Copilot May 8, 2025 22:03
@christianhelle christianhelle self-assigned this May 8, 2025
@christianhelle christianhelle added the build CI / CD label May 8, 2025
@coderabbitai

coderabbitai Bot commented May 8, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

A reusable GitHub Actions workflow for Linux builds was introduced and integrated into both the main Linux workflow and the release workflow. The previously inline Linux build steps were refactored to call this new template, and the release workflow was updated to upload Linux package artifacts (DEB, RPM, TGZ) to GitHub releases.

Changes

File(s) Change Summary
.github/workflows/linux-template.yml Added a reusable workflow for Linux builds with configurable version and Qt version inputs.
.github/workflows/linux.yml Refactored to delegate build steps to the new reusable Linux build template workflow.
.github/workflows/release.yml Added a Linux build job using the new template and updated the release job to upload Linux package artifacts.

Sequence Diagram(s)

sequenceDiagram
    participant WorkflowCaller as linux.yml / release.yml
    participant LinuxTemplate as linux-template.yml
    participant GitHub as GitHub Actions
    participant CMake as CMake/CPack

    WorkflowCaller->>LinuxTemplate: Call workflow with version input
    LinuxTemplate->>GitHub: Checkout code
    LinuxTemplate->>LinuxTemplate: Update version strings
    LinuxTemplate->>GitHub: Install Qt
    LinuxTemplate->>CMake: Configure, build, and install project
    LinuxTemplate->>CMake: Package outputs (7Z, ZIP, TBZ2, TGZ, TXZ, TZ, DEB, RPM)
    LinuxTemplate->>GitHub: Upload build artifacts
    WorkflowCaller->>GitHub: (release.yml only) Upload DEB, RPM, TGZ as release assets
Loading

Possibly related PRs

  • Build Linux Packages #78: Added CMake-based Linux packaging and artifact upload steps to .github/workflows/linux.yml, which are now encapsulated in the new reusable workflow.
  • Fix Windows build #77: Updated version strings in source files within Windows build workflows, similar in approach to the Linux version updates in this PR.

Poem

Hopping through the YAML fields so green,
A template now makes our Linux builds clean.
Artifacts packed—DEB, RPM, and TGZ—
Released with a thump for all to see!
With workflows shared, our burrow’s neat,
CI carrots taste extra sweet. 🥕

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e53299f and 9056527.

📒 Files selected for processing (1)
  • .github/workflows/release.yml (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/release.yml
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: linux / build
  • GitHub Check: windows / template

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request introduces a reusable GitHub Actions workflow template for Linux builds and integrates Linux artifacts into the release process.

  • Added a new reusable Linux build workflow in .github/workflows/linux-template.yml to parameterize version and Qt version inputs.
  • Updated .github/workflows/linux.yml to use the new template, and modified .github/workflows/release.yml to reference the Linux workflow and upload Linux packages (DEB, RPM, TGZ).

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/release.yml Refactored to include a new linux job and added asset upload steps for Linux packages.
.github/workflows/linux.yml Replaced duplicated build steps with a call to the new workflow template.
.github/workflows/linux-template.yml Introduced a reusable workflow template for Linux builds with configurable inputs.

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (7)
.github/workflows/linux-template.yml (6)

1-14: Consider adding a concurrency policy to cancel redundant runs
Right now, multiple workflow calls with the same version may queue up. You can add a top‐level concurrency block to cancel in‐flight runs for the same version, e.g.:

concurrency:
  group: linux-build-${{ inputs.version }}
  cancel-in-progress: true

22-30: Make version replacement more robust and cross‐platform
You're using PowerShell on Linux which works, but a bash/sed approach or CMake’s configure_file() would avoid needing pwsh and special quoting. This also ensures consistency across environments.


31-35: Cache Qt installation for faster CI feedback
The jurplel/install-qt-action can be paired with actions/cache to avoid re-downloading Qt on every run. Consider adding a cache step keyed on inputs.qt_version.


36-42: Use an out-of-source build directory to keep workspace clean
Instead of building in‐place, create a build/ dir:

run: |
  mkdir -p build
  cd build
  cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/sqlitequery ..
  cmake --build . --parallel 32
  cmake --install . --prefix /tmp/sqlitequery

This prevents clutter in src/project.


43-53: Reduce unnecessary package generators
If your downstream release only consumes DEB, RPM, and TGZ, drop the other cpack -G calls to speed up packaging and reduce storage.


55-60: Generate and upload a checksum manifest for integrity
For security and traceability, consider adding:

- run: sha256sum src/project/SQLiteQueryAnalyzer-${{ inputs.version }}-Linux.* > checksums.txt
  working-directory: src/project
- uses: actions/upload-artifact@v4
  with:
    name: checksums_v${{ inputs.version }}
    path: src/project/checksums.txt
.github/workflows/linux.yml (1)

18-20: Centralize the version prefix to avoid duplication
The 0.2. prefix is hard-coded here and in release.yml. You might define a top-level env: VERSION_PREFIX: '0.2.' and then reference ${{ env.VERSION_PREFIX }}${{ github.run_number }} in both workflows to prevent drift.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c8dabde and e53299f.

📒 Files selected for processing (3)
  • .github/workflows/linux-template.yml (1 hunks)
  • .github/workflows/linux.yml (1 hunks)
  • .github/workflows/release.yml (2 hunks)
🔇 Additional comments (1)
.github/workflows/release.yml (1)

34-37: Verify if the Linux job needs secret inheritance
Your linux job calls the reusable template which currently doesn’t declare secrets: inherit. If in the future you add steps that require GITHUB_TOKEN or other secrets inside the template, those must be explicitly inherited here.

Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
christianhelle and others added 3 commits May 9, 2025 00:12
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@sonarqubecloud

sonarqubecloud Bot commented May 8, 2025

Copy link
Copy Markdown

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

Labels

build CI / CD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants