chore: Better version display. #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
release: | |
types: [ published ] | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
permissions: write-all | |
jobs: | |
build: | |
runs-on: windows-2019 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: '6.5.3' | |
host: 'windows' | |
target: 'desktop' | |
arch: 'win64_msvc2019_64' | |
modules: 'qt5compat' | |
cache: 'true' | |
cache-key-prefix: 'install-qt-action' | |
- name: Build nightly | |
if: github.event_name != 'release' | |
run: | | |
mkdir build | |
cmake -D NIGHTLY_BUILD=ON -D GIT_HASH=$(git rev-parse --short=7 HEAD) -S . -B build | |
cmake --build build --target HITszConnectForWindows --config Release | |
- name: Build release | |
if: github.event_name == 'release' | |
run: | | |
TAG=$(git describe --tags) | |
mkdir build | |
cmake -D NIGHTLY_BUILD=OFF -D GIT_TAG=${TAG#v} -S . -B build | |
cmake --build build --target HITszConnectForWindows --config Release | |
- name: Download and copy files | |
env: | |
VCINSTALLDIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC' | |
run: | | |
mkdir "HITsz Connect for Windows" | |
cd "HITsz Connect for Windows" | |
cp ../build/Release/HITszConnectForWindows.exe . | |
windeployqt.exe HITszConnectForWindows.exe | |
rm vc_redist.x64.exe | |
curl -LO https://github.com/Mythologyli/zju-connect/releases/latest/download/zju-connect-windows-amd64.zip | |
tar -xf zju-connect-windows-amd64.zip | |
rm zju-connect-windows-amd64.zip | |
cp ../libs/wintun/bin/amd64/wintun.dll . | |
cd .. | |
Compress-Archive -Path "HITsz Connect for Windows" -DestinationPath HITsz-Connect-for-Windows.zip | |
Get-FileHash HITsz-Connect-for-Windows.zip | Format-List | Out-File -FilePath SHA256.txt | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: HITsz-Connect-for-Windows | |
path: HITsz-Connect-for-Windows.zip | |
- name: Upload SHA256.txt | |
uses: actions/upload-artifact@v4 | |
with: | |
name: SHA256 | |
path: SHA256.txt | |
- name: Upload to release | |
if: github.event_name == 'release' | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
run: | | |
gh release upload ${{ github.event.release.tag_name }} HITsz-Connect-for-Windows.zip | |
gh release upload ${{ github.event.release.tag_name }} SHA256.txt |