Skip to content

Commit 2338abc

Browse files
committed
git-artifacts: use the cached build-installers instead of makepkg-git
When building the Pacman packages, we technically do not need the full `build-installers` artifact (which is substantially larger than the `makepkg-git` artifact). However, the former is already cached and includes the latter's files. And it is _so_ much faster to download the cached (larger) artifact than to download the smaller `makepkg-git` artifact from Azure Pipelines. Suggested-by: Dennis Ameling <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 73e8a82 commit 2338abc

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

.github/workflows/git-artifacts.yml

+20-7
Original file line numberDiff line numberDiff line change
@@ -149,16 +149,23 @@ jobs:
149149
git config --global user.name "$USER_NAME" &&
150150
git config --global user.email "$USER_EMAIL" &&
151151
echo "PACKAGER=$USER_NAME <$USER_EMAIL>" >>$GITHUB_ENV
152-
- name: Download git-sdk-64-makepkg-git
152+
- name: Cache git-sdk-64-build-installers
153+
id: cache-sdk-build-installers
154+
uses: actions/cache@v2
155+
with:
156+
path: git-sdk-64-build-installers
157+
key: build-installers-64-${{ needs.bundle-artifacts.outputs.latest-sdk64-extra-build-id }}
158+
- name: Download git-sdk-64-build-installers
159+
if: steps.cache-sdk-build-installers.outputs.cache-hit != 'true'
153160
shell: bash
154161
run: |
155162
# Use Git Bash to download and unpack the artifact
156163
157164
## Get artifact
158165
urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
159-
id=${{ needs.bundle-artifacts.outputs.latest-sdk64-extra-build-id }}
160-
download_url="$(curl "$urlbase/$id/artifacts" |
161-
jq -r '.value[] | select(.name == "git-sdk-64-makepkg-git").resource.downloadUrl')"
166+
id=${{ needs.pkg.outputs.latest-sdk64-extra-build-id }}
167+
download_url=$(curl "$urlbase/$id/artifacts" |
168+
jq -r '.value[] | select(.name == "git-sdk-64-build-installers").resource.downloadUrl')
162169
163170
curl -o artifacts.zip "$download_url"
164171
@@ -172,8 +179,14 @@ jobs:
172179
- name: Clone and update build-extra
173180
shell: bash
174181
run: |
175-
d=git-sdk-64-makepkg-git/usr/src/build-extra &&
176-
git clone --single-branch -b main https://github.com/git-for-windows/build-extra $d &&
182+
d=git-sdk-64-build-installers/usr/src/build-extra &&
183+
if test ! -d $d/.git
184+
then
185+
git clone --single-branch -b main https://github.com/git-for-windows/build-extra $d
186+
else
187+
git -C $d fetch https://github.com/git-for-windows/build-extra main &&
188+
git -C $d switch -C main FETCH_HEAD
189+
fi &&
177190
git -C $d pull "$PWD"/bundle-artifacts/build-extra.bundle main
178191
- name: Check out git/git
179192
shell: bash
@@ -209,7 +222,7 @@ jobs:
209222
GPGKEY: "${{secrets.GPGKEY}}"
210223
shell: powershell
211224
run: |
212-
& git-sdk-64-makepkg-git\usr\bin\sh.exe -lc @"
225+
& git-sdk-64-build-installers\usr\bin\sh.exe -lc @"
213226
set -x
214227
# Let `cv2pdb` find the DLLs
215228
PATH=\"`$PATH:/c/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/IDE/:/C/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin${{matrix.arch.bin}}\"

0 commit comments

Comments
 (0)