Merge pull request #346 from AkihiroSuda/riscv64

release.yaml: add riscv64 build
This commit is contained in:
Giuseppe Scrivano 2022-05-02 09:55:53 +02:00 committed by GitHub
commit 0508524bdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 16 deletions

View File

@ -10,18 +10,9 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: "Register QEMU to /proc/sys/fs/binfmt_misc" - uses: docker/setup-buildx-action@v1
run: docker run --rm --privileged linuxkit/binfmt:v0.8
- name: "Fetch buildx binary"
run: |
wget -O buildx https://github.com/docker/buildx/releases/download/v0.4.1/buildx-v0.4.1.linux-amd64
chmod +x buildx
- name: "Initialize buildx"
run: |
./buildx create --name cross --platform=amd64,arm,arm64,s390x,ppc64le --use
./buildx inspect --bootstrap
- name: "Build binaries from Containerfile.cross" - name: "Build binaries from Containerfile.cross"
run: ./buildx build -o /tmp --platform=amd64,arm64,arm,s390x,ppc64le -f Containerfile.cross . run: docker buildx build -o /tmp --platform=amd64,arm64,arm,s390x,ppc64le,riscv64 -f Containerfile.cross .
- name: "Create /tmp/artifact" - name: "Create /tmp/artifact"
run: | run: |
mkdir -p /tmp/artifact mkdir -p /tmp/artifact
@ -30,6 +21,7 @@ jobs:
mv /tmp/linux_arm_v7/fuse-overlayfs /tmp/artifact/fuse-overlayfs-armv7l mv /tmp/linux_arm_v7/fuse-overlayfs /tmp/artifact/fuse-overlayfs-armv7l
mv /tmp/linux_s390x/fuse-overlayfs /tmp/artifact/fuse-overlayfs-s390x mv /tmp/linux_s390x/fuse-overlayfs /tmp/artifact/fuse-overlayfs-s390x
mv /tmp/linux_ppc64le/fuse-overlayfs /tmp/artifact/fuse-overlayfs-ppc64le mv /tmp/linux_ppc64le/fuse-overlayfs /tmp/artifact/fuse-overlayfs-ppc64le
mv /tmp/linux_riscv64/fuse-overlayfs /tmp/artifact/fuse-overlayfs-riscv64
- name: "SHA256SUMS" - name: "SHA256SUMS"
run: (cd /tmp/artifact; sha256sum *) | tee /tmp/SHA256SUMS run: (cd /tmp/artifact; sha256sum *) | tee /tmp/SHA256SUMS
- name: "Create release" - name: "Create release"
@ -86,6 +78,15 @@ jobs:
asset_path: /tmp/artifact/fuse-overlayfs-ppc64le asset_path: /tmp/artifact/fuse-overlayfs-ppc64le
asset_name: fuse-overlayfs-ppc64le asset_name: fuse-overlayfs-ppc64le
asset_content_type: application/octet-stream asset_content_type: application/octet-stream
- name: "Upload fuse-overlayfs-riscv64"
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /tmp/artifact/fuse-overlayfs-riscv64
asset_name: fuse-overlayfs-riscv64
asset_content_type: application/octet-stream
- name: "Upload SHA256SUMS" - name: "Upload SHA256SUMS"
uses: actions/upload-release-asset@v1.0.2 uses: actions/upload-release-asset@v1.0.2
env: env:

View File

@ -1,14 +1,16 @@
FROM --platform=$BUILDPLATFORM debian:10 AS fuse-overlayfs FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.1.0 AS xx
FROM --platform=$BUILDPLATFORM ubuntu:22.04 AS fuse-overlayfs
RUN apt-get update && \ RUN apt-get update && \
apt-get install --no-install-recommends -y \ apt-get install --no-install-recommends -y \
git ca-certificates libc6-dev gcc make automake autoconf pkgconf libfuse3-dev file curl go-md2man git make automake autoconf pkgconf file go-md2man
RUN curl -o /cross.sh https://raw.githubusercontent.com/tonistiigi/binfmt/18c3d40ae2e3485e4de5b453e8460d6872b24d6b/binfmt/scripts/cross.sh && chmod +x /cross.sh
COPY . /fuse-overlayfs COPY . /fuse-overlayfs
WORKDIR /fuse-overlayfs WORKDIR /fuse-overlayfs
COPY --from=xx / /
ARG TARGETPLATFORM ARG TARGETPLATFORM
RUN /cross.sh install gcc pkgconf libfuse3-dev | sh ENV DEBIAN_FRONTEND=noninteractive
RUN xx-apt-get install -y gcc libfuse3-dev
RUN ./autogen.sh && \ RUN ./autogen.sh && \
CC=$(/cross.sh cross-prefix)-gcc LD=$(/cross.sh cross-prefix)-ld LIBS="-ldl" LDFLAGS="-static" ./configure && \ LIBS="-ldl" LDFLAGS="-static" ./configure --host=$(xx-info) && \
make && mkdir /out && cp fuse-overlayfs /out && \ make && mkdir /out && cp fuse-overlayfs /out && \
file /out/fuse-overlayfs | grep "statically linked" file /out/fuse-overlayfs | grep "statically linked"