Skip to content

Fix volume jumping to 100% by keeping saved volume after restoration #76

Fix volume jumping to 100% by keeping saved volume after restoration

Fix volume jumping to 100% by keeping saved volume after restoration #76

Workflow file for this run

name: Windows Builds
on:
push:
paths-ignore:
- '**.md'
- 'LICENSE'
- 'Assets/**'
- 'Docs/**'
pull_request:
paths-ignore:
- '**.md'
- 'LICENSE'
- 'Assets/**'
- 'Docs/**'
workflow_dispatch:
jobs:
Build:
runs-on: windows-2022
strategy:
matrix:
platform: [Win32, x64]
fail-fast: false
env:
PLATFORM_NAME: ${{ matrix.platform }}
BUILD_TYPE: RelWithDebInfo
UPLOAD_ARTIFACT: true
CACHE_DEPS: true
FIXED_CMAKE_VERSION: 3.21.4
TRIPLET: ${{ matrix.platform == 'Win32' && 'x86-windows' || 'x64-windows' }}
QT_DIR: ${{ matrix.platform == 'Win32' && 'msvc2019' || 'msvc2019_64' }}
NSIS_ARCH: ${{ matrix.platform == 'Win32' && 'win32' || 'win64' }}
defaults:
run:
shell: cmd
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Prepare build directory
run: mkdir Build
- name: Generate dependencies cache key
if: env.CACHE_DEPS == 'true'
run: |
curl -o Build\DepsRef.json https://api.github.com/repos/YimingZhanshen/AirPodsWindows-Deps/git/refs/heads/main
type Build\DepsRef.json
- name: Dependencies cache
id: cache-deps
if: env.CACHE_DEPS == 'true'
uses: actions/cache@v4
with:
path: Build/AirPodsWindows-Deps
key: ${{ hashFiles('Build/DepsRef.json') }}-${{ matrix.platform }}
- name: Clone dependencies
if: env.CACHE_DEPS != 'true' || steps.cache-deps.outputs.cache-hit != 'true'
working-directory: Build
run: |
git clone --recursive https://github.com/YimingZhanshen/AirPodsWindows-Deps.git
dir AirPodsWindows-Deps
- name: Print CMake version
run: cmake --version
- name: Use a fixed version of CMake
if: env.FIXED_CMAKE_VERSION != ''
run: |
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: Install vcpkg dependencies
working-directory: Build
run: |
ren ..\vcpkg.json vcpkg.json.bak
.\vcpkg\vcpkg install magic-enum:${{ env.TRIPLET }} cxxopts:${{ env.TRIPLET }} nlohmann-json:${{ env.TRIPLET }} boost-pfr:${{ env.TRIPLET }} boost-stacktrace:${{ env.TRIPLET }}
ren ..\vcpkg.json.bak vcpkg.json
- 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 ^
-DVCPKG_MANIFEST_MODE=OFF ^
-DVCPKG_TARGET_TRIPLET=${{ env.TRIPLET }} ^
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/Build/AirPodsWindows-Deps/Qt/5.15.2/${{ env.QT_DIR }} ^
-DAPD_GENERATE_INSTALLER=ON ^
-DAPD_BUILD_GIT_HASH=${{ github.sha }} ^
../../
cmake --build . ^
--config ${{ env.BUILD_TYPE }}
dir /s Binary
dir /s Installer
- name: Prepare artifacts
if: env.UPLOAD_ARTIFACT == 'true'
working-directory: Build\${{ env.BUILD_TYPE }}\Installer
run: |
cd _CPack_Packages\${{ env.NSIS_ARCH }}\NSIS
move AirPodsWindows-*-${{ env.NSIS_ARCH }} AirPodsWindows-${{ github.sha }}-${{ matrix.platform }}
- name: Upload artifact - Installer
uses: actions/upload-artifact@v4
if: env.UPLOAD_ARTIFACT == 'true'
with:
name: AirPodsWindows-${{ github.sha }}-${{ matrix.platform }}-Installer
path: Build\${{ env.BUILD_TYPE }}\Installer\AirPodsWindows-*-${{ env.NSIS_ARCH }}.exe
retention-days: 90
- name: Upload artifact - Portable
uses: actions/upload-artifact@v4
if: env.UPLOAD_ARTIFACT == 'true'
with:
name: AirPodsWindows-${{ github.sha }}-${{ matrix.platform }}-Portable
path: Build\${{ env.BUILD_TYPE }}\Installer\_CPack_Packages\${{ env.NSIS_ARCH }}\NSIS\AirPodsWindows-${{ github.sha }}-${{ matrix.platform }}\AirPodsWindows
retention-days: 90