Skip to content

Commit

Permalink
Merge pull request #154 from chewing/nightly-build
Browse files Browse the repository at this point in the history
Setup Nightly pre-release
  • Loading branch information
kanru authored May 20, 2024
2 parents 68b9eff + fbb5e0e commit bdbc0ca
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 4 deletions.
119 changes: 119 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: Nightly Build

on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:

jobs:
x86:
runs-on: windows-latest
name: 32-bit Build

steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Configure build for x86
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756
with:
arch: x86
- name: Build
run: |
cmake -B x86 -A Win32
cmake --build x86 --config Release
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: |
x86\libchewing\data\*.dat
x86\libchewing\data\*.tab
x86\ChewingTextService\Release\*.dll
x86\libchewing\Release\*.dll
x86\ChewingPreferences\Release\*.exe
name: x86
retention-days: 1
x64:
runs-on: windows-latest
name: 64-bit Build

steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Configure build for x64
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756
with:
arch: x64
- name: Build
run: |
cmake -B x64 -A x64
cmake --build x64 --config Release
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: |
x64\libchewing\data\*.dat
x64\libchewing\data\*.tab
x64\ChewingTextService\Release\*.dll
x64\libchewing\Release\*.dll
x64\ChewingPreferences\Release\*.exe
name: x64
retention-days: 1
package:
runs-on: windows-latest
name: Build Installer
needs: [x86, x64]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- name: NSIS
run: |
mkdir nsis
copy installer\* nsis\
copy COPYING.txt nsis\
mkdir nsis\Dictionary
copy x64\libchewing\data\*.dat nsis\Dictionary\
copy x64\libchewing\data\*.tab nsis\Dictionary\
mkdir nsis\x86
copy x86\ChewingTextService\Release\*.dll nsis\x86\
copy x86\libchewing\Release\*.dll nsis\x86\
copy x86\ChewingPreferences\Release\*.exe nsis\
mkdir nsis\x64
copy x64\ChewingTextService\Release\*.dll nsis\x64\
copy x64\libchewing\Release\*.dll nsis\x64\
cd nsis
makensis installer.nsi
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: nsis\windows-chewing-tsf.exe
name: nsis
retention-days: 1
upload:
name: Update Nightly Release
permissions:
contents: write
runs-on: ubuntu-latest
needs: [package]
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: nsis
- name: Compute Checksum
run: |
sha256sum windows-chewing-tsf.exe > SHA256SUMS.txt
- name: Update nightly release
uses: andelf/nightly-release@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: nightly
prerelease: true
name: "Windows Chewing TSF nightly build $$"
body: |
This is a nightly build of Windows Chewing TSF.
files: |
./SHA256SUMS.txt
./windows-chewing-tsf.exe
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cxx_fla

project(windows-chewing-tsf)

option(BUILD_SHARED_LIBS "Build using shared libraries" ON)

# http://www.utf8everywhere.org/
add_definitions(
/D_UNICODE=1 /DUNICODE=1 # do Unicode build
/D_CRT_SECURE_NO_WARNINGS # disable warnings about old libc functions
/GR- # turn off C++ RTTI
)
set(CMAKE_CXX_FLAGS "/GR- ${CMAKE_CXX_FLAGS}") # turn off C++ RTTI

enable_testing()

Expand Down
7 changes: 4 additions & 3 deletions ChewingTextService/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ if(NOT DEFINED PROJECT_LIBCHEWING)
message(FATAL_ERROR "PROJECT_LIBCHEWING must be provided")
endif()

# http://www.utf8everywhere.org/
add_definitions(/D_UNICODE=1 /DUNICODE=1)

include_directories(
${PROJECT_LIBCHEWING}/include
${CMAKE_SOURCE_DIR}
Expand All @@ -26,6 +23,10 @@ add_library(ChewingTextService SHARED
${PROJECT_SOURCE_DIR}/ChewingTextService.rc
${PROJECT_SOURCE_DIR}/mainicon.ico
)

# http://www.utf8everywhere.org/
target_compile_definitions(ChewingTextService PRIVATE /D_UNICODE=1 /DUNICODE=1)

target_link_libraries(ChewingTextService
libchewing
libIME_static
Expand Down

0 comments on commit bdbc0ca

Please sign in to comment.