From c6deb9bd41210e7e286cbed7d09c2f179374114f Mon Sep 17 00:00:00 2001 From: Stephen Best Date: Sun, 14 Jan 2024 02:17:57 +0100 Subject: [PATCH 1/4] Compile using Dockerfile --- Dockerfile | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f0c8601 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +FROM docker.io/debian:bookworm-slim + +ARG DEBIAN_FRONTEND=noninteractive +RUN apt update +RUN apt install -y build-essential cmake git +RUN apt install -y gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib +RUN apt install -y python3 python3-pip +RUN apt install -y vim +RUN apt autoremove && apt clean + +RUN mkdir -p /root/workspace +WORKDIR /root/workspace + +RUN git clone --branch 1.5.1 https://github.com/raspberrypi/pico-sdk.git +ENV PICO_SDK_PATH=/root/workspace/pico-sdk +WORKDIR /root/workspace/pico-sdk/lib/tinyusb +RUN git submodule init +RUN git submodule update +RUN git checkout master + +WORKDIR /root/workspace +RUN git clone --branch USBRETRO_V1_0_3 https://github.com/RobertDaleSmith/USBRetro.git +WORKDIR /root/workspace/USBRetro +RUN git submodule init +RUN git submodule update + +WORKDIR /root/workspace/USBRetro/src +RUN sh build.sh + +WORKDIR /root/workspace/USBRetro/src/build +RUN cmake .. +RUN make usbretro_ngc + +CMD ["/bin/bash"] From 4f596d775fb204ca40156884cfdf3c69e80077f7 Mon Sep 17 00:00:00 2001 From: Stephen Best Date: Sun, 14 Jan 2024 21:28:28 +0100 Subject: [PATCH 2/4] Build works on Buster/gcc-8.3.0 but not Bullseye/gcc-12.2.0 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f0c8601..3ca4ada 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/debian:bookworm-slim +FROM docker.io/debian:buster-slim ARG DEBIAN_FRONTEND=noninteractive RUN apt update From 73ef646251c91daebb5f437a4bbdf8cf8f879421 Mon Sep 17 00:00:00 2001 From: Stephen Best Date: Sun, 14 Jan 2024 23:09:01 +0100 Subject: [PATCH 3/4] Setup Docker build in GitHub action --- .github/workflows/build.yml | 25 +++++++++++++++++++++++++ Dockerfile | 12 +++--------- 2 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..626d10e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,25 @@ +name: Build USBRetro Project + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Build Docker image and compile for all consoles + run: | + docker build -t usbretro . + docker run --rm -v ${{ github.workspace }}/src/build:/root/workspace/USBRetro/src/build usbretro /bin/bash -c "sh build.sh && cd build && cmake .. && make" + + - name: Upload Artifacts + uses: actions/upload-artifact@v2 + with: + name: all_console_firmwares_raspberry_pi_pico + path: ${{ github.workspace }}/src/build/*.uf2 diff --git a/Dockerfile b/Dockerfile index 3ca4ada..394846f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ RUN apt install -y python3 python3-pip RUN apt install -y vim RUN apt autoremove && apt clean -RUN mkdir -p /root/workspace +RUN mkdir -p /root/workspace/USBRetro WORKDIR /root/workspace RUN git clone --branch 1.5.1 https://github.com/raspberrypi/pico-sdk.git @@ -16,19 +16,13 @@ ENV PICO_SDK_PATH=/root/workspace/pico-sdk WORKDIR /root/workspace/pico-sdk/lib/tinyusb RUN git submodule init RUN git submodule update -RUN git checkout master +RUN git checkout 4b3b401ce -WORKDIR /root/workspace -RUN git clone --branch USBRETRO_V1_0_3 https://github.com/RobertDaleSmith/USBRetro.git WORKDIR /root/workspace/USBRetro +COPY . . RUN git submodule init RUN git submodule update WORKDIR /root/workspace/USBRetro/src -RUN sh build.sh - -WORKDIR /root/workspace/USBRetro/src/build -RUN cmake .. -RUN make usbretro_ngc CMD ["/bin/bash"] From b80781e616f3e5574817a3b1e9f8836a197f4ecb Mon Sep 17 00:00:00 2001 From: Stephen Best Date: Mon, 15 Jan 2024 00:14:27 +0100 Subject: [PATCH 4/4] fix --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 626d10e..6ebdc61 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build USBRetro Project +name: Build USBRetro on: push: