Skip to content

Commit

Permalink
Build Windows on GH Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Mab879 committed Jan 2, 2024
1 parent 996f5a5 commit 4aa5b7a
Showing 1 changed file with 49 additions and 1 deletion.
50 changes: 49 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,52 @@ jobs:
- name: Test
run: |
cd $GITHUB_WORKSPACE/build
echo "Tests are so broken for MacOS :("
echo "Tests are so broken for macOS :("
build-windows:
name: Build on Windows
runs-on: windows-latest
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
VCPKG_DISABLE_METRICS: "true"
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Checkout vcpkg
uses: actions/checkout@v3
with:
path: ${{ github.workspace }}/vcpkg
repository: microsoft/vcpkg
fetch-depth: 1

- name: Bootstrap vcpkg
shell: pwsh
run: "${{ github.workspace }}/vcpkg/scipts/bootstrap.ps1"

- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install Deps
run: vcpkg install curl libxml2 libxslt bzip2 pcre pthreads zlib getopt-win32 xmlsec

- name: Configure
working-directory: ./build
run: cmake -DENABLE_PYTHON3=FALSE -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake ..

- name: Build
run: cmake --build -j 2
working-directory: ./build

- name: Package
run: cpack

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
path: |-
build\OpenSCAP*.msi
build\OpenSCAP*.msi.sha512

0 comments on commit 4aa5b7a

Please sign in to comment.