Skip to content

Commit da06f29

Browse files
committed
chore: fix renovate config
Signed-off-by: msclock <[email protected]>
1 parent 739859d commit da06f29

File tree

2 files changed

+48
-6
lines changed

2 files changed

+48
-6
lines changed

.github/renovate.json

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,34 @@
88
"labels": [
99
"dependencies"
1010
],
11+
"packageRules": [
12+
{
13+
"matchFileNames": [
14+
"**/vcpkg.json"
15+
],
16+
"semanticCommitScope": "port"
17+
}
18+
],
1119
"customManagers": [
1220
{
13-
"customType": "regex",
1421
"description": "Update vcpkg.json registration port with git hash",
1522
"fileMatch": [
16-
"(\/)\\.vcpkg\\.json$"
23+
"vcpkg\\.json$"
1724
],
1825
"matchStrings": [
1926
"\\s+\"version-string\":\\s+\"(?<currentDigest>.*?)\"[\\w\\W]+\"homepage\":\\s\"(?<depName>.*?)\\/tree\\/(?<currentValue>.*?)\""
2027
],
2128
"datasourceTemplate": "git-refs"
2229
},
2330
{
24-
"customType": "regex",
2531
"description": "Update vcpkg.json registration port with semver",
2632
"fileMatch": [
27-
"(\/)\\.vcpkg\\.json$"
33+
"vcpkg\\.json$"
2834
],
2935
"matchStrings": [
3036
"\\s+\"version\":\\s+\"(?<currentValue>.*?)\"[\\w\\W]+\"homepage\":\\s\"https:\\/\\/github.com\\/(?<depName>.*?)\""
3137
],
38+
"extractVersionTemplate": "^v?(?<version>\\d+\\.\\d+.*)",
3239
"datasourceTemplate": "github-tags"
3340
}
3441
]

.github/workflows/ci.yml

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,48 @@ jobs:
7575
run: |
7676
exit 1
7777
78-
- name: Install all modules
78+
- name: Verify all modules and update hash
7979
run: |
8080
for dir in ports/* ; do
8181
echo "Test to install $dir"
82-
vcpkg install ${dir##ports/} --overlay-ports=ports
82+
status=0
83+
install_output=$(vcpkg install ${dir##ports/} --overlay-ports=ports) || status=$?
84+
if [[ ! $status -eq 0 ]]; then
85+
echo " Update hash on $dir/portfile.cmake"
86+
expected=$(echo "$install_output" | grep -oP "(?<=Expected hash: ).{128}")
87+
actual=$(echo "$install_output" | grep -oP "(?<=Actual hash: ).{128}")
88+
sed -i "s@${expected}@${actual}@g" "$dir/portfile.cmake"
89+
echo " Expected hash: ${expected}"
90+
echo " Actual hash: ${actual}"
91+
fi
8392
done
8493
94+
- name: Detect hash changes against local
95+
id: filter-hash
96+
uses: dorny/paths-filter@v2
97+
with:
98+
list-files: shell
99+
base: HEAD
100+
filters: |
101+
ports:
102+
- ports/**
103+
104+
- name: Get ports last commit message
105+
if: steps.filter-hash.outputs.ports == 'true'
106+
id: ports-last-commit-message
107+
run: |
108+
echo "msg=$(git log -1 --pretty=%s)" >> $GITHUB_OUTPUT
109+
110+
- name: Commit port hash
111+
if: steps.filter-hash.outputs.ports == 'true'
112+
uses: stefanzweifel/git-auto-commit-action@v5
113+
with:
114+
file_pattern: ports/*
115+
commit_message: ${{ steps.ports-last-commit-message.outputs.msg }}
116+
push_options: --force
117+
commit_options: --amend --no-edit
118+
skip_fetch: true
119+
85120
- name: Detect ports changes against default branch
86121
id: filter-ports
87122
uses: dorny/paths-filter@v2

0 commit comments

Comments
 (0)