Skip to content

Commit 86c7c68

Browse files
committed
Update release workflow for Windows
Removed 32-bit build as everyone should nowadays run a 64-bit Windows. Also switched to the NuGet vcpkg cache to speed up builds.
1 parent 1902a29 commit 86c7c68

File tree

1 file changed

+32
-112
lines changed

1 file changed

+32
-112
lines changed
Lines changed: 32 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1,125 +1,45 @@
11
# Release workflow for Windows
2-
# Builds both 32-bit and 64-bit packages for Windows. Uses vcpkg to source all dependencies.
2+
# Builds 64-bit packages (ZIP and MSI) for Windows. Uses vcpkg to source all third-party dependencies,
3+
# including projectM.
34
name: Build Release Package for Windows
45

56
on: push
67

78
jobs:
8-
build-win32:
9-
name: Windows, x32
10-
runs-on: windows-latest
11-
12-
steps:
13-
- name: Export GitHub Actions cache environment variables
14-
uses: actions/github-script@v7
15-
with:
16-
script: |
17-
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
18-
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
19-
20-
- name: Checkout libprojectM Sources
21-
uses: actions/checkout@v4
22-
with:
23-
repository: projectM-visualizer/projectm
24-
path: projectm
25-
submodules: recursive
26-
27-
- name: Build/Install libprojectM
28-
env:
29-
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
30-
run: |
31-
mkdir cmake-build-libprojectm
32-
cmake -G "Visual Studio 17 2022" -A "Win32" `
33-
-S "${{ github.workspace }}/projectm" `
34-
-B "${{ github.workspace }}/cmake-build-libprojectm" `
35-
-DCMAKE_TOOLCHAIN_FILE="${Env:VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" `
36-
-DVCPKG_TARGET_TRIPLET=x86-windows `
37-
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/install-libprojectm" `
38-
-DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded$<$<CONFIG:Debug>:Debug>DLL" `
39-
-DBUILD_SHARED_LIBS=ON
40-
cmake --build "${{ github.workspace }}/cmake-build-libprojectm" --config Release --parallel
41-
cmake --install "${{ github.workspace }}/cmake-build-libprojectm" --config Release
42-
43-
- name: Checkout projectMSDL Sources
44-
uses: actions/checkout@v4
45-
with:
46-
path: frontend-sdl2
47-
submodules: recursive
48-
49-
- name: Checkout Cream of the Crop preset pack
50-
uses: actions/checkout@v4
51-
with:
52-
repository: projectM-visualizer/presets-cream-of-the-crop
53-
path: presets-cream-of-the-crop
54-
55-
- name: Checkout Milkdrop Texture Pack
56-
uses: actions/checkout@v4
57-
with:
58-
repository: projectM-visualizer/presets-milkdrop-texture-pack
59-
path: presets-milkdrop-texture-pack
60-
61-
- name: Build projectMSDL
62-
env:
63-
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
64-
run: |
65-
mkdir cmake-build-frontend-sdl2
66-
cmake -G "Visual Studio 17 2022" -A "Win32" `
67-
-S "${{ github.workspace }}/frontend-sdl2" `
68-
-B "${{ github.workspace }}/cmake-build-frontend-sdl2" `
69-
-DCMAKE_TOOLCHAIN_FILE="${Env:VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" `
70-
-DVCPKG_TARGET_TRIPLET=x86-windows `
71-
-DCMAKE_PREFIX_PATH="${{ github.workspace }}/install-libprojectm" `
72-
-DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded$<$<CONFIG:Debug>:Debug>DLL" `
73-
-DPRESET_DIRS="${{ github.workspace }}/presets-cream-of-the-crop" `
74-
-DTEXTURE_DIRS="${{ github.workspace }}/presets-milkdrop-texture-pack/textures" `
75-
-DENABLE_INSTALL_BDEPS=ON
76-
cmake --build "${{ github.workspace }}/cmake-build-frontend-sdl2" --parallel --config Release
77-
78-
- name: Package projectMSDL
79-
run: |
80-
cd cmake-build-frontend-sdl2
81-
cpack -G ZIP
82-
83-
- name: Upload Artifact
84-
uses: actions/upload-artifact@v4
85-
with:
86-
name: projectMSDL-Windows-Portable-x32
87-
path: cmake-build-frontend-sdl2/*.zip
88-
89-
build-win64:
9+
build:
9010
name: Windows, x64
9111
runs-on: windows-latest
12+
env:
13+
USERNAME: projectM-visualizer
14+
VCPKG_EXE: ${{ github.workspace }}/vcpkg/vcpkg
15+
FEED_URL: https://nuget.pkg.github.com/projectM-visualizer/index.json
16+
VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/projectM-visualizer/index.json,readwrite"
9217

9318
steps:
94-
- name: Export GitHub Actions cache environment variables
95-
uses: actions/github-script@v7
96-
with:
97-
script: |
98-
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
99-
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
100-
101-
- name: Checkout libprojectM Sources
19+
- name: Checkout vcpkg
10220
uses: actions/checkout@v4
10321
with:
104-
repository: projectM-visualizer/projectm
105-
path: projectm
22+
repository: microsoft/vcpkg
23+
path: vcpkg
10624
submodules: recursive
10725

108-
- name: Build/Install libprojectM
109-
env:
110-
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
26+
- name: Bootstrap vcpkg
27+
shell: pwsh
28+
run: ${{ github.workspace }}/vcpkg/bootstrap-vcpkg.bat
29+
30+
- name: Add NuGet sources
31+
shell: pwsh
11132
run: |
112-
mkdir cmake-build-libprojectm
113-
cmake -G "Visual Studio 17 2022" -A "X64" `
114-
-S "${{ github.workspace }}/projectm" `
115-
-B "${{ github.workspace }}/cmake-build-libprojectm" `
116-
-DCMAKE_TOOLCHAIN_FILE="${Env:VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" `
117-
-DVCPKG_TARGET_TRIPLET=x64-windows `
118-
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/install-libprojectm" `
119-
-DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded$<$<CONFIG:Debug>:Debug>DLL" `
120-
-DBUILD_SHARED_LIBS=ON
121-
cmake --build "${{ github.workspace }}/cmake-build-libprojectm" --config Release --parallel
122-
cmake --install "${{ github.workspace }}/cmake-build-libprojectm" --config Release
33+
.$(${{ env.VCPKG_EXE }} fetch nuget) `
34+
sources add `
35+
-Source "${{ env.FEED_URL }}" `
36+
-StorePasswordInClearText `
37+
-Name GitHubPackages `
38+
-UserName "${{ env.USERNAME }}" `
39+
-Password "${{ secrets.VCPKG_PACKAGES_TOKEN }}"
40+
.$(${{ env.VCPKG_EXE }} fetch nuget) `
41+
setapikey "${{ secrets.VCPKG_PACKAGES_TOKEN }}" `
42+
-Source "${{ env.FEED_URL }}"
12343
12444
- name: Checkout projectMSDL Sources
12545
uses: actions/checkout@v4
@@ -140,8 +60,6 @@ jobs:
14060
path: presets-milkdrop-texture-pack
14161

14262
- name: Build projectMSDL
143-
env:
144-
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
14563
run: |
14664
mkdir cmake-build-frontend-sdl2
14765
cmake -G "Visual Studio 17 2022" -A "X64" `
@@ -150,7 +68,6 @@ jobs:
15068
-DCMAKE_TOOLCHAIN_FILE="${Env:VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" `
15169
-DVCPKG_TARGET_TRIPLET=x64-windows `
15270
-DCMAKE_PREFIX_PATH="${{ github.workspace }}/install-libprojectm" `
153-
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/install-frontend-sdl2" `
15471
-DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded$<$<CONFIG:Debug>:Debug>DLL" `
15572
-DPRESET_DIRS="${{ github.workspace }}/presets-cream-of-the-crop" `
15673
-DTEXTURE_DIRS="${{ github.workspace }}/presets-milkdrop-texture-pack/textures" `
@@ -161,9 +78,12 @@ jobs:
16178
run: |
16279
cd cmake-build-frontend-sdl2
16380
cpack -G ZIP
81+
cpack -G WIX
16482
16583
- name: Upload Artifact
16684
uses: actions/upload-artifact@v4
16785
with:
168-
name: projectMSDL-Windows-Portable-x64
169-
path: cmake-build-frontend-sdl2/*.zip
86+
name: projectMSDL-Windows-Portable-x32
87+
path: |
88+
cmake-build-frontend-sdl2/*.zip
89+
cmake-build-frontend-sdl2/*.msi

0 commit comments

Comments
 (0)