Skip to content

Commit

Permalink
Use nuget.config
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Nov 5, 2024
1 parent 34a79f5 commit 2cb4b09
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
4 changes: 2 additions & 2 deletions ci/docker/python-wheel-manylinux.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,12 @@ COPY ci/vcpkg/*.patch \
arrow/ci/vcpkg/
COPY ci/scripts/install_vcpkg.sh \
arrow/ci/scripts/
COPY ci/vcpkg/vcpkg.json arrow/ci/vcpkg/
ENV VCPKG_ROOT=/opt/vcpkg
ARG build_type=release
ENV CMAKE_BUILD_TYPE=${build_type} \
GITHUB_ACTOR="${GITHUB_ACTOR}" \
GITHUB_TOKEN="${GITHUB_TOKEN}" \
VCPKG_BINARY_SOURCES="clear;nuget,https://nuget.pkg.github.com/${GITHUB_ACTOR}/index.json,readwrite" \
VCPKG_BINARY_SOURCES="clear;nugetconfig,${VCPKG_ROOT}/nuget.config" \
VCPKG_DEFAULT_TRIPLET=${arch_short}-linux-static-${build_type} \
VCPKG_FEATURE_FLAGS="manifests" \
VCPKG_FORCE_SYSTEM_BINARIES=1 \
Expand All @@ -89,6 +88,7 @@ ENV CMAKE_BUILD_TYPE=${build_type} \
RUN arrow/ci/scripts/install_vcpkg.sh ${VCPKG_ROOT} ${vcpkg}
ENV PATH="${PATH}:${VCPKG_ROOT}"

COPY ci/vcpkg/vcpkg.json arrow/ci/vcpkg/
# cannot use the S3 feature here because while aws-sdk-cpp=1.9.160 contains
# ssl related fixes as well as we can patch the vcpkg portfile to support
# arm machines it hits ARROW-15141 where we would need to fall back to 1.8.186
Expand Down
38 changes: 21 additions & 17 deletions ci/scripts/install_vcpkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,28 @@ if [ -f "${vcpkg_ports_patch}" ]; then
fi

if [ -n "${GITHUB_TOKEN:-}" ] && [ -n "${GITHUB_ACTOR:-}" ]; then
PATH="${PATH}:${VCPKG_ROOT}"
vcpkg install \
--clean-after-build \
--x-install-root=${VCPKG_ROOT}/installed \
--x-manifest-root=/arrow/ci/vcpkg \
nuget

nuget_url="https://nuget.pkg.github.com/${GITHUB_ACTOR}/index.json"
"$(vcpkg fetch nuget)" \
sources add \
-Source "${nuget_url}" \
-StorePasswordInClearText \
-Name GitHubPackages \
-UserName "${GITHUB_ACTOR}" \
-Password "${GITHUB_TOKEN}"
"$(vcpkg fetch nuget)" \
setapikey "${GITHUB_TOKEN}" \
-Source "${nuget_url}"
cat <<NUGET_CONFIG > "${VCPKG_ROOT}/nuget.config"
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key="defaultPushSource" value="${nuget_url}" />
</config>
<apikeys>
<add key="${nuget_url}" value="${GITHUB_TOKEN}" />
</apikeys>
<packageSources>
<clear />
<add key="GitHubPackages" value="${nuget_url}" />
</packageSources>
<packageSourcesCredentials>
<GitHubPackages>
<add key="Username" value="${GITHUB_ACTOR}" />
<add key="Password" value="${GITHUB_TOKEN}" />
</GitHubPackages>
</packageSourcesCredentials>
</configuration>
NUGET_CONFIG
fi

popd

0 comments on commit 2cb4b09

Please sign in to comment.