-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWindows-CMake.yml
94 lines (80 loc) · 3.38 KB
/
Windows-CMake.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#Template from: https://github.com/ThreeDeeJay/GitHub-Actions-build-templates/edit/main/Windows-CMake.yml
name: Build
env:
Branch: ${{github.ref_name}}
Platform: #Any CPU|Win32|x64
Configuration: Release
Artifacts: build/Release/
on:
push:
Branches: $Branch
pull_request:
Branches: $Branch
workflow_dispatch:
jobs:
Windows:
runs-on: windows-latest
steps:
- name: Clone repo and submodules
run: git clone --recurse-submodules https://github.com/${{github.repository}}.git . --branch ${{env.Branch}}
- name: Get current date, commit hash and count
run: |
echo "CommitDate=$(git show -s --date=format:'%Y-%m-%d' --format=%cd)" >> $env:GITHUB_ENV
echo "CommitHashShort=$(git rev-parse --short=7 HEAD)" >> $env:GITHUB_ENV
echo "CommitCount=$(git rev-list --count HEAD)" >> $env:GITHUB_ENV
# - name: Install Windows 8.1 SDK
# shell: powershell
# run: |
# Invoke-WebRequest -Method Get -Uri https://go.microsoft.com/fwlink/p/?LinkId=323507 -OutFile sdksetup.exe -UseBasicParsing
# Start-Process -Wait sdksetup.exe -ArgumentList "/q", "/norestart", "/features", "OptionId.WindowsDesktopSoftwareDevelopmentKit", "OptionId.NetFxSoftwareDevelopmentKit"
#
# - name: Cache DirectX SDK
# id: DXSDK_Jun10
# uses: actions/cache@v4
# with:
# path: ${{env.DXSDK_DIR}}
# key: DXSDK_Jun10
# - name: Install DirectX SDK
# if: steps.DXSDK_Jun10.outputs.cache-hit != 'true'
# shell: powershell
# run: |
# Invoke-WebRequest -Method Get -Uri https://download.microsoft.com/download/a/e/7/ae743f1f-632b-4809-87a9-aa1bb3458e31/DXSDK_Jun10.exe -OutFile DXSDK_Jun10.exe -UseBasicParsing
# Start-Process -Wait ./DXSDK_Jun10.exe -ArgumentList "/U"
# - name: Set DXSDK_DIR
# run: echo "DXSDK_DIR=C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\" >> $env:GITHUB_ENV
#
# - name: Install Qt
# uses: jurplel/install-qt-action@v4
# with:
# version: '6.6.0'
# host: 'windows'
# target: 'desktop'
# arch: 'win64_msvc2019_64'
# modules: 'addons.qtmultimedia'
- name: Build
run: |
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.Configuration}}
cmake --build ${{github.workspace}}/build --config ${{env.Configuration}}
# - name: Qt Deploy
# run: |
# windeployqt.exe "${{github.workspace}}/${{env.Artifacts}}/${{github.event.repository.name}}.exe"
- name: List files
run: ls -R
- name: Upload Installer Artifact to GitHub
uses: actions/upload-artifact@v4
with:
name: "${{github.event.repository.name}}_r${{env.CommitCount}}@${{env.CommitHashShort}}"
path: "${{github.workspace}}/${{env.Artifacts}}"
- name: Compress artifacts
uses: vimtor/[email protected]
with:
files: '${{env.Artifacts}}/'
dest: "build/${{github.event.repository.name}}_r${{env.CommitCount}}@${{env.CommitHashShort}}.zip"
- name: GitHub pre-release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{secrets.GITHUB_TOKEN}}"
automatic_release_tag: "latest"
prerelease: true
title: "[${{env.CommitDate}}] ${{github.event.repository.name}} r${{env.CommitCount}}@${{env.CommitHashShort}}"
files: "build/${{github.event.repository.name}}_r${{env.CommitCount}}@${{env.CommitHashShort}}.zip"