Skip to content

Commit

Permalink
CI use built-in vcpkg instead of cloning
Browse files Browse the repository at this point in the history
  • Loading branch information
SpriteOvO committed Sep 30, 2023
1 parent 4700276 commit 913e67b
Showing 1 changed file with 17 additions and 20 deletions.
37 changes: 17 additions & 20 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

defaults:
run:
shell: cmd
shell: bash

steps:
- name: Checkout repository
Expand All @@ -45,7 +45,7 @@ jobs:
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
cat DepsRef.json
- name: Dependencies cache
id: cache-deps
Expand All @@ -60,7 +60,6 @@ jobs:
working-directory: Build
run: |
git clone --recursive https://github.com/SpriteOvO/AirPodsDesktop-Deps.git
dir AirPodsDesktop-Deps
- name: Print CMake version
run: cmake --version
Expand All @@ -71,38 +70,36 @@ jobs:
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 17 2022" ^
-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 -G "Visual Studio 17 2022" \
-A ${{ env.PLATFORM_NAME }} \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/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 . ^
cmake --build . \
--config ${{ env.BUILD_TYPE }}
dir /s Binary
dir /s Installer
- name: List built files
working-directory: Build
shell: pwsh
run: |
tree /F /A Binary
tree /F /A 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
mv AirPodsDesktop-*-win32 AirPodsDesktop-${{ github.sha }}-win32
- name: Upload artifact - Installer
uses: actions/upload-artifact@v2
Expand Down

0 comments on commit 913e67b

Please sign in to comment.