Skip to content

Add nightly builds on main CI and tag-based official releases#33

Merged
LittleLittleCloud merged 4 commits intomainfrom
copilot/publish-nightly-build-and-release
Oct 16, 2025
Merged

Add nightly builds on main CI and tag-based official releases#33
LittleLittleCloud merged 4 commits intomainfrom
copilot/publish-nightly-build-and-release

Conversation

Copy link
Contributor

Copilot AI commented Oct 16, 2025

Overview

This PR implements two distinct publishing workflows to automate package distribution:

  1. Nightly builds - Automated prerelease packages published on every push to main
  2. Official releases - Stable packages published when version tags are created

Changes

🌙 Nightly Builds (CI Workflow)

Added a publish-nightly job to .github/workflows/ci.yml that:

  • Triggers automatically after successful tests on push to main branch
  • Generates prerelease packages with version format: {version}-alpha.nightly-YYYYMMDD-{short-sha}
  • Example: RazorConsole.Core.0.0.5-alpha.nightly-20251016-bc1dd1b
  • Publishes to NuGet.org as prerelease packages
  • Provides daily snapshots of the latest development state

Benefits:

  • Early adopters can test bleeding-edge features
  • Automated feedback loop for continuous integration
  • Date-based versioning ensures proper chronological ordering
  • Commit SHA provides traceability back to source

🚀 Official Releases (Release Workflow)

Updated .github/workflows/release.yml to:

  • Trigger on version tags matching v*.*.* or *.*.* patterns (e.g., v0.0.5, 0.0.9, v1.2.3, 1.2.3)
  • Removed version suffix computation for stable releases
  • Automatically create GitHub Releases with package artifacts
  • Extended artifact retention from 7 to 90 days

Benefits:

  • Standard tag-based release process familiar to the ecosystem
  • Flexible tagging conventions - supports both prefixed (v0.0.5) and unprefixed (0.0.9) version tags
  • Clear distinction between stable and prerelease versions
  • Automated release creation reduces manual work
  • Stable packages use clean version numbers (e.g., 0.0.5)

📛 README Badge Updates

Updated badges in README.md to distinguish between stable and nightly builds:

  • Stable badge: Shows latest stable release version (e.g., 0.0.5)
  • Nightly badge: Shows latest prerelease/nightly build with orange color (e.g., 0.0.5-alpha.nightly-20251016-bc1dd1b)
  • Component Gallery badge: Updated to show stable versions only

Benefits:

  • Clear visual distinction between stable and nightly packages
  • Users can easily identify and access their preferred version
  • Orange color for nightly badge provides immediate visual differentiation

Migration from Previous Approach

Aspect Before After
Nightly builds None Automated on main push
Release trigger Manual GitHub release Version tag push
Tag patterns N/A Both v*.*.* and *.*.* supported
Version scheme Always had suffix Nightly: suffix / Release: no suffix
Package type Ambiguous Clear: prerelease vs stable
README badges Single badge for all versions Separate badges for stable and nightly

Usage

Nightly builds (automatic):

git push origin main

Official releases (supports both formats):

# With 'v' prefix
git tag v0.0.6
git push origin v0.0.6

# Without 'v' prefix
git tag 0.0.6
git push origin 0.0.6

Testing

Both version schemes have been validated:

  • ✅ Nightly: 0.0.5-alpha.nightly-20251016-bc1dd1b.nupkg
  • ✅ Release: 0.0.5.nupkg
  • ✅ YAML syntax validated
  • ✅ All tests pass
  • ✅ README badges correctly distinguish between stable and nightly builds
  • ✅ Both tag patterns (v*.*.* and *.*.*) supported

Fixes #32

Original prompt

This section details on the original issue you should resolve

<issue_title>publish nightly build on main ci && publish official release on tag trigger</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #32


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: LittleLittleCloud <16876986+LittleLittleCloud@users.noreply.github.com>
Copilot AI changed the title [WIP] Add nightly build and official release process Add nightly builds on main CI and tag-based official releases Oct 16, 2025
Copy link
Member

@LittleLittleCloud LittleLittleCloud left a comment

Choose a reason for hiding this comment

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

In reader, add different package badges for official build and nightly builds

@LittleLittleCloud
Copy link
Member

@copilot Resolved comments

Co-authored-by: LittleLittleCloud <16876986+LittleLittleCloud@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 16, 2025

In reader, add different package badges for official build and nightly builds

Added separate badges for stable and nightly builds in commit 679ce9c:

Changes:

  • Stable badge (nuget/v): Shows latest stable release (e.g., 0.0.5)
  • Nightly badge (nuget/vpre): Shows latest prerelease/nightly build with orange color (e.g., 0.0.5-alpha.nightly-20251016-bc1dd1b)
  • Updated Component Gallery badge to show stable version only

The badges now clearly distinguish between official releases and nightly builds, making it easy for users to choose their preferred version.

types: [published]
push:
tags:
- 'v*.*.*'
Copy link
Member

Choose a reason for hiding this comment

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

Support '..*' pattern as well, like 0.0.9

Copy link
Member

Choose a reason for hiding this comment

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

@copilot resolve this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added support for tag pattern without 'v' prefix. The release workflow now triggers on both:

  • v*.*.* (e.g., v0.0.5, v1.2.3)
  • *.*.* (e.g., 0.0.9, 1.2.3)

Both patterns will trigger the same official release workflow that publishes stable packages to NuGet.org and creates GitHub releases.

Co-authored-by: LittleLittleCloud <16876986+LittleLittleCloud@users.noreply.github.com>
@LittleLittleCloud LittleLittleCloud marked this pull request as ready for review October 16, 2025 04:57
@LittleLittleCloud LittleLittleCloud enabled auto-merge (squash) October 16, 2025 04:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Introduce automated nightly prerelease publishing and tag-driven stable releases, plus README badge differentiation.

  • Add publish-nightly job to CI to push dated prerelease (nightly) packages from main.
  • Convert release workflow to trigger on semantic version tags and create GitHub Releases; extend artifact retention; remove SHA-based suffix for stable packages.
  • Update README badges to separately show stable and nightly package versions.

Reviewed Changes

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

File Description
README.md Replace single prerelease badges with distinct stable/nightly/gallery badges.
.github/workflows/release.yml Switch trigger to version tag pushes, remove version suffix logic, extend retention, add GitHub Release creation.
.github/workflows/ci.yml Add nightly publish job with version suffix generation and package push.

types: [published]
push:
tags:
- 'v*.*.*'
Copy link

Copilot AI Oct 16, 2025

Choose a reason for hiding this comment

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

'..' already matches tags starting with 'v' (e.g. 'v1.2.3'), making 'v..' redundant. Remove the redundant pattern to simplify the trigger list to a single '..*' entry.

Suggested change
- 'v*.*.*'

Copilot uses AI. Check for mistakes.
Comment on lines +66 to +68
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
Copy link

Copilot AI Oct 16, 2025

Choose a reason for hiding this comment

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

The third-party action softprops/action-gh-release is referenced by a mutable tag ('v1'), which can change unexpectedly. Pin this action to a specific commit SHA (and optionally add a comment with the original tag) to mitigate supply chain risks.

Suggested change
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
# Originally: softprops/action-gh-release@v1
uses: softprops/action-gh-release@c7e6c9e2e6e8e6e2e6e8e6e2e6e8e6e2e6e8e6e2
if: startsWith(github.ref, 'refs/tags/')

Copilot uses AI. Check for mistakes.
Comment on lines +72 to +79
- name: Restore
run: dotnet restore RazorConsole.sln

- name: Build
run: dotnet build RazorConsole.sln --configuration Release --no-restore -p:VersionSuffix=$VersionSuffix

- name: Test
run: dotnet test RazorConsole.sln --configuration Release --no-build --verbosity normal -p:VersionSuffix=$VersionSuffix
Copy link

Copilot AI Oct 16, 2025

Choose a reason for hiding this comment

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

The nightly job rebuilds and retests even though it depends on build-test, duplicating compute time. Consider publishing build artifacts from build-test and reusing them here (e.g. download artifacts and use 'dotnet pack --no-build') to avoid redundant restore/build/test.

Copilot uses AI. Check for mistakes.
@LittleLittleCloud LittleLittleCloud merged commit 9bf27cc into main Oct 16, 2025
7 checks passed
@LittleLittleCloud LittleLittleCloud deleted the copilot/publish-nightly-build-and-release branch October 16, 2025 05:06
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.

publish nightly build on main ci && publish official release on tag trigger

3 participants