Skip to content

Commit

Permalink
CI: modify ci
Browse files Browse the repository at this point in the history
  • Loading branch information
KangLin committed Feb 20, 2024
1 parent 298f2d1 commit 4cf11bd
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 952 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
arch: 'gcc_64'
set-env: false
cache: true
cache-key-prefix: install-qt-action
cache-key-prefix: cached_qt

- name: Install Qt of android
uses: jurplel/install-qt-action@v3
Expand All @@ -102,7 +102,7 @@ jobs:
# Additional Qt modules to install
modules: '${{env.qt_modules}}' # optional. See: https://ddalcino.github.io/aqt-list-server/
cache: true
cache-key-prefix: install-qt-action
cache-key-prefix: cached_qt

- name: git clone RabbitCommon
working-directory: ${{env.SOURCE_DIR}}
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
cmake --build . --config ${{matrix.BUILD_TYPE}} --target install
APK_FILE=`find . -name "android-*.apk"`
cp $APK_FILE Calendar_${{env.Calendar_VERSION}}_${{matrix.qt_arch}}_qt${{matrix.qt_version}}_${{matrix.BUILD_TYPE}}.apk
7z a Calendar_${{env.Calendar_VERSION}}_${{matrix.qt_arch}}_qt${{matrix.qt_version}}_${{matrix.BUILD_TYPE}}.zip install/*
# 7z a Calendar_${{env.Calendar_VERSION}}_${{matrix.qt_arch}}_qt${{matrix.qt_version}}_${{matrix.BUILD_TYPE}}.zip install/*

- name: Update configure file
working-directory: ${{github.workspace}}/build
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ jobs:
echo "$file"
if [ -f $file ]; then
if [ "${file##*.}" != "xml" ] && [ "${file##*.}" != "json" ]; then
echo "md5sum $file"
md5sum $file > $file.md5sum
cat $file.md5sum >> ${{github.workspace}}/Note.md
fi
Expand All @@ -98,4 +97,4 @@ jobs:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --notes-file ${{github.workspace}}/Note.md
gh release upload ${{ github.ref_name }} ${{github.workspace}}/${{ env.artifact_path }}/* ${{github.workspace}}/Note.md ${{ github.workspace }}/update.json
gh release upload ${{ github.ref_name }} ${{github.workspace}}/${{ env.artifact_path }}/* ${{github.workspace}}/Note.md ${{github.workspace}}/update.json
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
arch: '${{matrix.qt_arch}}' # optional
modules: '${{env.qt_modules}}' # optional. See: https://ddalcino.github.io/aqt-list-server/
cache: true
cache-key-prefix: install-qt-action
cache-key-prefix: cached_qt

- name: git clone RabbitCommon
working-directory: ${{env.SOURCE_DIR}}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/msvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
arch: '${{matrix.qt_arch}}' # optional
modules: '${{env.qt_modules}}' # optional. See: https://ddalcino.github.io/aqt-list-server/
cache: true
cache-key-prefix: install-qt-action
cache-key-prefix: cached_qt

- name: git clone RabbitCommon
working-directory: ${{env.SOURCE_DIR}}
Expand Down
152 changes: 52 additions & 100 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,163 +1,115 @@
#TODO: Change version
version: 'v1.0.18.{build}'

cache:
- ..\other_source
-
# Clean cached
# https://www.appveyor.com/docs/build-cache/#cleaning-up-cache

environment:
CalendarVersion: v0.0.26
CalendarVersion: v1.0.18
STOREPASS:
secure: l9BZEU39F1a4vSkhwl0CHR+yh6CD1c7byGzMv+1NUa4=
QT_USER:
secure: EoBPaPuJ6u9UDYpQWjKhUg==
QT_PASSWORD:
secure: ejAYGgB+3sBispRxUSr0xw==

matrix:
##### msvc 2015 ########
- BUILD_TARGERT: windows_msvc
GENERATORS: "Visual Studio 14 2015"
TOOLCHAIN_VERSION: 14
QT_ROOT: C:\Qt\5.10\msvc2015
BUILD_ARCH: x86

- BUILD_TARGERT: windows_msvc
GENERATORS: "Visual Studio 14 2015 Win64"
TOOLCHAIN_VERSION: 14
QT_ROOT: C:\Qt\5.10\msvc2015_64
BUILD_ARCH: x64

- BUILD_TARGERT: windows_msvc
GENERATORS: "Visual Studio 14 2015"
- GENERATORS: "Visual Studio 14 2015"
TOOLCHAIN_VERSION: 14
QT_ROOT: C:\Qt\5.6\msvc2015
BUILD_ARCH: x86

- BUILD_TARGERT: windows_msvc
GENERATORS: "Visual Studio 14 2015 Win64"
- GENERATORS: "Visual Studio 14 2015 Win64"
TOOLCHAIN_VERSION: 14
QT_ROOT: C:\Qt\5.6\msvc2015_64
BUILD_ARCH: x64

##### msvc 2017 ########
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
GENERATORS: "Visual Studio 15 2017"
BUILD_TARGERT: windows_msvc
TOOLCHAIN_VERSION: 15
QT_ROOT: C:\Qt\5.12\msvc2017
BUILD_ARCH: x86
STATIC: ON

- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
GENERATORS: "Visual Studio 15 2017 Win64"
BUILD_TARGERT: windows_msvc
TOOLCHAIN_VERSION: 15
QT_ROOT: C:\Qt\5.12\msvc2017_64
BUILD_ARCH: x64
STATIC: ON

- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
GENERATORS: "Visual Studio 15 2017 Win64"
BUILD_TARGERT: windows_msvc
TOOLCHAIN_VERSION: 15
QT_ROOT: C:\Qt\5.10\msvc2017_64
BUILD_ARCH: x64

- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
GENERATORS: "Visual Studio 15 2017 Win64"
BUILD_TARGERT: windows_msvc
TOOLCHAIN_VERSION: 15
QT_ROOT: C:\Qt\5.9\msvc2017_64
BUILD_ARCH: x64

matrix:
fast_finish: false

init:
- set varch=%BUILD_ARCH%
- if "%BUILD_ARCH%" == "x64" set varch=amd64
- if "%BUILD_TARGERT%" == "windows_msvc" if %TOOLCHAIN_VERSION% LSS 15 (call "C:\Program Files (x86)\Microsoft Visual Studio %TOOLCHAIN_VERSION%.0\VC\vcvarsall.bat" %varch%) else (call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" %varch%)
- if %TOOLCHAIN_VERSION% LSS 15 (call "C:\Program Files (x86)\Microsoft Visual Studio %TOOLCHAIN_VERSION%.0\VC\vcvarsall.bat" %varch%) else (call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" %varch%)
- echo NUMBER_OF_PROCESSORS=%NUMBER_OF_PROCESSORS%
- echo PROCESSOR_IDENTIFIER=%PROCESSOR_IDENTIFIER%
- if NOT "%QT_ROOT%" == "NO" for /f "delims=" %%i in ('%QT_ROOT%/bin/qmake -query QT_VERSION') do (set QT_VERSION=%%i)
- if NOT "%QT_ROOT%" == "NO" for /f "delims=" %%i in ('%QT_ROOT%/bin/qmake -query QT_VERSION') do (set QT_VERSION=%%i)
- echo QT_ROOT=%QT_ROOT%
- echo QT_VERSION=%QT_VERSION%
- del C:\msys64\usr\bin\link.exe

install:
- C:\msys64\autorebase.bat
- C:\msys64\usr\bin\pacman.exe -S --noconfirm unzip
#- if "%BUILD_TARGERT%"=="windows_mingw" set PATH=C:\Qt\Tools\mingw%TOOLCHAIN_VERSION%_32\bin;%PATH%
- if "%BUILD_TARGERT%" == "windows_mingw" set MSYSTEM=MINGW32 #设置编译系统为MINGW32

- cd %APPVEYOR_BUILD_FOLDER%
- git submodule update --init --recursive
- git clone https://github.com/KangLin/RabbitCommon.git
- if "%BUILD_TARGERT%" == "android" C:\msys64\usr\bin\bash.exe %APPVEYOR_BUILD_FOLDER%\ci\build-install-tools-windows.sh
- set RabbitCommon_DIR=%APPVEYOR_BUILD_FOLDER%/RabbitCommon

before_build:
- cd %APPVEYOR_BUILD_FOLDER%
- set OTHER_SOURCE=%APPVEYOR_BUILD_FOLDER%\..\other_source
- set INSTALL_DIR=%OTHER_SOURCE%\install_dir
- set VCPKG_DIR=%OTHER_SOURCE%\vcpkg
- if not exist "%OTHER_SOURCE%" ( mkdir "%OTHER_SOURCE%" )
- if not exist "%INSTALL_DIR%" (mkdir "%INSTALL_DIR%")

- cd %OTHER_SOURCE%
- set CMAKE_VERSION=3.26.4
- set CMAKE_VERSION=3.28.3
- if not exist cmake-%CMAKE_VERSION%-windows-i386 (curl -fsSL -o cmake-%CMAKE_VERSION%-windows-i386.zip https://github.com/Kitware/CMake/releases/download/v%CMAKE_VERSION%/cmake-%CMAKE_VERSION%-windows-i386.zip && 7z x cmake-%CMAKE_VERSION%-windows-i386.zip)
- cd cmake-%CMAKE_VERSION%-windows-i386
- set PATH="%CD%/bin";%PATH%

- cd %OTHER_SOURCE%
- if not exist "%INSTALL_DIR%" (mkdir "%INSTALL_DIR%")
- cd %OTHER_SOURCE%
- if not exist vcpkg (git clone "https://github.com/microsoft/vcpkg.git" && cd "%VCPKG_DIR%" && git checkout -b a1a1cbc975abf909a6c8985a6a2b8fe20bbd9bd6 a1a1cbc975abf909a6c8985a6a2b8fe20bbd9bd6 )
- cd %VCPKG_DIR%
- bootstrap-vcpkg.bat
#- vcpkg --triplet %BUILD_ARCH%-windows install zlib openssl
- set VCPKG_DIR=%OTHER_SOURCE%\vcpkg
- if not exist %VCPKG_DIR% (git clone "https://github.com/microsoft/vcpkg.git" && cd "%VCPKG_DIR%" && git checkout -b a1a1cbc975abf909a6c8985a6a2b8fe20bbd9bd6 a1a1cbc975abf909a6c8985a6a2b8fe20bbd9bd6 && bootstrap-vcpkg.bat)

- cd "%OTHER_SOURCE%"
- if exist RabbitCommon (rmdir /s /q "RabbitCommon")
- if not exist RabbitCommon (git clone "https://github.com/KangLin/RabbitCommon.git")
- set RabbitCommon_DIR=%OTHER_SOURCE%/RabbitCommon
before_build:

build_script:
- cd %APPVEYOR_BUILD_FOLDER%
- mkdir build
- cd build
- cmake .. -G"%GENERATORS%" -DQT_DIR=%QT_ROOT%/lib/cmake/Qt5 -DQt5_DIR=%QT_ROOT%/lib/cmake/Qt5 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="%cd%/install" -DCMAKE_PREFIX_PATH="%INSTALL_DIR%" -DCMAKE_TOOLCHAIN_FILE="%VCPKG_DIR%/scripts/buildsystems/vcpkg.cmake"
- cmake %APPVEYOR_BUILD_FOLDER% ^
-G"%GENERATORS%" ^
-DCMARK_SHARED=OFF ^
-DCMARK_TESTS=OFF ^
-DCMARK_STATIC=ON ^
-DQT_DIR=%QT_ROOT%/lib/cmake/Qt5 ^
-DQt5_DIR=%QT_ROOT%/lib/cmake/Qt5 ^
-DINSTALL_QT=ON ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_INSTALL_PREFIX="%cd%/install" ^
-DCMAKE_PREFIX_PATH="%INSTALL_DIR%" ^
-DCMAKE_TOOLCHAIN_FILE="%VCPKG_DIR%/scripts/buildsystems/vcpkg.cmake" ^
-DX_VCPKG_APPLOCAL_DEPS_INSTALL=ON ^
-DVCPKG_APPLOCAL_DEPS=ON
- cmake --build . --config Release
- cmake --build . --config Release --target install

#- echo "xcopy /Y %VCPKG_DIR%\installed\%BUILD_ARCH%-windows\bin\*.dll install\bin"
#- xcopy /Y %VCPKG_DIR%\installed\%BUILD_ARCH%-windows\bin\*.dll install\bin
#- xcopy /Y %INSTALL_DIR%\bin\*.dll install\bin
- call "C:\Program Files (x86)\NSIS\makensis.exe" Install.nsi
- copy /Y Calendar_Setup_%CalendarVersion%.exe Calendar_%CalendarVersion%_winxp_%BUILD_ARCH%_Setup.exe

after_build:
- rmdir /S /Q "%VCPKG_DIR%/buildtrees"
- rmdir /S /Q "%VCPKG_DIR%/installed"

artifacts:
- path: Calendar_Setup_*.exe
#name: Calendar_$(BUILD_TARGERT)$(TOOLCHAIN_VERSION)_$(BUILD_ARCH)_$(QT_VERSION)_$(appveyor_build_version)
#type: zip
- path: Calendar_$(CalendarVersion)_winxp_$(BUILD_ARCH)_Setup.exe

test: off

##See:https://www.appveyor.com/docs/deployment/github/
#deploy:
# - provider: GitHub
# #release: Tasks$(appveyor_build_version)
# #description: 'Release Tasks $(APPVEYOR_REPO_TAG_NAME) on windows'
# #token : https://github.com/settings/tokens
# #password encrypt: https://ci.appveyor.com/tools/encrypt
# auth_token:
# secure: aPr1U6S1RtXZiK2mCWtAAIOMjuiBR0yPsD2kaYIADtx2ulIitdp336kFqmfKwM9x
# #artifact: Tasks$(BUILD_TARGERT)$(TOOLCHAIN_VERSION)_$(BUILD_ARCH)_$(QT_VERSION)_$(appveyor_build_version)
# #draft: true
# #prerelease: true
# force_update: true
# on:
# BUILD_TARGERT: windows_msvc
# TOOLCHAIN_VERSION: 12
# QT_VERSION: 5.6.3
# BUILD_ARCH: x86
# appveyor_repo_tag: true # deploy on tag push only
#See:https://www.appveyor.com/docs/deployment/github/
deploy:
- provider: GitHub
#release: Tasks$(appveyor_build_version)
#description: 'Release Tasks $(APPVEYOR_REPO_TAG_NAME) on windows'
#token : https://github.com/settings/tokens
#password encrypt: https://ci.appveyor.com/tools/encrypt
auth_token:
secure: aPr1U6S1RtXZiK2mCWtAAIOMjuiBR0yPsD2kaYIADtx2ulIitdp336kFqmfKwM9x
#artifact: Tasks$(BUILD_TARGERT)$(TOOLCHAIN_VERSION)_$(BUILD_ARCH)_$(QT_VERSION)_$(appveyor_build_version)
#draft: true
#prerelease: true
force_update: true
on:
TOOLCHAIN_VERSION: 14
QT_VERSION: 5.6.3
BUILD_ARCH: x86
appveyor_repo_tag: true # deploy on tag push only
Loading

0 comments on commit 4cf11bd

Please sign in to comment.