From 0b05260b91c138ca9939721b036a8878eee6fda6 Mon Sep 17 00:00:00 2001 From: Kevin Park Date: Tue, 8 Sep 2020 11:28:54 -0400 Subject: [PATCH] packaging linux builds --- .github/setup-apt.sh | 8 +++ .github/workflows/packaging.yaml | 88 ++++++++++++++++++++++++++++++++ .gitmodules | 12 ++--- 3 files changed, 102 insertions(+), 6 deletions(-) create mode 100755 .github/setup-apt.sh create mode 100644 .github/workflows/packaging.yaml diff --git a/.github/setup-apt.sh b/.github/setup-apt.sh new file mode 100755 index 00000000..5ce65e55 --- /dev/null +++ b/.github/setup-apt.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# install OS prerequisites +dpkg --add-architecture i386 +apt update +apt install -y autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev \ + libgmp-dev gawk build-essential bison flex texinfo gperf libtool \ + patchutils bc zlib1g-dev libexpat-dev git diff --git a/.github/workflows/packaging.yaml b/.github/workflows/packaging.yaml new file mode 100644 index 00000000..04b57943 --- /dev/null +++ b/.github/workflows/packaging.yaml @@ -0,0 +1,88 @@ +name: Packaging + +on: + push: + branches: + - master + +jobs: + checkout: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: initialize submodules + run: | + git submodule init + git submodule update --recursive --progress --recommend-shallow + + # workaround https://github.com/actions/upload-artifact/issues/38 + - name: tarball source + run: | + base=$(basename $PWD) + cd .. + tar czvf source.tar.gz --exclude-vcs -C $base . + mv source.tar.gz $base/ + + - uses: actions/upload-artifact@v2 + with: + name: source-code-full + path: source.tar.gz + + + build-riscv32: + needs: checkout + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v2 + with: + name: source-code-full + + # workaround https://github.com/actions/upload-artifact/issues/38 + - name: tarball source + run: tar -xvf source.tar.gz + + - name: install dependencies + run: sudo ./.github/setup-apt.sh + + - name: Build Toolchain + run: | + ./configure --prefix=/opt/riscv --with-arch=rv32gc --with-abi=ilp32d + sudo make -j $(nproc) linux + + - name: tarball build + run: tar czvf riscv.tar.gz -C /opt/ riscv/ + + - uses: actions/upload-artifact@v2 + with: + name: riscv32-glibc-nightly + path: riscv.tar.gz + + + build-riscv64: + needs: checkout + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v2 + with: + name: source-code-full + + # workaround https://github.com/actions/upload-artifact/issues/38 + - name: tarball source + run: tar -xvf source.tar.gz + + - name: install dependencies + run: sudo ./.github/setup-apt.sh + + - name: Build Toolchain + run: | + ./configure --prefix=/opt/riscv + sudo make -j $(nproc) linux + + - name: tarball build + run: tar czvf riscv.tar.gz -C /opt/ riscv/ + + - uses: actions/upload-artifact@v2 + with: + name: riscv64-glibc-nightly + path: riscv.tar.gz \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index bfc0f7bd..16d1151b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,21 +1,21 @@ [submodule "riscv-binutils"] path = riscv-binutils - url = ../riscv-binutils-gdb.git + url = ../../riscv/riscv-binutils-gdb.git [submodule "riscv-gcc"] path = riscv-gcc - url = ../riscv-gcc.git + url = ../../riscv/riscv-gcc.git [submodule "riscv-glibc"] path = riscv-glibc - url = ../riscv-glibc.git + url = ../../riscv/riscv-glibc.git [submodule "riscv-dejagnu"] path = riscv-dejagnu - url = ../riscv-dejagnu.git + url = ../../riscv/riscv-dejagnu.git [submodule "riscv-newlib"] path = riscv-newlib - url = ../riscv-newlib.git + url = ../../riscv/riscv-newlib.git [submodule "riscv-gdb"] path = riscv-gdb - url = ../riscv-binutils-gdb.git + url = ../../riscv/riscv-binutils-gdb.git [submodule "qemu"] path = qemu url = https://git.qemu.org/git/qemu.git