From 5a7981a9ae73df2e10760b0452b48f07ea3713a8 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 7 Nov 2024 09:59:05 +0900 Subject: [PATCH] Reuse cache setup --- ci/docker/python-wheel-windows-vs2019.dockerfile | 7 ++++++- ci/scripts/install_vcpkg.sh | 8 ++++++-- dev/tasks/python-wheels/github.linux.yml | 4 ++-- dev/tasks/python-wheels/github.windows.yml | 2 ++ 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ci/docker/python-wheel-windows-vs2019.dockerfile b/ci/docker/python-wheel-windows-vs2019.dockerfile index f9d31eb5771ef..f827e57f4e61f 100644 --- a/ci/docker/python-wheel-windows-vs2019.dockerfile +++ b/ci/docker/python-wheel-windows-vs2019.dockerfile @@ -34,12 +34,17 @@ RUN setx path "%path%;C:\Program Files\Git\usr\bin" # # Compiling vcpkg itself from a git tag doesn't work anymore since vcpkg has # started to ship precompiled binaries for the vcpkg-tool. +ARG GITHUB_REPOSITORY_OWNER +ARG GITHUB_TOKEN ARG vcpkg COPY ci/vcpkg/*.patch \ ci/vcpkg/*windows*.cmake \ arrow/ci/vcpkg/ COPY ci/scripts/install_vcpkg.sh arrow/ci/scripts/ -ENV VCPKG_ROOT=C:\\vcpkg +ENV GITHUB_REPOSITORY_OWNER="${GITHUB_REPOSITORY_OWNER}" \ + GITHUB_TOKEN="${GITHUB_TOKEN}" \ + VCPKG_BINARY_SOURCES="clear;nuget,GitHub,readwrite" \ + VCPKG_ROOT=C:\\vcpkg RUN bash arrow/ci/scripts/install_vcpkg.sh /c/vcpkg %vcpkg% && \ setx PATH "%PATH%;%VCPKG_ROOT%" diff --git a/ci/scripts/install_vcpkg.sh b/ci/scripts/install_vcpkg.sh index acc4f29c7b773..b12a20522b961 100755 --- a/ci/scripts/install_vcpkg.sh +++ b/ci/scripts/install_vcpkg.sh @@ -64,14 +64,18 @@ if [ -n "${GITHUB_TOKEN:-}" ] && [ -n "${GITHUB_REPOSITORY_OWNER:-}" ]; then fi PATH="${vcpkg_destination}:${PATH}" nuget_url="https://nuget.pkg.github.com/${GITHUB_REPOSITORY_OWNER}/index.json" - mono $(vcpkg fetch nuget | tail -n 1) \ + nuget="$(vcpkg fetch nuget | tail -n 1)" + if type mono 2>/dev/null; then + nuget="mono ${nuget}" + fi + ${nuget} \ sources add \ -source "${nuget_url}" \ -storepasswordincleartext \ -name "GitHub" \ -username "${GITHUB_REPOSITORY_OWNER}" \ -password "${GITHUB_TOKEN}" - mono $(vcpkg fetch nuget | tail -n 1) \ + ${nuget} \ setapikey "${GITHUB_TOKEN}" \ -source "${nuget_url}" fi diff --git a/dev/tasks/python-wheels/github.linux.yml b/dev/tasks/python-wheels/github.linux.yml index b2afc93fdd523..c1c856c3c465b 100644 --- a/dev/tasks/python-wheels/github.linux.yml +++ b/dev/tasks/python-wheels/github.linux.yml @@ -52,12 +52,12 @@ jobs: - name: Build wheel shell: bash + env: + GITHUB_TOKEN: {{ '${{ secrets.GITHUB_TOKEN }}' }} run: | archery docker run \ -e SETUPTOOLS_SCM_PRETEND_VERSION={{ arrow.no_rc_version }} \ python-wheel-manylinux-{{ manylinux_version }} - env: - GITHUB_TOKEN: {{ '${{ secrets.GITHUB_TOKEN }}' }} - uses: actions/upload-artifact@v4 with: diff --git a/dev/tasks/python-wheels/github.windows.yml b/dev/tasks/python-wheels/github.windows.yml index 2bcda4966db8b..221c6ba00ca8a 100644 --- a/dev/tasks/python-wheels/github.windows.yml +++ b/dev/tasks/python-wheels/github.windows.yml @@ -43,6 +43,8 @@ jobs: - name: Build wheel shell: cmd + env: + GITHUB_TOKEN: {{ '${{ secrets.GITHUB_TOKEN }}' }} run: | cd arrow @rem We want to use only