Skip to content

Commit

Permalink
Use GITHUB_REPOSITORY_OWNER
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Nov 6, 2024
1 parent cf26b83 commit 9b9e5b5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 27 deletions.
6 changes: 3 additions & 3 deletions ci/docker/python-wheel-manylinux.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ COPY ci/scripts/install_ccache.sh arrow/ci/scripts/
RUN /arrow/ci/scripts/install_ccache.sh ${ccache} /usr/local

# Install vcpkg
ARG GITHUB_ACTOR
ARG GITHUB_REPOSITORY_OWNER
ARG GITHUB_TOKEN
ARG vcpkg
COPY ci/vcpkg/*.patch \
Expand All @@ -77,9 +77,9 @@ COPY ci/scripts/install_vcpkg.sh \
ENV VCPKG_ROOT=/opt/vcpkg
ARG build_type=release
ENV CMAKE_BUILD_TYPE=${build_type} \
GITHUB_ACTOR="${GITHUB_ACTOR}" \
GITHUB_REPOSITORY_OWNER="${GITHUB_REPOSITORY_OWNER}" \
GITHUB_TOKEN="${GITHUB_TOKEN}" \
VCPKG_BINARY_SOURCES="clear;nugetconfig,${VCPKG_ROOT}/nuget.config" \
VCPKG_BINARY_SOURCES="clear;nuget,GitHub,readwrite" \
VCPKG_DEFAULT_TRIPLET=${arch_short}-linux-static-${build_type} \
VCPKG_FEATURE_FLAGS="manifests" \
VCPKG_FORCE_SYSTEM_BINARIES=1 \
Expand Down
35 changes: 12 additions & 23 deletions ci/scripts/install_vcpkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ if [ -f "${vcpkg_ports_patch}" ]; then
echo "Patch successfully applied to the VCPKG port files!"
fi

if [ -n "${GITHUB_TOKEN:-}" ] && [ -n "${GITHUB_ACTOR:-}" ]; then
if [ -n "${GITHUB_TOKEN:-}" ] && [ -n "${GITHUB_REPOSITORY_OWNER:-}" ]; then
if type dnf 2>/dev/null; then
dnf install -y epel-release
dnf install -y mono-complete
Expand All @@ -66,28 +66,17 @@ exec mono /usr/libexec/nuget.exe "\$@"
NUGET
chmod +x /usr/bin/nuget
fi
nuget_url="https://nuget.pkg.github.com/${GITHUB_ACTOR}/index.json"
cat <<NUGET_CONFIG | tee "${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
nuget_url="https://nuget.pkg.github.com/${GITHUB_REPOSITORY_OWNER}/index.json"
nuget \
sources add \
-source "${nuget_url}" \
-storepasswordincleartext \
-name "GitHub" \
-username "${GITHUB_REPOSITORY_OWNER}" \
-password "${GITHUB_TOKEN}"
nuget \
setapikey "${GITHUB_TOKEN}" \
-source "${nuget_url}"
fi

popd
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ x-sccache: &sccache

x-vcpkg-build-args: &vcpkg-build-args
vcpkg: ${VCPKG}
GITHUB_ACTOR:
GITHUB_REPOSITORY_OWNER:
GITHUB_TOKEN:

# CPU/memory limit presets to pass to Docker.
Expand Down

0 comments on commit 9b9e5b5

Please sign in to comment.