Skip to content

Commit

Permalink
try fix Win CI
Browse files Browse the repository at this point in the history
  • Loading branch information
tamlok committed Apr 30, 2024
1 parent a049689 commit d32c123
Showing 1 changed file with 4 additions and 117 deletions.
121 changes: 4 additions & 117 deletions .github/workflows/ci-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,126 +80,13 @@ jobs:
git clone https://github.com/tamlok/openssl-utils.git openssl-utils.git --depth=1
working-directory: ${{runner.workspace}}/build

- name: Download JOM
uses: suisei-cn/actions-download-file@v1
with:
url: http://download.qt.io/official_releases/jom/jom.zip
target: ${{runner.temp}}\

- name: Unzip JOM
run: |
7z x jom.zip -ojom
working-directory: ${{runner.temp}}

- name: Configure and Build Project
shell: cmd
run: |
qmake --version
cmake --version
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{matrix.config.platform}}
qmake -r -spec win32-msvc CONFIG-=debug CONFIG+=release %GITHUB_WORKSPACE%\vnote.pro
${{runner.temp}}\jom\jom
working-directory: ${{runner.workspace}}/build

- name: Package Project 1
shell: cmd
run: |
qmake --version
mkdir "%DISTRIB_PATH%"
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{matrix.config.platform}}
windeployqt.exe --dir "%DISTRIB_PATH%" .\src\release\vnote.exe
copy .\src\release\vnote.exe "%DISTRIB_PATH%\vnote.exe"
copy .\src\release\vnote_extra.rcc "%DISTRIB_PATH%\vnote_extra.rcc"
copy .\libs\vtextedit\src\libs\syntax-highlighting\release\VSyntaxHighlighting.dll "%DISTRIB_PATH%\VSyntaxHighlighting.dll"
copy .\libs\vtextedit\src\editor\release\VTextEdit.dll "%DISTRIB_PATH%\VTextEdit.dll"
copy "%GITHUB_WORKSPACE%\package\qt.conf" "%DISTRIB_PATH%\qt.conf"
copy "%GITHUB_WORKSPACE%\README.md" "%DISTRIB_PATH%\README.md"
copy "%GITHUB_WORKSPACE%\COPYING.LESSER" "%DISTRIB_PATH%\COPYING.LESSER"
echo %GITHUB_SHA% > "%DISTRIB_PATH%\commit"
del /F /Q "%DISTRIB_PATH%\translations\qt_*.qm"
cmake -GNinja -DCMAKE_BUILD_TYPE=Release ..
cmake -v --build . --target=deploy
cmake -v --build . --target=pack
working-directory: ${{runner.workspace}}/build
env:
DISTRIB_PATH: ${{runner.workspace}}/build/distrib/vnote

- name: "Package Project: Copy OpenSSL on 5.15"
shell: cmd
if: ${{startsWith(matrix.config.qt, '5.15')}}
run: |
set openssl_dir=openssl-utils.git\1.1.1j\Win_${{matrix.config.platform}}
copy %openssl_dir%\lib*.dll "%DISTRIB_PATH%\"
working-directory: ${{runner.workspace}}/build
env:
DISTRIB_PATH: ${{runner.workspace}}/build/distrib/vnote

- name: Package Project 2
shell: cmd
run: |
7z a vnote-win-${{matrix.config.platform}}-qt${{matrix.config.qt}}.zip "%DISTRIB_PATH%"
copy vnote-win-${{matrix.config.platform}}-qt${{matrix.config.qt}}.zip vnote-win-${{matrix.config.platform}}-qt${{matrix.config.qt}}_v${{env.VNOTE_VER}}.zip
working-directory: ${{runner.workspace}}/build
env:
DISTRIB_PATH: ${{runner.workspace}}/build/distrib/vnote

- name: Package Installer
if: ${{startsWith(matrix.config.qt, '6.')}}
shell: cmd
run: |
copy "%GITHUB_WORKSPACE%\src\data\core\icons\vnote.ico" "%DISTRIB_PATH%\vnote.ico"
git clone https://github.com/vnotex/mkmsi.git mkmsi.git --depth=1
python .\mkmsi.git\mkmsi.py --auto-create qt --source-dir "%DISTRIB_PATH%" --wix-root "C:\Program Files (x86)\WiX Toolset v3.11" --merge-module "C:\Program Files (x86)\Common Files\Merge Modules\Microsoft_VC140_CRT_${{matrix.config.platform}}.msm" --add-desktop-shortcut --project-version ${{env.VNOTE_VER}} --license %GITHUB_WORKSPACE%\package\lgpl-3.0.rtf --executable vnote.exe --wix-banner %GITHUB_WORKSPACE%\package\wix_banner.png --wix-dialog %GITHUB_WORKSPACE%\package\wix_dialog.png VNote
move VNote.msi .\distrib\VNote-win-${{matrix.config.platform}}-qt${{matrix.config.qt}}_v${{env.VNOTE_VER}}.msi
del "%DISTRIB_PATH%\vnote.ico"
working-directory: ${{runner.workspace}}/build
env:
DISTRIB_PATH: ${{runner.workspace}}/build/distrib/vnote

- name: Archive Artifacts
uses: actions/upload-artifact@v2
with:
name: vnote-win-${{matrix.config.platform}}-qt${{matrix.config.qt}}_v${{env.VNOTE_VER}}
path: ${{env.DISTRIB_PATH}}
env:
DISTRIB_PATH: ${{runner.workspace}}/build/distrib/vnote

- name: Archive Installer
if: ${{startsWith(matrix.config.qt, '6.')}}
uses: actions/upload-artifact@v2
with:
name: VNote-win-${{matrix.config.platform}}-qt${{matrix.config.qt}}_v${{env.VNOTE_VER}}.msi
path: ${{runner.workspace}}/build/distrib/VNote*.msi
env:
DISTRIB_PATH: ${{runner.workspace}}/build/distrib/vnote

- name: Update Tag
if: github.ref == 'refs/heads/master'
shell: bash
run: |
git tag --force continuous-build ${GITHUB_SHA}
git push --force --tags
- name: Update Continuous Build Release
if: github.ref == 'refs/heads/master'
uses: johnwbyrd/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: ${{runner.workspace}}/build/vnote-win-${{matrix.config.platform}}-qt${{matrix.config.qt}}.zip
release: Continuous Build
tag: continuous-build

- name: Test
shell: cmd
run: |
dir .
dir .\distrib
working-directory: ${{runner.workspace}}/build

- name: Release
if: github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, '[Release]')
uses: ncipollo/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
# We need hard code here.
artifacts: "D:/a/vnote/build/vnote-win-${{matrix.config.platform}}-qt${{matrix.config.qt}}_v${{env.VNOTE_VER}}.zip"
commit: master
tag: v${{env.VNOTE_VER}}
allowUpdates: true
draft: true

0 comments on commit d32c123

Please sign in to comment.