Skip to content

Commit e514eaa

Browse files
committed
update workflow
1 parent e9c94bc commit e514eaa

File tree

3 files changed

+36
-45
lines changed

3 files changed

+36
-45
lines changed

.github/actions/init-build/action.yml

Lines changed: 20 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -56,27 +56,32 @@ runs:
5656
archives: ${{ inputs.os == 'ubuntu-latest' && 'icu qtbase' || 'qtbase' }} qtsvg qtdeclarative qtremoteobjects qttools
5757
cache: true
5858

59-
- name: Restore vcpkg from cache
59+
- name: Prepare vcpkg
60+
shell: pwsh
61+
run: |
62+
Write-Output VCPKG_REPO_REF=$((Get-Content scripts/vcpkg-manifest/vcpkg.json | ConvertFrom-Json).'builtin-baseline') >> $env:GITHUB_ENV
63+
Write-Output VCPKG_DEFAULT_BINARY_CACHE=${{ github.workspace }}/vcpkg_archives >> $env:GITHUB_ENV
64+
Write-Output VCPKG_CACHE_HASH=${{ hashFiles('scripts/vcpkg-manifest/vcpkg.json', 'scripts/vcpkg/**') }} >> $env:GITHUB_ENV
65+
66+
- name: Restore vcpkg binary cache from cache
6067
id: cache_vcpkg
6168
uses: actions/cache/restore@v4
6269
with:
63-
path: ${{ github.workspace }}/vcpkg
64-
key: ${{ runner.os }}-vcpkg-${{ hashFiles('scripts/vcpkg-manifest/vcpkg.json', 'scripts/vcpkg/**') }}
70+
path: ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
71+
key: ${{ runner.os }}-vcpkg-${{ env.VCPKG_REPO_REF }}-${{ env.VCPKG_CACHE_HASH }}
6572
restore-keys: |
66-
${{ runner.os }}-vcpkg-
73+
${{ runner.os }}-vcpkg-${{ env.VCPKG_REPO_REF }}-
6774
6875
- name: Install vcpkg dependencies
69-
if: steps.cache_vcpkg.outputs.cache-hit != 'true'
7076
shell: pwsh
7177
run: |
72-
if (!(Test-Path vcpkg)) {
73-
git clone https://github.com/microsoft/vcpkg.git
74-
cd vcpkg
75-
${{ inputs.os == 'windows-latest' && './bootstrap-vcpkg.bat' || 'sh ./bootstrap-vcpkg.sh' }}
76-
} else {
77-
cd vcpkg
78-
git pull origin master
78+
if (!(Test-Path $env:VCPKG_DEFAULT_BINARY_CACHE)) {
79+
mkdir $env:VCPKG_DEFAULT_BINARY_CACHE
7980
}
81+
git clone https://github.com/microsoft/vcpkg.git
82+
cd vcpkg
83+
${{ inputs.os == 'windows-latest' && './bootstrap-vcpkg.bat' || 'sh ./bootstrap-vcpkg.sh' }}
84+
git checkout $env:VCPKG_REPO_REF
8085
$env:QT_DIR="$env:Qt5_DIR/lib/cmake/Qt5"
8186
$env:Qt5_DIR=$env:QT_DIR
8287
$env:VCPKG_KEEP_ENV_VARS="QT_DIR;Qt5_DIR"
@@ -91,46 +96,22 @@ runs:
9196
--x-manifest-root=${{ github.workspace }}/scripts/setup/diffscope-bridge `
9297
--x-install-root=./bridge_installed `
9398
--triplet=${{ env.VCPKG_TRIPLET_STATIC }}
94-
if (Test-Path -Path buildtrees) {
95-
Remove-Item -Path buildtrees -Recurse -Force
96-
}
97-
if (Test-Path -Path downloads) {
98-
Remove-Item -Path downloads -Recurse -Force
99-
}
100-
if (Test-Path -Path packages) {
101-
Remove-Item -Path packages -Recurse -Force
102-
}
10399
104100
- name: Save vcpkg to cache
105101
if: steps.cache_vcpkg.outputs.cache-hit != 'true'
106102
uses: actions/cache/save@v4
107103
with:
108-
path: ${{ github.workspace }}/vcpkg
109-
key: ${{ runner.os }}-vcpkg-${{ hashFiles('**/vcpkg.json') }}
110-
111-
- name: Restore ASIO SDK from cache
112-
id: cache_asiosdk
113-
if: inputs.os == 'windows-latest'
114-
uses: actions/cache/restore@v4
115-
with:
116-
path: ${{github.workspace}}/asiosdk
117-
key: asiosdk
104+
path: ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
105+
key: ${{ runner.os }}-vcpkg-${{ env.VCPKG_REPO_REF }}-${{ env.VCPKG_CACHE_HASH }}
118106

119107
- name: Get ASIO SDK
120-
if: inputs.os == 'windows-latest' && steps.cache_asiosdk.outputs.cache-hit != 'true'
108+
if: inputs.os == 'windows-latest'
121109
shell: pwsh
122110
run: |
123111
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
124112
Expand-Archive -Path $env:RUNNER_TEMP/asiosdk.zip -DestinationPath $env:GITHUB_WORKSPACE
125113
Rename-Item -Path asiosdk_2.3.3_2019-06-14 -NewName asiosdk
126114
127-
- name: Save ASIO SDK to cache
128-
if: inputs.os == 'windows-latest' && steps.cache_asiosdk.outputs.cache-hit != 'true'
129-
uses: actions/cache/save@v4
130-
with:
131-
path: ${{github.workspace}}/asiosdk
132-
key: asiosdk
133-
134115
- name: Set directory variables
135116
shell: pwsh
136117
run: |

.github/workflows/generate-bundles-and-release.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
name: Generate Bundles and Release
22
on:
33
push:
4+
branches:
5+
- main
46
tags:
5-
- "v*"
6-
schedule:
7-
- cron: '0 4 * * 1'
7+
- 'v*'
8+
paths-ignore:
9+
- 'docs/**'
10+
- 'README.md'
11+
pull_request:
12+
branches:
13+
- main
14+
paths-ignore:
15+
- 'docs/**'
16+
- 'README.md'
817
workflow_dispatch:
918

1019
jobs:
@@ -169,7 +178,7 @@ jobs:
169178
Release:
170179
runs-on: ubuntu-latest
171180
needs: Build
172-
if: github.event_name == 'push'
181+
if: github.event_name == 'push' && github.ref_type == 'tag' && startsWith(github.ref_name , 'v')
173182
steps:
174183
- name: Get artifacts
175184
uses: actions/download-artifact@v4

scripts/vcpkg-manifest/vcpkg.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
"default-features": false
1616
},
1717
"interval-tree",
18-
"boost-interprocess"
18+
"boost-interprocess",
19+
"wavpack"
1920
],
20-
"builtin-baseline": "5fa0f075ea51f305b627ecd5e050a363707353ff",
21+
"builtin-baseline": "dd6fbdd22cc56af2ec8f97b4f62ce5ef612a891b",
2122
"overrides": [
2223
{
2324
"name": "sdl2",

0 commit comments

Comments
 (0)