From 52b8e06c797388fe054a260060232285e67a3cd8 Mon Sep 17 00:00:00 2001 From: "Allan C. Marques Lira" Date: Mon, 21 Dec 2020 09:47:35 -0300 Subject: [PATCH] Second commit --- .github/workflows/main.yml | 41 +++++++++++++++++++++++++ .github/workflows/release.yml | 32 ++++++++++++++++++++ linux-amd64/Dockerfile | 8 +++++ linux-arm32v7/Dockerfile | 57 +++++++++++++++++++++++++++++++++++ linux-arm64/Dockerfile | 57 +++++++++++++++++++++++++++++++++++ 5 files changed, 195 insertions(+) create mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/release.yml create mode 100644 linux-amd64/Dockerfile create mode 100644 linux-arm32v7/Dockerfile create mode 100644 linux-arm64/Dockerfile diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..c7e8cae --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,41 @@ +name: Merge pipeline + +on: + workflow_dispatch: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + name: Build '${{ matrix.project }}' container + strategy: + fail-fast: false + matrix: + project: [ linux-amd64, linux-arm32v7, linux-arm64 ] + + runs-on: ubuntu-20.04 + + steps: + - name: Checkout source code + uses: actions/checkout@v2 + + - name: Allow multiarch + run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + + - name: Build container + run: | + cd ${{ matrix.project }} + docker build . --tag totalcross/${{ matrix.project }} + + - name: Login to DockerHub + if: ${{ github.ref == 'refs/heads/main' }} + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Push to DockerHub + if: ${{ github.ref == 'refs/heads/main' }} + run: docker push totalcross/${{ matrix.project }}:latest \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e28b732 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +name: Release + +on: + push: + tags: + - 'v*' # Push events to matching v*, i.e. v6.1.1, v7.0.0 + workflow_dispatch: + inputs: + tag: + description: 'Version (name of the tag to be referenced)' + required: true + +jobs: + docker: + name: DockerHub tagging + strategy: + fail-fast: false + matrix: + project: [ linux-amd64, linux-arm32v7, linux-arm64 ] + runs-on: ubuntu-20.04 + steps: + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Pull latest container + run: docker pull totalcross/${{ matrix.project }}:latest + - name: Tag latest container with the same repo tag + run: docker tag totalcross/${{ matrix.project }}:latest totalcross/${{ matrix.project }}:${GITHUB_REF##*/} + - name: Push the new tag + run: docker push totalcross/${{ matrix.project }}:${GITHUB_REF##*/} \ No newline at end of file diff --git a/linux-amd64/Dockerfile b/linux-amd64/Dockerfile new file mode 100644 index 0000000..621d149 --- /dev/null +++ b/linux-amd64/Dockerfile @@ -0,0 +1,8 @@ +FROM amd64/ubuntu:bionic + +RUN apt-get update +RUN apt-get install -y cmake ninja-build libsdl2-dev libfontconfig1-dev + +ENV BUILD_FOLDER /build + +WORKDIR ${BUILD_FOLDER} \ No newline at end of file diff --git a/linux-arm32v7/Dockerfile b/linux-arm32v7/Dockerfile new file mode 100644 index 0000000..ee852fb --- /dev/null +++ b/linux-arm32v7/Dockerfile @@ -0,0 +1,57 @@ +FROM arm32v7/ubuntu:bionic + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + cmake \ + ninja-build \ + build-essential \ + libfontconfig1-dev \ + libtool \ + libasound2-dev \ + libpulse-dev \ + libaudio-dev \ + libx11-dev \ + libxext-dev \ + libxrandr-dev \ + libxcursor-dev \ + libxi-dev \ + libxinerama-dev \ + libxxf86vm-dev \ + libxss-dev \ + libgl1-mesa-dev \ + libdbus-1-dev \ + libudev-dev \ + libgles2-mesa-dev \ + libegl1-mesa-dev \ + libibus-1.0-dev \ + fcitx-libs-dev \ + libsamplerate0-dev \ + libsndio-dev \ + libwayland-dev \ + libxkbcommon-dev \ + wayland-protocols \ + git \ + ca-certificates; \ + apt-get install -y libglvnd-dev || apt-get -f install; \ + apt-get clean + +RUN git clone https://github.com/SDL-mirror/SDL.git \ + --branch=release-2.0.10 \ + --single-branch \ + --depth=1 \ + && cd SDL \ + && mkdir build; cd build \ + && CFLAGS="-O3 -fPIC" \ + cmake ../ -G Ninja \ + -DSDL_SHARED=0 \ + -DSDL_AUDIO=0 \ + -DVIDEO_VIVANTE=ON \ + -DVIDEO_WAYLAND=ON \ + -DWAYLAND_SHARED=ON; \ + ninja install + +RUN rm -r /SDL + +ENV BUILD_FOLDER /build + +WORKDIR ${BUILD_FOLDER} \ No newline at end of file diff --git a/linux-arm64/Dockerfile b/linux-arm64/Dockerfile new file mode 100644 index 0000000..590eae1 --- /dev/null +++ b/linux-arm64/Dockerfile @@ -0,0 +1,57 @@ +FROM arm64v8/ubuntu:bionic + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + cmake \ + ninja-build \ + build-essential \ + libfontconfig1-dev \ + libtool \ + libasound2-dev \ + libpulse-dev \ + libaudio-dev \ + libx11-dev \ + libxext-dev \ + libxrandr-dev \ + libxcursor-dev \ + libxi-dev \ + libxinerama-dev \ + libxxf86vm-dev \ + libxss-dev \ + libgl1-mesa-dev \ + libdbus-1-dev \ + libudev-dev \ + libgles2-mesa-dev \ + libegl1-mesa-dev \ + libibus-1.0-dev \ + fcitx-libs-dev \ + libsamplerate0-dev \ + libsndio-dev \ + libwayland-dev \ + libxkbcommon-dev \ + wayland-protocols \ + git \ + ca-certificates; \ + apt-get install -y libglvnd-dev || apt-get -f install; \ + apt-get clean + +RUN git clone https://github.com/SDL-mirror/SDL.git \ + --branch=release-2.0.10 \ + --single-branch \ + --depth=1 \ + && cd SDL \ + && mkdir build; cd build \ + && CFLAGS="-O3 -fPIC" \ + cmake ../ -G Ninja \ + -DSDL_SHARED=0 \ + -DSDL_AUDIO=0 \ + -DVIDEO_VIVANTE=ON \ + -DVIDEO_WAYLAND=ON \ + -DWAYLAND_SHARED=ON; \ + ninja install + +RUN rm -r /SDL + +ENV BUILD_FOLDER /build + +WORKDIR ${BUILD_FOLDER} \ No newline at end of file