diff --git a/.github/actions/init-build/action.yml b/.github/actions/init-build/action.yml index 4d16d88..35d34ac 100644 --- a/.github/actions/init-build/action.yml +++ b/.github/actions/init-build/action.yml @@ -56,27 +56,32 @@ runs: archives: ${{ inputs.os == 'ubuntu-latest' && 'icu qtbase' || 'qtbase' }} qtsvg qtdeclarative qtremoteobjects qttools cache: true - - name: Restore vcpkg from cache + - name: Prepare vcpkg + shell: pwsh + run: | + Write-Output VCPKG_REPO_REF=$((Get-Content scripts/vcpkg-manifest/vcpkg.json | ConvertFrom-Json).'builtin-baseline') >> $env:GITHUB_ENV + Write-Output VCPKG_DEFAULT_BINARY_CACHE=${{ github.workspace }}/vcpkg_archives >> $env:GITHUB_ENV + Write-Output VCPKG_CACHE_HASH=${{ hashFiles('scripts/vcpkg-manifest/vcpkg.json', 'scripts/vcpkg/**') }} >> $env:GITHUB_ENV + + - name: Restore vcpkg binary cache from cache id: cache_vcpkg uses: actions/cache/restore@v4 with: - path: ${{ github.workspace }}/vcpkg - key: ${{ runner.os }}-vcpkg-${{ hashFiles('scripts/vcpkg-manifest/vcpkg.json', 'scripts/vcpkg/**') }} + path: ${{ env.VCPKG_DEFAULT_BINARY_CACHE }} + key: ${{ runner.os }}-vcpkg-${{ env.VCPKG_REPO_REF }}-${{ env.VCPKG_CACHE_HASH }} restore-keys: | - ${{ runner.os }}-vcpkg- + ${{ runner.os }}-vcpkg-${{ env.VCPKG_REPO_REF }}- - name: Install vcpkg dependencies - if: steps.cache_vcpkg.outputs.cache-hit != 'true' shell: pwsh run: | - if (!(Test-Path vcpkg)) { - git clone https://github.com/microsoft/vcpkg.git - cd vcpkg - ${{ inputs.os == 'windows-latest' && './bootstrap-vcpkg.bat' || 'sh ./bootstrap-vcpkg.sh' }} - } else { - cd vcpkg - git pull origin master + if (!(Test-Path $env:VCPKG_DEFAULT_BINARY_CACHE)) { + mkdir $env:VCPKG_DEFAULT_BINARY_CACHE } + git clone https://github.com/microsoft/vcpkg.git + cd vcpkg + ${{ inputs.os == 'windows-latest' && './bootstrap-vcpkg.bat' || 'sh ./bootstrap-vcpkg.sh' }} + git checkout $env:VCPKG_REPO_REF $env:QT_DIR="$env:Qt5_DIR/lib/cmake/Qt5" $env:Qt5_DIR=$env:QT_DIR $env:VCPKG_KEEP_ENV_VARS="QT_DIR;Qt5_DIR" @@ -91,46 +96,22 @@ runs: --x-manifest-root=${{ github.workspace }}/scripts/setup/diffscope-bridge ` --x-install-root=./bridge_installed ` --triplet=${{ env.VCPKG_TRIPLET_STATIC }} - if (Test-Path -Path buildtrees) { - Remove-Item -Path buildtrees -Recurse -Force - } - if (Test-Path -Path downloads) { - Remove-Item -Path downloads -Recurse -Force - } - if (Test-Path -Path packages) { - Remove-Item -Path packages -Recurse -Force - } - name: Save vcpkg to cache if: steps.cache_vcpkg.outputs.cache-hit != 'true' uses: actions/cache/save@v4 with: - path: ${{ github.workspace }}/vcpkg - key: ${{ runner.os }}-vcpkg-${{ hashFiles('**/vcpkg.json') }} - - - name: Restore ASIO SDK from cache - id: cache_asiosdk - if: inputs.os == 'windows-latest' - uses: actions/cache/restore@v4 - with: - path: ${{github.workspace}}/asiosdk - key: asiosdk + path: ${{ env.VCPKG_DEFAULT_BINARY_CACHE }} + key: ${{ runner.os }}-vcpkg-${{ env.VCPKG_REPO_REF }}-${{ env.VCPKG_CACHE_HASH }} - name: Get ASIO SDK - if: inputs.os == 'windows-latest' && steps.cache_asiosdk.outputs.cache-hit != 'true' + if: inputs.os == 'windows-latest' shell: pwsh run: | Invoke-WebRequest -Uri "https://raw.githubusercontent.com/CrSjimo/diffscope-ci-tools-mirror/refs/heads/main/asiosdk_2.3.3_2019-06-14.zip" -OutFile $env:RUNNER_TEMP/asiosdk.zip Expand-Archive -Path $env:RUNNER_TEMP/asiosdk.zip -DestinationPath $env:GITHUB_WORKSPACE Rename-Item -Path asiosdk_2.3.3_2019-06-14 -NewName asiosdk - - name: Save ASIO SDK to cache - if: inputs.os == 'windows-latest' && steps.cache_asiosdk.outputs.cache-hit != 'true' - uses: actions/cache/save@v4 - with: - path: ${{github.workspace}}/asiosdk - key: asiosdk - - name: Set directory variables shell: pwsh run: | diff --git a/.github/workflows/generate-bundles-and-release.yml b/.github/workflows/generate-bundles-and-release.yml index bb0e49b..f10bac6 100644 --- a/.github/workflows/generate-bundles-and-release.yml +++ b/.github/workflows/generate-bundles-and-release.yml @@ -1,10 +1,19 @@ name: Generate Bundles and Release on: push: + branches: + - main tags: - - "v*" - schedule: - - cron: '0 4 * * 1' + - 'v*' + paths-ignore: + - 'docs/**' + - 'README.md' + pull_request: + branches: + - main + paths-ignore: + - 'docs/**' + - 'README.md' workflow_dispatch: jobs: @@ -169,7 +178,7 @@ jobs: Release: runs-on: ubuntu-latest needs: Build - if: github.event_name == 'push' + if: github.event_name == 'push' && github.ref_type == 'tag' && startsWith(github.ref_name , 'v') steps: - name: Get artifacts uses: actions/download-artifact@v4 diff --git a/scripts/vcpkg-manifest/vcpkg.json b/scripts/vcpkg-manifest/vcpkg.json index 8b88c52..7273a8a 100644 --- a/scripts/vcpkg-manifest/vcpkg.json +++ b/scripts/vcpkg-manifest/vcpkg.json @@ -15,9 +15,10 @@ "default-features": false }, "interval-tree", - "boost-interprocess" + "boost-interprocess", + "wavpack" ], - "builtin-baseline": "5fa0f075ea51f305b627ecd5e050a363707353ff", + "builtin-baseline": "dd6fbdd22cc56af2ec8f97b4f62ce5ef612a891b", "overrides": [ { "name": "sdl2",