Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,20 @@ jobs:
platform: windows
qt_version: "6.10"

# ─── Windows (ARM) ─────────────────────────────────────────
- os: windows-11-arm
platform: windows
qt_version: "6.8"
qt_arch: win64_msvc2022_arm64
vs_arch: arm64
artifact_suffix: -arm64
- os: windows-11-arm
platform: windows
qt_version: "6.10"
qt_arch: win64_msvc2022_arm64
vs_arch: arm64
artifact_suffix: -arm64

# ─── Linux ─────────────────────────────────────────────────
- os: ubuntu-24.04
platform: linux
Expand Down Expand Up @@ -100,6 +114,7 @@ jobs:
version: ${{ matrix.qt_version }}
modules: 'qt5compat'
cache: true
arch: ${{ matrix.qt_arch }}

# ─── Install Qt (macOS via jdpurcell for arch support) ─────
- name: Install Qt (mac)
Expand All @@ -117,7 +132,7 @@ jobs:
if: matrix.platform == 'windows'
uses: egor-tensin/vs-shell@v2
with:
arch: x64
arch: ${{ matrix.vs_arch || 'x64' }}

- name: Install NSIS
if: matrix.platform == 'windows'
Expand Down Expand Up @@ -171,14 +186,14 @@ jobs:
uses: actions/upload-artifact@v7
if: matrix.platform == 'windows'
with:
name: NotepadNext-Windows-Qt${{ matrix.qt_version }}-Zip
name: NotepadNext-Windows-Qt${{ matrix.qt_version }}${{ matrix.artifact_suffix }}-Zip
path: ${{ github.workspace }}/build/package/

- name: Upload Windows Installer
uses: actions/upload-artifact@v7
if: matrix.platform == 'windows'
with:
name: NotepadNext-Windows-Qt${{ matrix.qt_version }}-Installer
name: NotepadNext-Windows-Qt${{ matrix.qt_version }}${{ matrix.artifact_suffix }}-Installer
path: ${{ github.workspace }}/installer/NotepadNext*.exe

- name: Upload MacOS dmg
Expand All @@ -202,6 +217,7 @@ jobs:
if: github.repository == 'dail8859/NotepadNext' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
QT_ARM64_RELEASE_VER: 6.8

steps:
- name: Checkout Repository
Expand All @@ -225,6 +241,18 @@ jobs:
cd ..
gh release upload ${{ github.ref_name }} NotepadNext-${{ github.ref_name }}-win64.zip

- name: Upload Windows arm64 Installer
run: |
mv NotepadNext-Windows-Qt$QT_ARM64_RELEASE_VER-arm64-Installer/NotepadNext-${{ github.ref_name }}-Installer.exe NotepadNext-${{ github.ref_name }}-Installer-arm64.exe
gh release upload ${{ github.ref_name }} NotepadNext-${{ github.ref_name }}-Installer-arm64.exe

- name: Upload Windows arm64 Zip
run: |
cd NotepadNext-Windows-Qt$QT_ARM64_RELEASE_VER-arm64-Zip/
zip -r ../NotepadNext-${{ github.ref_name }}-win64-arm64.zip .
cd ..
gh release upload ${{ github.ref_name }} NotepadNext-${{ github.ref_name }}-win64-arm64.zip

- name: Upload Linux AppImage
run: |
gh release upload ${{ github.ref_name }} NotepadNext-Linux-Qt$QT_RELEASE_VER-AppImage/NotepadNext-${{ github.ref_name }}-x86_64.AppImage
Expand Down
32 changes: 24 additions & 8 deletions cmake/PackagingWindows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,28 @@ list(APPEND WINDEPLOYQT_ARGS "${PACKAGE_DIR}/NotepadNext.exe")

file(GLOB EXTRA_DLLS "${EXTRA_DLL_DIR}/*.dll")

# Determine the target architecture. The extra OpenSSL DLLs used by the
# auto updater are only shipped for x64; ARM64 builds use Qt's Schannel
# TLS backend instead, so no OpenSSL DLLs are needed.
if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID MATCHES "ARM64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "ARM64|aarch64")
set(TARGET_ARCH "arm64")
else()
set(TARGET_ARCH "x64")
endif()

set(OPENSSL_DLL_COMMANDS "")
if(TARGET_ARCH STREQUAL "x64")
list(APPEND OPENSSL_DLL_COMMANDS
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/deploy/windows/libcrypto-1_1-x64.dll"
"${PACKAGE_DIR}/libcrypto-1_1-x64.dll"

COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/deploy/windows/libssl-1_1-x64.dll"
"${PACKAGE_DIR}/libssl-1_1-x64.dll"
)
endif()

# Define the package target
add_custom_target(package
COMMENT "Packaging NotepadNext for distribution"
Expand All @@ -39,14 +61,8 @@ add_custom_target(package
"${CMAKE_SOURCE_DIR}/LICENSE"
"${PACKAGE_DIR}/LICENSE"

# Copy the two extra DLLs
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/deploy/windows/libcrypto-1_1-x64.dll"
"${PACKAGE_DIR}/libcrypto-1_1-x64.dll"

COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/deploy/windows/libssl-1_1-x64.dll"
"${PACKAGE_DIR}/libssl-1_1-x64.dll"
# Copy the two extra DLLs (x64 only, see TARGET_ARCH above)
${OPENSSL_DLL_COMMANDS}

# Run windeployqt with correct flags
COMMAND windeployqt ${WINDEPLOYQT_ARGS}
Expand Down
5 changes: 4 additions & 1 deletion installer/installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,10 @@ ${MementoSection} "Auto Updater" SEC_AUTO_UPDATER
SetRegView 64
SetOutPath $INSTDIR

File ..\build\package\libcrypto-1_1-x64.dll ..\build\package\libssl-1_1-x64.dll
# The OpenSSL DLLs are only shipped with x64 builds; ARM64 builds use Qt's Schannel TLS backend
!if /FILEEXISTS "..\build\package\libcrypto-1_1-x64.dll"
File ..\build\package\libcrypto-1_1-x64.dll ..\build\package\libssl-1_1-x64.dll
!endif

WriteRegDWORD SHCTX "Software\NotepadNext\NotepadNext\" "AutoUpdate" 1
${MementoSectionEnd}
Expand Down
9 changes: 9 additions & 0 deletions src/dialogs/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2187,6 +2187,15 @@ void MainWindow::checkForUpdates(bool silent)
qInfo(Q_FUNC_INFO);

QString url = "https://github.com/dail8859/NotepadNext/raw/master/updates.json";

#if defined(_M_ARM64) || defined(__aarch64__)
// updates.json only points to the x64 installer, so ARM64 builds check
// the "windows-arm64" key instead. Until that key is added to the json,
// the updater will never report an available update which effectively
// disables the auto updater rather than downloading a useless x64 installer.
QSimpleUpdater::getInstance()->setPlatformKey(url, "windows-arm64");
#endif

QSimpleUpdater::getInstance()->checkForUpdates(url);

if (!silent) {
Expand Down
Loading