Skip to content

Commit 48c873b

Browse files
committed
set docker platform for cross-arch builds
1 parent 2783e2b commit 48c873b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/publish.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,16 @@ jobs:
7373
if: matrix.platform != 'amd64'
7474
uses: docker/setup-qemu-action@v3
7575

76+
- name: Set docker arch
77+
run: |
78+
platform=${{ matrix.platform }}
79+
if [[ $platform == arm64v8 ]]; then
80+
platform=arm64
81+
elif [[ $platform == arm32v7 ]]; then
82+
platform=arm
83+
fi
84+
echo "DOCKER_PLATFORM=$platform" >> $GITHUB_ENV
85+
7686
- uses: actions/download-artifact@v3
7787
with:
7888
name: patchelf
@@ -100,7 +110,7 @@ jobs:
100110
else
101111
ENTRYPOINT=
102112
fi
103-
docker run -e CXXFLAGS -v $(pwd):/gha ${{ matrix.platform }}/alpine:edge ${ENTRYPOINT} sh -ec "cd /gha && sh ./build.sh"
113+
docker run --platform "$DOCKER_PLATFORM" -e CXXFLAGS -v $(pwd):/gha ${{ matrix.platform }}/alpine:edge ${ENTRYPOINT} sh -ec "cd /gha && sh ./build.sh"
104114
- name: Check binaries
105115
run: |
106116
cat <<EOF > check.sh
@@ -109,7 +119,7 @@ jobs:
109119
tar -xf ./dist/patchelf-*-*.tar.gz
110120
./bin/patchelf --version
111121
EOF
112-
docker run -v $(pwd):/gha ${{ matrix.platform }}/debian:unstable-slim sh -ec "cd /gha && sh ./check.sh"
122+
docker run --platform "$DOCKER_PLATFORM" -v $(pwd):/gha ${{ matrix.platform }}/debian:unstable-slim sh -ec "cd /gha && sh ./check.sh"
113123
- uses: actions/upload-artifact@v3
114124
with:
115125
name: patchelf

0 commit comments

Comments
 (0)