Skip to content

Commit

Permalink
fix build action to use vcpkg
Browse files Browse the repository at this point in the history
  • Loading branch information
f0e committed Oct 20, 2023
1 parent 13e740f commit 750d4d5
Showing 1 changed file with 39 additions and 28 deletions.
67 changes: 39 additions & 28 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,51 @@ on: [push]

env:
is_tag: ${{ startsWith(github.ref, 'refs/tags/') }}

PROJECT_FILE_PATH: blur.sln

BUILD_CONFIGURATION: Release
BUILD_PLATFORM: x64

jobs:
build:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.0.2

- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
run: msbuild /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{env.BUILD_PLATFORM}} ${{env.PROJECT_FILE_PATH}}

- name: Upload
uses: actions/upload-artifact@v3
with:
name: Blur
path: |
bin/blur-cli/Release/blur-cli.exe
bin/blur-gui/Release/blur.exe
- name: Release
uses: softprops/action-gh-release@v1
if: ${{ env.is_tag == 'true' }}
with:
files: |
bin/blur-cli/Release/blur-cli.exe
bin/blur-gui/Release/blur.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.0.2

- name: Setup vcpkg
uses: lukka/run-vcpkg@v7
with:
vcpkgDirectory: ${{ runner.workspace }}/vcpkg/
vcpkgTriplet: '${{ env.BUILD_PLATFORM }}-windows-static'
vcpkgGitCommitId: '8eb57355a4ffb410a2e94c07b4dca2dffbee8e50'
vcpkgArguments: 'cxxopts fmt glfw3 imgui[opengl3-binding,glfw-binding] nlohmann-json'

- name: Integrate vcpkg
run: ${{ runner.workspace }}\vcpkg\vcpkg integrate install

- name: Build
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: MSBuild /p:Configuration=${{ env.BUILD_CONFIGURATION }} /p:Platform=${{ env.BUILD_PLATFORM }} ${{ env.PROJECT_FILE_PATH }}

- name: Upload
uses: actions/upload-artifact@v3
with:
name: Blur
path: |
bin/blur-cli/Release/blur-cli.exe
bin/blur-gui/Release/blur.exe
- name: Release
uses: softprops/action-gh-release@v1
if: ${{ env.is_tag == 'true' }}
with:
files: |
bin/blur-cli/Release/blur-cli.exe
bin/blur-gui/Release/blur.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 750d4d5

Please sign in to comment.