diff --git a/.github/workflows/pushaction.yml b/.github/workflows/pushaction.yml index 8d9ccdd..9374586 100644 --- a/.github/workflows/pushaction.yml +++ b/.github/workflows/pushaction.yml @@ -50,11 +50,38 @@ jobs: linux: needs: macos runs-on: ubuntu-20.04 + container: ubuntu:18.04 env: ORG_GRADLE_PROJECT_GITHUB_USERNAME: "" ORG_GRADLE_PROJECT_GITHUB_API_TOKEN: "" steps: - - uses: actions/checkout@v4 + - name: Install dependencies into minimal dockerfile + run: | + # ubuntu dockerfile is very minimal (only 122 packages are installed) + # need to install updated git (from official git ppa) + apt update + apt install -y software-properties-common + add-apt-repository ppa:git-core/ppa -y + # install dependencies expected by other steps + apt update + apt install -y git \ + curl \ + ca-certificates \ + wget \ + bzip2 \ + zip \ + unzip \ + xz-utils \ + openjdk-11-jdk-headless \ + maven \ + build-essential \ + ant sudo locales + # set Locale to en_US.UTF-8 (avoids hang during compilation) + locale-gen en_US.UTF-8 + echo "LANG=en_US.UTF-8" >> $GITHUB_ENV + echo "LANGUAGE=en_US.UTF-8" >> $GITHUB_ENV + echo "LC_ALL=en_US.UTF-8" >> $GITHUB_ENV + - uses: actions/checkout@v3 with: submodules: 'recursive' @@ -67,10 +94,13 @@ jobs: - name: Setup Gradle uses: gradle/gradle-build-action@v2.4.2 - - run: echo "http://ports.ubuntu.com/ubuntu-ports" | sudo tee -a /etc/apt/apt-mirrors.txt + - run: sudo sed -i 's/deb http/deb [arch=amd64,i386] http/' /etc/apt/sources.list + - run: grep "ubuntu.com/ubuntu" /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/ports.list + - run: sudo sed -i 's/amd64,i386/armhf,arm64/' /etc/apt/sources.list.d/ports.list + - run: sudo sed -i 's#http://.*/ubuntu#http://ports.ubuntu.com/ubuntu-ports#' /etc/apt/sources.list.d/ports.list - name: Add extra platform architectures run: sudo dpkg --add-architecture i386; sudo dpkg --add-architecture armhf; sudo dpkg --add-architecture arm64 - - run: sudo apt-get update || true + - run: sudo apt-get update - name: Install Windows compilers run: sudo apt-get -yq install g++-mingw-w64-i686 g++-mingw-w64-x86-64 - name: Install Linux x86 compilers/libraries diff --git a/.github/workflows/releaseaction.yml b/.github/workflows/releaseaction.yml index 21e5cec..1e94410 100644 --- a/.github/workflows/releaseaction.yml +++ b/.github/workflows/releaseaction.yml @@ -53,11 +53,38 @@ jobs: linux: needs: macos runs-on: ubuntu-20.04 + container: ubuntu:18.04 env: ORG_GRADLE_PROJECT_GITHUB_USERNAME: "" ORG_GRADLE_PROJECT_GITHUB_API_TOKEN: "" steps: - - uses: actions/checkout@v4 + - name: Install dependencies into minimal dockerfile + run: | + # ubuntu dockerfile is very minimal (only 122 packages are installed) + # need to install updated git (from official git ppa) + apt update + apt install -y software-properties-common + add-apt-repository ppa:git-core/ppa -y + # install dependencies expected by other steps + apt update + apt install -y git \ + curl \ + ca-certificates \ + wget \ + bzip2 \ + zip \ + unzip \ + xz-utils \ + openjdk-11-jdk-headless \ + maven \ + build-essential \ + ant sudo locales + # set Locale to en_US.UTF-8 (avoids hang during compilation) + locale-gen en_US.UTF-8 + echo "LANG=en_US.UTF-8" >> $GITHUB_ENV + echo "LANGUAGE=en_US.UTF-8" >> $GITHUB_ENV + echo "LC_ALL=en_US.UTF-8" >> $GITHUB_ENV + - uses: actions/checkout@v3 with: submodules: 'recursive' @@ -70,10 +97,13 @@ jobs: - name: Setup Gradle uses: gradle/gradle-build-action@v2.4.2 - - run: echo "http://ports.ubuntu.com/ubuntu-ports" | sudo tee -a /etc/apt/apt-mirrors.txt + - run: sudo sed -i 's/deb http/deb [arch=amd64,i386] http/' /etc/apt/sources.list + - run: grep "ubuntu.com/ubuntu" /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/ports.list + - run: sudo sed -i 's/amd64,i386/armhf,arm64/' /etc/apt/sources.list.d/ports.list + - run: sudo sed -i 's#http://.*/ubuntu#http://ports.ubuntu.com/ubuntu-ports#' /etc/apt/sources.list.d/ports.list - name: Add extra platform architectures run: sudo dpkg --add-architecture i386; sudo dpkg --add-architecture armhf; sudo dpkg --add-architecture arm64 - - run: sudo apt-get update || true + - run: sudo apt-get update - name: Install Windows compilers run: sudo apt-get -yq install g++-mingw-w64-i686 g++-mingw-w64-x86-64 - name: Install Linux x86 compilers/libraries diff --git a/build.gradle b/build.gradle index 98cd334..b295d43 100644 --- a/build.gradle +++ b/build.gradle @@ -119,32 +119,32 @@ jnigen { add(Windows, x32) { cFlags += getSdl2CFlags('./SDL/build-windows32/') cppFlags += getSdl2CFlags('./SDL/build-windows32/') - libraries += getSdl2StaticLibs('./SDL/build-windows32/').replaceAll("[a-zA-Z0-9\\.\\-/]+libSDL2.a", file("SDL/build-windows32/build/.libs/libSDL2.a").absolutePath).replace("-lSDL2main", file("SDL/build-windows32/build/.libs/libSDL2main.a").absolutePath) + libraries += getSdl2StaticLibs('./SDL/build-windows32/').replaceAll("[a-zA-Z0-9_\\.\\-/]+libSDL2.a", file("SDL/build-windows32/build/.libs/libSDL2.a").absolutePath).replace("-lSDL2main", file("SDL/build-windows32/build/.libs/libSDL2main.a").absolutePath) } add(Windows, x64) { cFlags += getSdl2CFlags('./SDL/build-windows64/') cppFlags += getSdl2CFlags('./SDL/build-windows64/') - libraries += getSdl2StaticLibs('./SDL/build-windows64/').replaceAll("[a-zA-Z0-9\\.\\-/]+libSDL2.a", file("SDL/build-windows64/build/.libs/libSDL2.a").absolutePath).replace("-lSDL2main", file("SDL/build-windows64/build/.libs/libSDL2main.a").absolutePath) + libraries += getSdl2StaticLibs('./SDL/build-windows64/').replaceAll("[a-zA-Z0-9_\\.\\-/]+libSDL2.a", file("SDL/build-windows64/build/.libs/libSDL2.a").absolutePath).replace("-lSDL2main", file("SDL/build-windows64/build/.libs/libSDL2main.a").absolutePath) } add(Linux, x32) { cFlags += getSdl2CFlags('./SDL/build-linux32/') cppFlags += getSdl2CFlags('./SDL/build-linux32/') - libraries += getSdl2StaticLibs('./SDL/build-linux32/').replaceAll("[a-zA-Z0-9\\.\\-/]+libSDL2.a", file("SDL/build-linux32/build/.libs/libSDL2.a").absolutePath) + libraries += getSdl2StaticLibs('./SDL/build-linux32/').replaceAll("[a-zA-Z0-9_\\.\\-/]+libSDL2.a", file("SDL/build-linux32/build/.libs/libSDL2.a").absolutePath) } add(Linux, x64) { cFlags += getSdl2CFlags('./SDL/build-linux64/') cppFlags += getSdl2CFlags('./SDL/build-linux64/') - libraries += getSdl2StaticLibs('./SDL/build-linux64/').replaceAll("[a-zA-Z0-9\\.\\-/]+libSDL2.a", file("SDL/build-linux64/build/.libs/libSDL2.a").absolutePath) + libraries += getSdl2StaticLibs('./SDL/build-linux64/').replaceAll("[a-zA-Z0-9_\\.\\-/]+libSDL2.a", file("SDL/build-linux64/build/.libs/libSDL2.a").absolutePath) } add(Linux, x32, ARM) { cFlags += getSdl2CFlags('./SDL/build-linuxarm32/') cppFlags += getSdl2CFlags('./SDL/build-linuxarm32/') - libraries += getSdl2StaticLibs('./SDL/build-linuxarm32/').replaceAll("[a-zA-Z0-9\\.\\-/]+libSDL2.a", file("SDL/build-linuxarm32/build/.libs/libSDL2.a").absolutePath) + libraries += getSdl2StaticLibs('./SDL/build-linuxarm32/').replaceAll("[a-zA-Z0-9_\\.\\-/]+libSDL2.a", file("SDL/build-linuxarm32/build/.libs/libSDL2.a").absolutePath) } add(Linux, x64, ARM) { cFlags += getSdl2CFlags('./SDL/build-linuxarm64/') cppFlags += getSdl2CFlags('./SDL/build-linuxarm64/') - libraries += getSdl2StaticLibs('./SDL/build-linuxarm64/').replaceAll("[a-zA-Z0-9\\.\\-/]+libSDL2.a", file("SDL/build-linuxarm64/build/.libs/libSDL2.a").absolutePath) + libraries += getSdl2StaticLibs('./SDL/build-linuxarm64/').replaceAll("[a-zA-Z0-9_\\.\\-/]+libSDL2.a", file("SDL/build-linuxarm64/build/.libs/libSDL2.a").absolutePath) } add(MacOsX, x64) { cFlags += getSdl2CFlags('./SDL/build-macos64/')