Skip to content

[CI] Upload CI Artifacts to get Nightly Builds#285

Open
AXiX-official wants to merge 3 commits intoclice-io:mainfrom
AXiX-official:upload-ci-artifacts
Open

[CI] Upload CI Artifacts to get Nightly Builds#285
AXiX-official wants to merge 3 commits intoclice-io:mainfrom
AXiX-official:upload-ci-artifacts

Conversation

@AXiX-official
Copy link
Copy Markdown

@AXiX-official AXiX-official commented Oct 24, 2025

Resolves #281

Summary by CodeRabbit

  • Documentation

    • Added an alternative nightly build link to the Getting started instructions, alongside the standard release link.
  • Chores

    • Added a daily nightly build workflow that runs on Windows, Linux, and macOS, packages per-OS artifacts and symbols, and uploads artifacts only when new commits are detected.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Oct 24, 2025

Walkthrough

Adds a nightly GitHub Actions workflow that builds the project daily across Windows, Linux, and macOS and uploads per-OS artifacts when new commits exist; README now points to the nightly build download alongside existing release links.

Changes

Cohort / File(s) Summary
Documentation
README.md
Added an alternative nightly build link to the Getting Started section (appended after the releases page link and before the VS Code extension link).
CI/CD Workflow
.github/workflows/nightly.yml
New "nightly" GitHub Actions workflow: scheduled daily (11:00 UTC), 3-OS matrix, sets up xmake/Pixi, computes short SHA/date, detects new commits vs last successful nightly run, conditionally packages per-OS binaries and symbol artifacts, and uploads artifacts when changes exist.

Sequence Diagram(s)

sequenceDiagram
    participant Scheduler as Cron (11:00 UTC)
    participant GHWF as GitHub Actions (nightly.yml)
    participant Runner as Matrix Runner (Win / Linux / macOS)
    participant Setup as Env Setup (xmake, Pixi, toolchains)
    participant Diff as Commit Detector
    participant Build as Build & Package
    participant Upload as Artifact Upload

    Scheduler->>GHWF: trigger workflow
    GHWF->>Runner: start matrix job
    Runner->>Setup: install deps & toolchain
    Setup-->>Runner: environment ready
    Runner->>Diff: get last successful nightly SHA\ncompare to current SHA
    alt new commits found
        Runner->>Build: build, package per-OS
        Build->>Upload: upload main artifacts + symbols
        Upload-->>GHWF: artifacts stored
    else no new commits
        Diff-->>GHWF: skip packaging & upload
    end
    GHWF-->>Scheduler: workflow finished
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify commit-detection logic that compares current run SHA to the last successful nightly run.
  • Validate matrix environment setup steps for each OS (Windows LLVM/tooling adjustments).
  • Confirm artifact naming, packaging per-OS, and symbol upload correctness.
  • Check scheduling and secrets/permissions used for fetching last-run artifacts and uploads.

Poem

🐰 I nibble code beneath the moon,

Nightly hops bring builds by noon,
Windows, Linux, Mac in line,
Binaries gleam — a tiny sign,
Artifacts tucked in a neat design.

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly describes the main change: adding CI artifact uploads to enable nightly builds.
Linked Issues check ✅ Passed The PR implements the requested nightly build solution by adding a workflow that uploads CI artifacts on a schedule, directly addressing issue #281's requirement.
Out of Scope Changes check ✅ Passed All changes are focused on the nightly build workflow and documentation, with no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d6299a1 and 591fcc8.

📒 Files selected for processing (1)
  • .github/workflows/nightly.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/nightly.yml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
README.md (1)

21-21: Minor: Clean up whitespace in nightly build link text.

The text has an extra space before the opening parenthesis. Consider: ... releases page) or [nightly build](...)

-Download the latest `clice` binary from the [releases page](https://github.com/clice-io/clice/releases) ( or  [nightly build](https://nightly.link/clice-io/clice/workflows/xmake/main) ) and install the [vscode extension](https://marketplace.visualstudio.com/items?itemName=ykiko.clice-vscode).
+Download the latest `clice` binary from the [releases page](https://github.com/clice-io/clice/releases) or [nightly build](https://nightly.link/clice-io/clice/workflows/xmake/main), then install the [vscode extension](https://marketplace.visualstudio.com/items?itemName=ykiko.clice-vscode).
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a10908d and 470944d.

📒 Files selected for processing (2)
  • .github/workflows/xmake.yml (3 hunks)
  • README.md (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: linux (ubuntu-24.04, debug)
  • GitHub Check: linux (ubuntu-24.04, release)
  • GitHub Check: windows (windows-2025)
  • GitHub Check: macos (macos-15, debug)
  • GitHub Check: macos (macos-15, release)
🔇 Additional comments (4)
.github/workflows/xmake.yml (4)

59-64: Artifact upload strategy looks good for Windows.

Uploads on all non-PR runs to enable nightly builds. Since Windows has no debug build variant, this effectively uploads release builds only, consistent with Linux and macOS.


118-123: Release-only uploads are appropriate for Linux.

Filters to release builds only, avoiding debug artifacts in nightly builds. Artifact naming with commit SHA ensures traceability and uniqueness.


169-173: Release-only uploads are appropriate for macOS.

Consistent with Linux job: uploads only release builds on non-PR runs. The nightly.link service will aggregate these artifacts across all platforms.


59-173: Verify artifact directory structure and binary discoverability.

All three jobs upload ./build as-is, which will be zipped with its full directory structure. Consider documenting expected directory layout for users extracting artifacts from nightly builds, or verify that the clice binary is in an obvious location (e.g., ./build/clice or similar).

with:
name: clice-${{ matrix.os }}-${{ github.sha }}
path: ./build

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we should modify release.yml rather than xmake.yml.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

In my understanding, a nightly build refers to building the latest version after each pull request or at regular intervals. If release.yaml is used, builds and uploads only occur during version updates.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Moreover, if we use a nightly.yaml , it will reprocess builds that have already been done in either xmake.yaml or cmake.yaml.

@star-hengxing
Copy link
Copy Markdown
Collaborator

Does this PR just upload the binary to the artifacts, without needing to create a new tag?

Regarding the review question above, @16bit-ykiko wants the nightly build to be built with LTO.

@AXiX-official
Copy link
Copy Markdown
Author

Does this PR just upload the binary to the artifacts, without needing to create a new tag?

Regarding the review question above, @16bit-ykiko wants the nightly build to be built with LTO.

yeah, simply upload artifacts for each pull without tag. casue i think with a tag it should in release page not a nightly build.

built with LTO is reasonable, i'll fix it

@16bit-ykiko
Copy link
Copy Markdown
Member

We plan to update to LLVM 21.4 and change the release build type to 'Release with Debug Info' soon. This PR must be done after those changes.

@16bit-ykiko
Copy link
Copy Markdown
Member

By the way, I think this build should run nightly. It should check for new commits since the last build, and if any exist, proceed to build and upload the artifacts for a nightly build. These nightly artifacts should use the same configuration as an official release, just considered less formal.

@16bit-ykiko
Copy link
Copy Markdown
Member

16bit-ykiko commented Nov 2, 2025

llvm has been updated to 21.1.4 #292. But we fail to build releasedbg + lto version of llvm because of oom. See https://github.com/clice-io/llvm-binary/actions/runs/18961725591 for detail @star-hengxing.

@16bit-ykiko
Copy link
Copy Markdown
Member

The packaging workflow is ready, so I believe we can proceed with nightly builds.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
README.md (1)

19-21: Clarify nightly build availability and freshness.

While the README now links to nightly builds, it doesn't document:

  • When nightly builds are available (e.g., "built daily at 11:00 UTC" per the workflow schedule)
  • That nightly builds reflect the latest main branch commits but may be less stable than releases
  • Which platforms/architectures are included (Windows, Linux, macOS)

Consider adding a brief note to manage user expectations, or keep it minimal if you prefer simplicity.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 470944d and d6299a1.

📒 Files selected for processing (2)
  • .github/workflows/nightly.yml (1 hunks)
  • README.md (1 hunks)
🔇 Additional comments (2)
.github/workflows/nightly.yml (2)

140-152: Verify artifact output paths.

The upload steps assume artifacts are located at build/xpack/clice/${{ matrix.artifact_name }} and build/xpack/clice/${{ matrix.symbol_artifact_name }}. Confirm that the xmake pack step (line 138) produces artifacts at these exact paths on all three OS platforms (Windows, Linux, macOS).


125-138: LTO is already enabled through the --release=y flag.

The nightly.yml workflow correctly includes --release=y in all xmake config commands (lines 130–136). In xmake.lua, this flag triggers the condition if has_config("release"), which sets set_policy("build.optimization.lto", true) (line 30). LTO is not missing; it is configured as intended. The --mode=releasedbg flag controls the optimization mode separately from the --release=y config flag that enables LTO.

Likely an incorrect or invalid review comment.

Comment on lines +14 to +34
- os: windows-2025
artifact_name: clice.zip
asset_name: clice-x64-windows-msvc
symbol_artifact_name: clice-symbol.zip
symbol_asset_name: clice-x64-windows-msvc-symbol
toolchain: clang-cl

- os: ubuntu-24.04
artifact_name: clice.tar.gz
asset_name: clice-x86_64-linux-gnu
symbol_artifact_name: clice-symbol.tar.gz
symbol_asset_name: clice-x86_64-linux-gnu-symbol
toolchain: clang-20

- os: macos-15
artifact_name: clice.tar.gz
asset_name: clice-arm64-macos-darwin
symbol_artifact_name: clice-symbol.tar.gz
symbol_asset_name: clice-arm64-macos-darwin-symbol
toolchain: clang

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify toolchain versions align with project LLVM updates.

The workflow uses clang-20 on Linux and clang (unversioned) on macOS, but PR context mentions LLVM has been updated to 21.1.4 (PR #292) and 21.4 was planned. Confirm whether clang-20 is intentional for stability or whether the workflow should reference the updated LLVM versions.


🌐 Web query:

What is the latest stable LLVM version and what is clang-20 vs clang-21 versioning?

💡 Result:

Latest stable LLVM: LLVM 21.1.6 (released Nov 18, 2025). [1][2]

What "clang-20" vs "clang-21" means

  • The clang major/minor labels track the LLVM release branch: "clang-20" = the Clang front-end from the LLVM 20.x release series; "clang-21" = Clang from the LLVM 21.x series. Each series has point releases (e.g., 21.1.6). Packages and distro repos commonly expose these as clang-20, clang-21, etc. [1][3][4]

If you need specific point-release numbers (e.g., clang 21.1.6 binaries) or distro package names for your OS, tell me your platform and I’ll fetch the exact package/version links.

Sources:
[1] llvm.org (project home / release announcement).
[2] LLVM Discourse announcement: "LLVM 21.1.6 Released" (Nov 18, 2025).
[3] Apt.llvm.org package listings (clang/llvm-20 and llvm-21 toolchains).
[4] Example release changelogs showing clang/clang-format tied to LLVM point releases.


🏁 Script executed:

#!/bin/bash
# Search for LLVM/clang version references in the codebase
rg -i "llvm|clang" --type-list | head -20
rg -ni "version.*llvm|llvm.*version|clang.*2[0-1]" -A2 -B2 --type-not=node_modules 2>/dev/null | head -40

Length of output: 389


🏁 Script executed:

#!/bin/bash
# Check CMakeLists.txt and related build config files for LLVM requirements
fd -e "CMakeLists.txt" -e "cmake" -e "\.cmake$" --type f | xargs grep -l -i "llvm\|clang" 2>/dev/null | head -10

Length of output: 42


🏁 Script executed:

#!/bin/bash
# Display the full nightly.yml workflow to understand broader context
cat ".github/workflows/nightly.yml" 2>/dev/null | head -50

Length of output: 1397


🏁 Script executed:

#!/bin/bash
# Check LLVM setup and version requirements
cat "cmake/llvm_setup.cmake" 2>/dev/null

Length of output: 8492


🏁 Script executed:

#!/bin/bash
# Check package.cmake for version info
cat "cmake/package.cmake" 2>/dev/null | head -50

Length of output: 1420


🏁 Script executed:

#!/bin/bash
# Search directly for LLVM version constraints across key files
rg -n "LLVM.*VERSION|find_package.*LLVM" --type cmake -A3 -B1 2>/dev/null

Length of output: 5398


Update nightly.yml workflow to use clang-21 instead of clang-20 on Linux.

The project's CMake build configuration explicitly requires LLVM 21.1.4 (setup_llvm("21.1.4") in cmake/package.cmake), but the nightly workflow on ubuntu-24.04 specifies toolchain: clang-20, which corresponds to LLVM 20.x. This version mismatch will cause the Linux nightly build to fail or produce artifacts against the wrong LLVM libraries. Change line 32 in .github/workflows/nightly.yml from toolchain: clang-20 to toolchain: clang-21.

🤖 Prompt for AI Agents
.github/workflows/nightly.yml around lines 14 to 34: the ubuntu-24.04 job is
using toolchain: clang-20 which mismatches the project's required LLVM 21.1.4;
update that line to toolchain: clang-21 so the Linux nightly uses LLVM 21 and
matches cmake/package.cmake (setup_llvm("21.1.4")).

## Getting started

Download the latest `clice` binary from the [releases page](https://github.com/clice-io/clice/releases) and install the [vscode extension](https://marketplace.visualstudio.com/items?itemName=ykiko.clice-vscode). Then, add the following configuration to your `.vscode/settings.json` file:
Download the latest `clice` binary from the [releases page](https://github.com/clice-io/clice/releases) ( or [nightly build](https://nightly.link/clice-io/clice/workflows/nightly/main) ) and install the [vscode extension](https://marketplace.visualstudio.com/items?itemName=ykiko.clice-vscode). Then, add the following configuration to your `.vscode/settings.json` file:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify nightly.link URL points to the correct workflow.

The README links to https://nightly.link/clice-io/clice/workflows/nightly/main for nightly builds. Confirm that:

  1. The nightly.link service recognizes the workflow name "nightly" from .github/workflows/nightly.yml
  2. Users can download the uploaded artifacts through this link after the workflow runs

🌐 Web query:

How does nightly.link integrate with GitHub Actions workflows and how should the URL be formatted?

💡 Result:

nightly.link integrates by reading artifacts produced by GitHub Actions (those uploaded with actions/upload-artifact) and exposing stable, public download redirects to the latest artifact for a given repo/workflow/branch (or to a specific run/artifact). It can also be installed as a GitHub App so downloads use the app token (to avoid global API rate‑limit issues). [1][2]

URL format (common patterns)

Notes

  • Append ?status=completed to include completed (not only successful) runs. [1]
  • For repos you control, install the nightly.link GitHub App to avoid shared API rate limits. [1][2]

Sources: [1] nightly.link homepage/docs; [2] nightly.link GitHub repo.



---

🏁 Script executed:

```shell
#!/bin/bash
# Find nightly workflow file and extract artifact upload configuration
fd -t f "nightly.yml" .github/workflows/

Length of output: 29



---

🏁 Script executed:

```shell
#!/bin/bash
# Extract artifact upload configuration from nightly workflow
cat .github/workflows/nightly.yml

Length of output: 5532


Correct the nightly.link URL in README line 21—it's incomplete and non-functional.

The current URL https://nightly.link/clice-io/clice/workflows/nightly/main is missing both the artifact name and .zip extension. According to nightly.link documentation, the correct format is https://nightly.link/{owner}/{repo}/workflows/{workflow-file-or-name}/{branch}/{artifact}.zip.

Since the workflow generates dynamic artifact names with date and commit SHA (e.g., clice-x64-windows-msvc-20250119-abc1234), a static URL cannot reliably point to the latest build. Either:

  • Direct users to https://nightly.link/clice-io/clice/workflows/nightly/main to browse available artifacts, or
  • Specify particular artifact(s) with a complete URL pattern
🤖 Prompt for AI Agents
In README.md around line 21 the nightly.link URL is incomplete; replace the
current link with either the nightly.link browse URL
(https://nightly.link/clice-io/clice/workflows/nightly/main) so users can view
available artifacts, or provide a full artifact ZIP URL pattern including the
artifact name and .zip (e.g.,
https://nightly.link/{owner}/{repo}/workflows/{workflow}/{branch}/{artifact}.zip)
and update the text to explain that artifact names are dynamic so users may need
to select the latest build.

@AXiX-official
Copy link
Copy Markdown
Author

The packaging workflow is ready, so I believe we can proceed with nightly builds.

done

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.

[CI] Upload CI Artifacts to get Nightly Builds

3 participants