summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2025-04-18 17:04:12 +0100
committerSadie Powell <sadie@witchery.services>2025-04-18 18:24:29 +0100
commit151f9c2bcc9dc027b33656b9abb3256e436fdb7f (patch)
tree2d0165e34181d918e2489a82e33a474df59d6c10 /.github
parentb9acaa6d516529c6289790515b430af64d3a3c7c (diff)
Backport the Windows CI runner to 2.0.
[skip ubuntu ci]
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/ci-windows.yml66
1 files changed, 66 insertions, 0 deletions
diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml
new file mode 100644
index 000000000..0477c8f4c
--- /dev/null
+++ b/.github/workflows/ci-windows.yml
@@ -0,0 +1,66 @@
+name: Windows CI
+on:
+ pull_request:
+ push:
+ release:
+ types:
+ - published
+jobs:
+ build:
+ if: "!contains(github.event.head_commit.message, '[skip windows ci]')"
+ runs-on: windows-2025
+ env:
+ BUILD_TYPE: ${{ github.event_name == 'release' && 'Release' || 'Debug' }}
+ CONAN_USER_HOME: ${{ github.workspace }}/win/build
+ CONAN_USER_HOME_SHORT: None
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Setup NSIS
+ run: |-
+ choco install nsis
+
+ - name: Setup MSBuild
+ uses: microsoft/setup-msbuild@v2
+
+ - name: Setup Conan
+ uses: turtlebrowser/get-conan@v1.2
+ with:
+ version: 1.66.0
+
+ - name: Try to restore libraries from the cache
+ uses: actions/cache/restore@v4
+ id: library-cache
+ with:
+ key: conan-${{ hashFiles('src/win32/conanfile.txt') }}
+ path: ${{ env.CONAN_USER_HOME }}/.conan
+
+ - name: Install libraries
+ run: |
+ conan install ${{ github.workspace }}\src\win32 --build=missing
+
+ - name: Save libraries to the cache
+ if: ${{ steps.library-cache.outputs.cache-hit != 'true' }}
+ uses: actions/cache/save@v4
+ with:
+ key: ${{ steps.library-cache.outputs.cache-primary-key }}
+ path: ${{ env.CONAN_USER_HOME }}/.conan
+
+ - name: Run CMake
+ run: |
+ mkdir ${{ github.workspace }}\build
+ cd ${{ github.workspace }}\build
+ cmake -A x64 -D "CMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}" -G "Visual Studio 17 2022" ..
+
+ - name: Build Anope
+ working-directory: ${{ github.workspace }}\build
+ run: |
+ msbuild PACKAGE.vcxproj /M:5 /P:Configuration=${{ env.BUILD_TYPE }} /P:Platform=x64 /VERBOSITY:MINIMAL
+
+ - name: Upload installer
+ if: "${{ github.event_name == 'release' }}"
+ working-directory: ${{ github.workspace }}\build
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: |
+ gh release upload ${{ github.event.release.tag_name }} $(Get-ChildItem anope-*.exe)