dev: specify nightly tag through cmake instead of modes file (#6798)

This commit is contained in:
pajlada
2026-02-08 11:59:34 +01:00
committed by GitHub
parent f7aa5959c1
commit 43ac9c38db
11 changed files with 87 additions and 25 deletions
+60 -1
View File
@@ -9,6 +9,16 @@ on:
- "release/*"
pull_request:
workflow_dispatch:
inputs:
buildType:
description: "Build type"
required: true
type: choice
default: "auto"
options:
- auto
- nightly
- stable
merge_group:
concurrency:
@@ -18,6 +28,7 @@ concurrency:
env:
C2_ENABLE_LTO: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/bugfix-release/') || startsWith(github.ref, 'refs/heads/release/') }}
CHATTERINO_REQUIRE_CLEAN_GIT: On
CHATTERINO_BUILD_TYPE: ${{ case(inputs.buildType != '', inputs.buildType, 'auto') }}
CONAN_VERSION: 2.11.0
jobs:
@@ -70,6 +81,29 @@ jobs:
run: |
git config --global --add safe.directory '*'
- name: Determine build type
id: build-type
shell: bash
run: |
if [ "${CHATTERINO_BUILD_TYPE}" = "auto" ]; then
if git describe --exact-match --match 'v*'; then
echo "Auto - found release tag format"
echo "NIGHTLY_BUILD=Off" >> "$GITHUB_OUTPUT"
else
echo "Auto - did not find release tag format"
echo "NIGHTLY_BUILD=On" >> "$GITHUB_OUTPUT"
fi
elif [ "${CHATTERINO_BUILD_TYPE}" = "nightly" ]; then
echo "Override to nightly"
echo "NIGHTLY_BUILD=On" >> "$GITHUB_OUTPUT"
elif [ "${CHATTERINO_BUILD_TYPE}" = "stable" ]; then
echo "Override to stable"
echo "NIGHTLY_BUILD=Off" >> "$GITHUB_OUTPUT"
else
echo "Error: no build type variable set"
exit 1
fi
- name: Install Python and libclang (24.04)
if: matrix.os == 'ubuntu-24.04'
run: |
@@ -93,6 +127,7 @@ jobs:
-DCHATTERINO_LTO="$C2_ENABLE_LTO" \
-DCMAKE_PREFIX_PATH="$Qt6_DIR/lib/cmake" \
-DCHATTERINO_STATIC_QT_BUILD=On \
-DCHATTERINO_NIGHTLY_BUILD=${{ steps.build-type.outputs.NIGHTLY_BUILD }} \
-DFORCE_JSON_GENERATION=${{matrix.os == 'ubuntu-24.04' && 'On' || 'Off'}} \
-DCHATTERINO_PLUGINS=${{ matrix.plugins && 'On' || 'Off' }} \
..
@@ -147,6 +182,29 @@ jobs:
submodules: recursive
fetch-depth: 0 # allows for tags access
- name: Determine build type
id: build-type
shell: bash
run: |
if [ "${CHATTERINO_BUILD_TYPE}" = "auto" ]; then
if git describe --exact-match --match 'v*'; then
echo "Auto - found release tag format"
echo "NIGHTLY_BUILD=Off" >> "$GITHUB_OUTPUT"
else
echo "Auto - did not find release tag format"
echo "NIGHTLY_BUILD=On" >> "$GITHUB_OUTPUT"
fi
elif [ "${CHATTERINO_BUILD_TYPE}" = "nightly" ]; then
echo "Override to nightly"
echo "NIGHTLY_BUILD=On" >> "$GITHUB_OUTPUT"
elif [ "${CHATTERINO_BUILD_TYPE}" = "stable" ]; then
echo "Override to stable"
echo "NIGHTLY_BUILD=Off" >> "$GITHUB_OUTPUT"
else
echo "Error: no build type variable set"
exit 1
fi
- name: Install Qt6
if: startsWith(matrix.qt-version, '6.')
uses: jurplel/install-qt-action@v4.3.0
@@ -219,6 +277,7 @@ jobs:
-DUSE_PRECOMPILED_HEADERS=ON `
-DBUILD_WITH_CRASHPAD="$Env:C2_ENABLE_CRASHPAD" `
-DCHATTERINO_LTO="$Env:C2_ENABLE_LTO" `
-DCHATTERINO_NIGHTLY_BUILD="${{ steps.build-type.outputs.NIGHTLY_BUILD }}" `
-DFORCE_JSON_GENERATION=On `
-DCHATTERINO_SPELLCHECK=On `
..
@@ -243,7 +302,6 @@ jobs:
windeployqt bin/chatterino.exe --release --no-compiler-runtime --no-translations --no-opengl-sw --dir Chatterino2/
cp bin/chatterino.exe Chatterino2/
..\.CI\deploy-crt.ps1 Chatterino2
echo nightly > Chatterino2/modes
- name: Package (windows)
if: startsWith(matrix.os, 'windows')
@@ -290,6 +348,7 @@ jobs:
-DUSE_PRECOMPILED_HEADERS=OFF \
-DCHATTERINO_LTO="$C2_ENABLE_LTO" \
-DFORCE_JSON_GENERATION=Off \
-DCHATTERINO_NIGHTLY_BUILD=${{ steps.build-type.outputs.NIGHTLY_BUILD }} \
-DCHATTERINO_SPELLCHECK=On \
..
make -j"$(sysctl -n hw.logicalcpu)"
+1
View File
@@ -54,6 +54,7 @@
- Bugfix: Disable "Sort Tabs Alphabetically" action when notebook layout is locked. (#6710)
- Bugfix: Fix highlight mentions not updating when username changes. (#6723, #6739)
- Bugfix: Fixed Return and Enter being treated as different keys on Mac OS. (#6726)
- Dev: Nightly builds are now defined through a build flag rather than the Modes file. (#6798)
- Dev: Update release documentation. (#6498)
- Dev: Make code sanitizers opt in with the `CHATTERINO_SANITIZER_SUPPORT` CMake option. After that's enabled, use the `SANITIZE_*` flag to enable individual sanitizers. (#6493)
- Dev: Remove unused QTextCodec includes. (#6487)
+1
View File
@@ -32,6 +32,7 @@ option(CHATTERINO_PLUGINS "Enable ALPHA plugin support in Chatterino" ON)
option(CHATTERINO_USE_GDI_FONTENGINE "Use the legacy GDI fontengine instead of the new DirectWrite one on Windows (Qt 6.8.0 and later)" ON)
option(CHATTERINO_ALLOW_PRIVATE_QT_API "Allow uses of Qt's private API - when enabling this, Chatterino must use the EXACT Qt version it was compiled against" OFF)
option(CHATTERINO_SPELLCHECK "Enable spellchecking in Chatterino (requires Hunspell)" OFF)
option(CHATTERINO_NIGHTLY_BUILD "Specifies whether this is a nightly build." OFF)
option(CHATTERINO_SANITIZER_SUPPORT "Attempt to enable Sanitizer support on the test and app targets. Actual sanitizers can then be enabled with the SANITIZE_* options." OFF)
mark_as_advanced(CHATTERINO_SANITIZER_SUPPORT)
+1
View File
@@ -1133,6 +1133,7 @@ target_compile_definitions(${VERSION_PROJECT} PRIVATE
CHATTERINO_GIT_RELEASE=\"${GIT_RELEASE}\"
CHATTERINO_GIT_COMMIT=\"${GIT_COMMIT}\"
CHATTERINO_GIT_MODIFIED=${GIT_MODIFIED}
CHATTERINO_NIGHTLY_BUILD=$<BOOL:${CHATTERINO_NIGHTLY_BUILD}>
CHATTERINO_CMAKE_GEN_DATE=\"${cmake_gen_date}\"
)
+1 -6
View File
@@ -22,12 +22,7 @@ Modes::Modes()
{
auto line = QString(file.readLine()).trimmed();
// we need to know if it is a nightly build to disable updates on windows
if (line == "nightly")
{
this->isNightly = true;
}
else if (line == "portable")
if (line == "portable")
{
this->isPortable = true;
}
-1
View File
@@ -13,7 +13,6 @@ public:
static const Modes &instance();
bool isNightly{};
bool isPortable{};
/// Marked by the line `externally-packaged`
+10 -7
View File
@@ -4,24 +4,22 @@
#include "common/Version.hpp"
#include "common/Literals.hpp"
#include "common/Modes.hpp"
#include <QFileInfo>
#include <QStringBuilder>
namespace chatterino {
using namespace Qt::StringLiterals;
using namespace literals;
namespace chatterino {
Version::Version()
: version_(CHATTERINO_VERSION)
, commitHash_(QStringLiteral(CHATTERINO_GIT_HASH))
, isModified_(CHATTERINO_GIT_MODIFIED == 1)
, dateOfBuild_(QStringLiteral(CHATTERINO_CMAKE_GEN_DATE))
, isNightly_(CHATTERINO_NIGHTLY_BUILD == 1)
{
this->fullVersion_ = "Chatterino ";
if (Modes::instance().isNightly)
if (this->isNightly())
{
this->fullVersion_ += "Nightly ";
}
@@ -129,6 +127,11 @@ const QString &Version::extraString() const
return this->extraString_;
}
bool Version::isNightly() const
{
return this->isNightly_;
}
void Version::generateBuildString()
{
// e.g. Chatterino 2.3.5 or Chatterino Nightly 2.3.5
@@ -151,7 +154,7 @@ void Version::generateBuildString()
s += " built";
// If the build is a nightly build (decided with modes atm), include build date information
if (Modes::instance().isNightly)
if (this->isNightly())
{
s += " on " + this->dateOfBuild();
}
+7
View File
@@ -63,6 +63,11 @@ public:
// Returns an extra string about this specific build
const QString &extraString() const;
/// Returns true if this build is classified as a "nightly" (i.e. dev or unstable) build.
///
/// This is controlled by the CMake parameter CHATTERINO_NIGHTLY_BUILD, which defaults to off.
bool isNightly() const;
#ifdef Q_OS_WIN
/// Chatterino's App ID on Windows
///
@@ -92,6 +97,8 @@ private:
// Generate an extra string (e.g. "Built for Fedora 42.<br>Report bugs <a href...>here</a>")
void generateExtraString();
bool isNightly_;
#ifdef Q_OS_WIN
std::wstring appUserModelID_;
#endif
+1 -2
View File
@@ -102,8 +102,7 @@ int main(int argc, char **argv)
QString("%1 (commit %2%3)")
.arg(version.fullVersion())
.arg(version.commitHash())
.arg(Modes::instance().isNightly ? ", " + version.dateOfBuild()
: "");
.arg(version.isNightly() ? ", " + version.dateOfBuild() : "");
std::cout << versionMessage.toLocal8Bit().constData() << '\n';
std::cout.flush();
}
+1 -1
View File
@@ -315,7 +315,7 @@ void Updates::checkForUpdates()
}
// Disable updates if on nightly
if (Modes::instance().isNightly)
if (version.isNightly())
{
return;
}
+4 -7
View File
@@ -5,8 +5,7 @@
#include "widgets/dialogs/LastRunCrashDialog.hpp"
#include "common/Args.hpp"
#include "common/Literals.hpp"
#include "common/Modes.hpp"
#include "common/Version.hpp" // IWYU pragma: keep
#include "singletons/Paths.hpp"
#include "util/LayoutCreator.hpp"
@@ -21,9 +20,9 @@
#include <QStringBuilder>
#include <QVBoxLayout>
namespace {
using namespace Qt::StringLiterals;
using namespace chatterino::literals;
namespace {
const std::initializer_list<QString> MESSAGES = {
u"Oops..."_s, u"NotLikeThis"_s,
@@ -45,8 +44,6 @@ QString randomMessage()
namespace chatterino {
using namespace literals;
LastRunCrashDialog::LastRunCrashDialog(const Args &args, const Paths &paths)
{
this->setWindowFlag(Qt::WindowContextHelpButtonHint, false);
@@ -85,7 +82,7 @@ LastRunCrashDialog::LastRunCrashDialog(const Args &args, const Paths &paths)
"the crash</a> "
u"so it can be prevented in the future."_s;
if (Modes::instance().isNightly)
if (Version::instance().isNightly())
{
text += u" Make sure you're using the latest nightly version!"_s;
}