Skip to content

Commit

Permalink
Second commit
Browse files Browse the repository at this point in the history
  • Loading branch information
acmlira committed Dec 21, 2020
1 parent 835b3b3 commit 52b8e06
Show file tree
Hide file tree
Showing 5 changed files with 195 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -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
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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##*/}
8 changes: 8 additions & 0 deletions linux-amd64/Dockerfile
Original file line number Diff line number Diff line change
@@ -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}
57 changes: 57 additions & 0 deletions linux-arm32v7/Dockerfile
Original file line number Diff line number Diff line change
@@ -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}
57 changes: 57 additions & 0 deletions linux-arm64/Dockerfile
Original file line number Diff line number Diff line change
@@ -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}

0 comments on commit 52b8e06

Please sign in to comment.