Skip to content

Merge pull request #7 from shun-iwasawa/github_actions #1

Merge pull request #7 from shun-iwasawa/github_actions

Merge pull request #7 from shun-iwasawa/github_actions #1

name: Windows Build
on: [push, pull_request]
jobs:
Windows:
runs-on: windows-2022
env:
QT_ROOT: ${{github.workspace}}/3rdparty/qt
QT_URL: https://github.com/shun-iwasawa/qt5/releases/download/v5.15.2_wintab/Qt5.15.2_wintab.zip
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: C:/vcpkg/installed
key: ${{ runner.os }}-vcpkg-${{ env.vcpkg_ref }}-${{ github.sha }}
restore-keys: ${{ runner.os }}-vcpkg-${{ env.vcpkg_ref }}-
- name: Cache Qt
id: cache-qt
uses: actions/cache@v4
with:
path: ${{env.QT_ROOT}}
key: ${{ runner.os }}-QtCache
- name: Install Qt
run: |
# fix up paths to be forward slashes consistently
QT_ROOT=$(echo $QT_ROOT | sed 's/\\/\//g')
mkdir -p $QT_ROOT
curl --progress-bar -L -o $QT_ROOT/Qt.zip $QT_URL
7z -o$QT_ROOT x $QT_ROOT/Qt.zip -y -bd
rm -f $QT_ROOT/Qt.zip
shell: bash
- name: Build
run: |
mkdir build | Out-Null
cd build
$env:QT_PATH = '${{ env.QT_ROOT }}/Qt5.15.2_wintab/5.15.2_wintab/msvc2019_64'
cmake ../sources -G 'Visual Studio 17 2022' -Ax64 -DQTDIR="$env:QT_PATH"
cmake --build . --config Release
- name: Create Artifact
env:
VCINSTALLDIR: 'C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC'
run: |
mkdir artifact | Out-Null
cd artifact
mkdir xdts_viewer | Out-Null
cd xdts_viewer
cp -Recurse ../../xdts_viewer_resources xdts_viewer_resources
cp ../../build/Release/* .
${{ env.QT_ROOT }}/Qt5.15.2_wintab/5.15.2_wintab/msvc2019_64/bin/windeployqt.exe xdts_viewer.exe
- uses: actions/upload-artifact@v4
with:
name: xdts_viewer-${{ runner.os }}-${{ github.sha }}
path: artifact