-
Notifications
You must be signed in to change notification settings - Fork 96
121 lines (100 loc) · 3.57 KB
/
windows.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: Windows Builds
on:
push:
paths-ignore:
- '**.md'
- 'LICENSE'
- 'Assets/**'
- 'Docs/**'
pull_request:
paths-ignore:
- '**.md'
- 'LICENSE'
- 'Assets/**'
- 'Docs/**'
workflow_dispatch:
env:
PLATFORM_NAME: Win32
BUILD_TYPE: RelWithDebInfo
UPLOAD_ARTIFACT: true
CACHE_DEPS: false
FIXED_CMAKE_VERSION: 3.21.4
jobs:
Build:
runs-on: windows-2019
defaults:
run:
shell: cmd
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Prepare build directory
run: mkdir Build
- name: Generate dependencies cache key
if: env.CACHE_DEPS == 'true'
run: |
curl -o Build/DepsRef.json https://api.github.com/repos/SpriteOvO/AirPodsDesktop-Deps/git/refs/heads/main
type DepsRef.json
- name: Dependencies cache
id: cache-deps
if: env.CACHE_DEPS == 'true'
uses: actions/cache@v2
with:
path: Build/AirPodsDesktop-Deps
key: ${{ hashFiles('Build/DepsRef.json') }}
- name: Clone dependencies
if: env.CACHE_DEPS != 'true' || steps.cache-deps.outputs.cache-hit != 'true'
working-directory: Build
run: |
git clone --recursive https://github.com/SpriteOvO/AirPodsDesktop-Deps.git
dir AirPodsDesktop-Deps
- name: Print CMake version
run: cmake --version
- name: Use a fixed version of CMake
if: env.FIXED_CMAKE_VERSION != ''
run: |
choco install cmake.install --version ${{ env.FIXED_CMAKE_VERSION }} --installargs 'ADD_CMAKE_TO_PATH=System' --force
cmake --version
- name: Clone and bootstrap vcpkg
working-directory: Build
run: |
git clone --recursive https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.bat -disableMetrics
- name: Generate project and build
working-directory: Build
run: |
mkdir ${{ env.BUILD_TYPE }} && cd ${{ env.BUILD_TYPE }}
cmake -G "Visual Studio 16 2019" ^
-A ${{ env.PLATFORM_NAME }} ^
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} ^
-DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake ^
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/Build/AirPodsDesktop-Deps/Qt/5.15.2/msvc2019 ^
-DAPD_GENERATE_INSTALLER=ON ^
-DAPD_BUILD_GIT_HASH=${{ github.sha }} ^
../../
cmake --build . ^
--config ${{ env.BUILD_TYPE }}
dir /s Binary
dir /s Installer
- name: Prepare artifacts
if: env.UPLOAD_ARTIFACT == 'true'
working-directory: Build\${{ env.BUILD_TYPE }}\Installer
run: |
cd _CPack_Packages\win32\NSIS
move AirPodsDesktop-*-win32 AirPodsDesktop-${{ github.sha }}-win32
- name: Upload artifact - Installer
uses: actions/upload-artifact@v2
if: env.UPLOAD_ARTIFACT == 'true'
with:
name: AirPodsDesktop-${{ github.sha }}-Installer
path: Build\${{ env.BUILD_TYPE }}\Installer\AirPodsDesktop-*-win32.exe
retention-days: 90
- name: Upload artifact - Portable
uses: actions/upload-artifact@v2
if: env.UPLOAD_ARTIFACT == 'true'
with:
name: AirPodsDesktop-${{ github.sha }}-Portable
path: Build\${{ env.BUILD_TYPE }}\Installer\_CPack_Packages\win32\NSIS\AirPodsDesktop-${{ github.sha }}-win32\AirPodsDesktop
retention-days: 90