dev: specify nightly tag through cmake instead of modes file (#6798)
This commit is contained in:
@@ -9,6 +9,16 @@ on:
|
|||||||
- "release/*"
|
- "release/*"
|
||||||
pull_request:
|
pull_request:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
buildType:
|
||||||
|
description: "Build type"
|
||||||
|
required: true
|
||||||
|
type: choice
|
||||||
|
default: "auto"
|
||||||
|
options:
|
||||||
|
- auto
|
||||||
|
- nightly
|
||||||
|
- stable
|
||||||
merge_group:
|
merge_group:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
@@ -18,6 +28,7 @@ concurrency:
|
|||||||
env:
|
env:
|
||||||
C2_ENABLE_LTO: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/bugfix-release/') || startsWith(github.ref, 'refs/heads/release/') }}
|
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_REQUIRE_CLEAN_GIT: On
|
||||||
|
CHATTERINO_BUILD_TYPE: ${{ case(inputs.buildType != '', inputs.buildType, 'auto') }}
|
||||||
CONAN_VERSION: 2.11.0
|
CONAN_VERSION: 2.11.0
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -70,6 +81,29 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git config --global --add safe.directory '*'
|
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)
|
- name: Install Python and libclang (24.04)
|
||||||
if: matrix.os == 'ubuntu-24.04'
|
if: matrix.os == 'ubuntu-24.04'
|
||||||
run: |
|
run: |
|
||||||
@@ -93,6 +127,7 @@ jobs:
|
|||||||
-DCHATTERINO_LTO="$C2_ENABLE_LTO" \
|
-DCHATTERINO_LTO="$C2_ENABLE_LTO" \
|
||||||
-DCMAKE_PREFIX_PATH="$Qt6_DIR/lib/cmake" \
|
-DCMAKE_PREFIX_PATH="$Qt6_DIR/lib/cmake" \
|
||||||
-DCHATTERINO_STATIC_QT_BUILD=On \
|
-DCHATTERINO_STATIC_QT_BUILD=On \
|
||||||
|
-DCHATTERINO_NIGHTLY_BUILD=${{ steps.build-type.outputs.NIGHTLY_BUILD }} \
|
||||||
-DFORCE_JSON_GENERATION=${{matrix.os == 'ubuntu-24.04' && 'On' || 'Off'}} \
|
-DFORCE_JSON_GENERATION=${{matrix.os == 'ubuntu-24.04' && 'On' || 'Off'}} \
|
||||||
-DCHATTERINO_PLUGINS=${{ matrix.plugins && 'On' || 'Off' }} \
|
-DCHATTERINO_PLUGINS=${{ matrix.plugins && 'On' || 'Off' }} \
|
||||||
..
|
..
|
||||||
@@ -147,6 +182,29 @@ jobs:
|
|||||||
submodules: recursive
|
submodules: recursive
|
||||||
fetch-depth: 0 # allows for tags access
|
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
|
- name: Install Qt6
|
||||||
if: startsWith(matrix.qt-version, '6.')
|
if: startsWith(matrix.qt-version, '6.')
|
||||||
uses: jurplel/install-qt-action@v4.3.0
|
uses: jurplel/install-qt-action@v4.3.0
|
||||||
@@ -219,6 +277,7 @@ jobs:
|
|||||||
-DUSE_PRECOMPILED_HEADERS=ON `
|
-DUSE_PRECOMPILED_HEADERS=ON `
|
||||||
-DBUILD_WITH_CRASHPAD="$Env:C2_ENABLE_CRASHPAD" `
|
-DBUILD_WITH_CRASHPAD="$Env:C2_ENABLE_CRASHPAD" `
|
||||||
-DCHATTERINO_LTO="$Env:C2_ENABLE_LTO" `
|
-DCHATTERINO_LTO="$Env:C2_ENABLE_LTO" `
|
||||||
|
-DCHATTERINO_NIGHTLY_BUILD="${{ steps.build-type.outputs.NIGHTLY_BUILD }}" `
|
||||||
-DFORCE_JSON_GENERATION=On `
|
-DFORCE_JSON_GENERATION=On `
|
||||||
-DCHATTERINO_SPELLCHECK=On `
|
-DCHATTERINO_SPELLCHECK=On `
|
||||||
..
|
..
|
||||||
@@ -243,7 +302,6 @@ jobs:
|
|||||||
windeployqt bin/chatterino.exe --release --no-compiler-runtime --no-translations --no-opengl-sw --dir Chatterino2/
|
windeployqt bin/chatterino.exe --release --no-compiler-runtime --no-translations --no-opengl-sw --dir Chatterino2/
|
||||||
cp bin/chatterino.exe Chatterino2/
|
cp bin/chatterino.exe Chatterino2/
|
||||||
..\.CI\deploy-crt.ps1 Chatterino2
|
..\.CI\deploy-crt.ps1 Chatterino2
|
||||||
echo nightly > Chatterino2/modes
|
|
||||||
|
|
||||||
- name: Package (windows)
|
- name: Package (windows)
|
||||||
if: startsWith(matrix.os, 'windows')
|
if: startsWith(matrix.os, 'windows')
|
||||||
@@ -290,6 +348,7 @@ jobs:
|
|||||||
-DUSE_PRECOMPILED_HEADERS=OFF \
|
-DUSE_PRECOMPILED_HEADERS=OFF \
|
||||||
-DCHATTERINO_LTO="$C2_ENABLE_LTO" \
|
-DCHATTERINO_LTO="$C2_ENABLE_LTO" \
|
||||||
-DFORCE_JSON_GENERATION=Off \
|
-DFORCE_JSON_GENERATION=Off \
|
||||||
|
-DCHATTERINO_NIGHTLY_BUILD=${{ steps.build-type.outputs.NIGHTLY_BUILD }} \
|
||||||
-DCHATTERINO_SPELLCHECK=On \
|
-DCHATTERINO_SPELLCHECK=On \
|
||||||
..
|
..
|
||||||
make -j"$(sysctl -n hw.logicalcpu)"
|
make -j"$(sysctl -n hw.logicalcpu)"
|
||||||
|
|||||||
@@ -54,6 +54,7 @@
|
|||||||
- Bugfix: Disable "Sort Tabs Alphabetically" action when notebook layout is locked. (#6710)
|
- Bugfix: Disable "Sort Tabs Alphabetically" action when notebook layout is locked. (#6710)
|
||||||
- Bugfix: Fix highlight mentions not updating when username changes. (#6723, #6739)
|
- 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)
|
- 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: 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: 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)
|
- Dev: Remove unused QTextCodec includes. (#6487)
|
||||||
|
|||||||
@@ -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_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_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_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)
|
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)
|
mark_as_advanced(CHATTERINO_SANITIZER_SUPPORT)
|
||||||
|
|||||||
@@ -1133,6 +1133,7 @@ target_compile_definitions(${VERSION_PROJECT} PRIVATE
|
|||||||
CHATTERINO_GIT_RELEASE=\"${GIT_RELEASE}\"
|
CHATTERINO_GIT_RELEASE=\"${GIT_RELEASE}\"
|
||||||
CHATTERINO_GIT_COMMIT=\"${GIT_COMMIT}\"
|
CHATTERINO_GIT_COMMIT=\"${GIT_COMMIT}\"
|
||||||
CHATTERINO_GIT_MODIFIED=${GIT_MODIFIED}
|
CHATTERINO_GIT_MODIFIED=${GIT_MODIFIED}
|
||||||
|
CHATTERINO_NIGHTLY_BUILD=$<BOOL:${CHATTERINO_NIGHTLY_BUILD}>
|
||||||
|
|
||||||
CHATTERINO_CMAKE_GEN_DATE=\"${cmake_gen_date}\"
|
CHATTERINO_CMAKE_GEN_DATE=\"${cmake_gen_date}\"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -22,12 +22,7 @@ Modes::Modes()
|
|||||||
{
|
{
|
||||||
auto line = QString(file.readLine()).trimmed();
|
auto line = QString(file.readLine()).trimmed();
|
||||||
|
|
||||||
// we need to know if it is a nightly build to disable updates on windows
|
if (line == "portable")
|
||||||
if (line == "nightly")
|
|
||||||
{
|
|
||||||
this->isNightly = true;
|
|
||||||
}
|
|
||||||
else if (line == "portable")
|
|
||||||
{
|
{
|
||||||
this->isPortable = true;
|
this->isPortable = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ public:
|
|||||||
|
|
||||||
static const Modes &instance();
|
static const Modes &instance();
|
||||||
|
|
||||||
bool isNightly{};
|
|
||||||
bool isPortable{};
|
bool isPortable{};
|
||||||
|
|
||||||
/// Marked by the line `externally-packaged`
|
/// Marked by the line `externally-packaged`
|
||||||
|
|||||||
+10
-7
@@ -4,24 +4,22 @@
|
|||||||
|
|
||||||
#include "common/Version.hpp"
|
#include "common/Version.hpp"
|
||||||
|
|
||||||
#include "common/Literals.hpp"
|
|
||||||
#include "common/Modes.hpp"
|
|
||||||
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QStringBuilder>
|
#include <QStringBuilder>
|
||||||
|
|
||||||
namespace chatterino {
|
using namespace Qt::StringLiterals;
|
||||||
|
|
||||||
using namespace literals;
|
namespace chatterino {
|
||||||
|
|
||||||
Version::Version()
|
Version::Version()
|
||||||
: version_(CHATTERINO_VERSION)
|
: version_(CHATTERINO_VERSION)
|
||||||
, commitHash_(QStringLiteral(CHATTERINO_GIT_HASH))
|
, commitHash_(QStringLiteral(CHATTERINO_GIT_HASH))
|
||||||
, isModified_(CHATTERINO_GIT_MODIFIED == 1)
|
, isModified_(CHATTERINO_GIT_MODIFIED == 1)
|
||||||
, dateOfBuild_(QStringLiteral(CHATTERINO_CMAKE_GEN_DATE))
|
, dateOfBuild_(QStringLiteral(CHATTERINO_CMAKE_GEN_DATE))
|
||||||
|
, isNightly_(CHATTERINO_NIGHTLY_BUILD == 1)
|
||||||
{
|
{
|
||||||
this->fullVersion_ = "Chatterino ";
|
this->fullVersion_ = "Chatterino ";
|
||||||
if (Modes::instance().isNightly)
|
if (this->isNightly())
|
||||||
{
|
{
|
||||||
this->fullVersion_ += "Nightly ";
|
this->fullVersion_ += "Nightly ";
|
||||||
}
|
}
|
||||||
@@ -129,6 +127,11 @@ const QString &Version::extraString() const
|
|||||||
return this->extraString_;
|
return this->extraString_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Version::isNightly() const
|
||||||
|
{
|
||||||
|
return this->isNightly_;
|
||||||
|
}
|
||||||
|
|
||||||
void Version::generateBuildString()
|
void Version::generateBuildString()
|
||||||
{
|
{
|
||||||
// e.g. Chatterino 2.3.5 or Chatterino Nightly 2.3.5
|
// e.g. Chatterino 2.3.5 or Chatterino Nightly 2.3.5
|
||||||
@@ -151,7 +154,7 @@ void Version::generateBuildString()
|
|||||||
s += " built";
|
s += " built";
|
||||||
|
|
||||||
// If the build is a nightly build (decided with modes atm), include build date information
|
// 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();
|
s += " on " + this->dateOfBuild();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,6 +63,11 @@ public:
|
|||||||
// Returns an extra string about this specific build
|
// Returns an extra string about this specific build
|
||||||
const QString &extraString() const;
|
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
|
#ifdef Q_OS_WIN
|
||||||
/// Chatterino's App ID on Windows
|
/// 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>")
|
// Generate an extra string (e.g. "Built for Fedora 42.<br>Report bugs <a href...>here</a>")
|
||||||
void generateExtraString();
|
void generateExtraString();
|
||||||
|
|
||||||
|
bool isNightly_;
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
std::wstring appUserModelID_;
|
std::wstring appUserModelID_;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+1
-2
@@ -102,8 +102,7 @@ int main(int argc, char **argv)
|
|||||||
QString("%1 (commit %2%3)")
|
QString("%1 (commit %2%3)")
|
||||||
.arg(version.fullVersion())
|
.arg(version.fullVersion())
|
||||||
.arg(version.commitHash())
|
.arg(version.commitHash())
|
||||||
.arg(Modes::instance().isNightly ? ", " + version.dateOfBuild()
|
.arg(version.isNightly() ? ", " + version.dateOfBuild() : "");
|
||||||
: "");
|
|
||||||
std::cout << versionMessage.toLocal8Bit().constData() << '\n';
|
std::cout << versionMessage.toLocal8Bit().constData() << '\n';
|
||||||
std::cout.flush();
|
std::cout.flush();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -315,7 +315,7 @@ void Updates::checkForUpdates()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Disable updates if on nightly
|
// Disable updates if on nightly
|
||||||
if (Modes::instance().isNightly)
|
if (version.isNightly())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,7 @@
|
|||||||
#include "widgets/dialogs/LastRunCrashDialog.hpp"
|
#include "widgets/dialogs/LastRunCrashDialog.hpp"
|
||||||
|
|
||||||
#include "common/Args.hpp"
|
#include "common/Args.hpp"
|
||||||
#include "common/Literals.hpp"
|
#include "common/Version.hpp" // IWYU pragma: keep
|
||||||
#include "common/Modes.hpp"
|
|
||||||
#include "singletons/Paths.hpp"
|
#include "singletons/Paths.hpp"
|
||||||
#include "util/LayoutCreator.hpp"
|
#include "util/LayoutCreator.hpp"
|
||||||
|
|
||||||
@@ -21,9 +20,9 @@
|
|||||||
#include <QStringBuilder>
|
#include <QStringBuilder>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
namespace {
|
using namespace Qt::StringLiterals;
|
||||||
|
|
||||||
using namespace chatterino::literals;
|
namespace {
|
||||||
|
|
||||||
const std::initializer_list<QString> MESSAGES = {
|
const std::initializer_list<QString> MESSAGES = {
|
||||||
u"Oops..."_s, u"NotLikeThis"_s,
|
u"Oops..."_s, u"NotLikeThis"_s,
|
||||||
@@ -45,8 +44,6 @@ QString randomMessage()
|
|||||||
|
|
||||||
namespace chatterino {
|
namespace chatterino {
|
||||||
|
|
||||||
using namespace literals;
|
|
||||||
|
|
||||||
LastRunCrashDialog::LastRunCrashDialog(const Args &args, const Paths &paths)
|
LastRunCrashDialog::LastRunCrashDialog(const Args &args, const Paths &paths)
|
||||||
{
|
{
|
||||||
this->setWindowFlag(Qt::WindowContextHelpButtonHint, false);
|
this->setWindowFlag(Qt::WindowContextHelpButtonHint, false);
|
||||||
@@ -85,7 +82,7 @@ LastRunCrashDialog::LastRunCrashDialog(const Args &args, const Paths &paths)
|
|||||||
"the crash</a> "
|
"the crash</a> "
|
||||||
u"so it can be prevented in the future."_s;
|
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;
|
text += u" Make sure you're using the latest nightly version!"_s;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user