From 3f4b0e69bbba7cd9bee960a3c73abb97662e3edb Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Mon, 25 Nov 2024 13:22:18 +0000 Subject: [PATCH 01/34] Add dockerfile and entrypoint.sh See https://docs.github.com/en/actions/sharing-automations/creating-actions/creating-a-docker-container-action --- .github/workflows/docker/Dockerfile | 8 +++++ .github/workflows/docker/entrypoint.sh | 45 ++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 .github/workflows/docker/Dockerfile create mode 100644 .github/workflows/docker/entrypoint.sh diff --git a/.github/workflows/docker/Dockerfile b/.github/workflows/docker/Dockerfile new file mode 100644 index 0000000..5305062 --- /dev/null +++ b/.github/workflows/docker/Dockerfile @@ -0,0 +1,8 @@ +# Container image that runs your code +FROM ubuntu:18.04 + +# Copies your code file from your action repository to the filesystem path `/` of the container +COPY entrypoint.sh /entrypoint.sh + +# Code file to execute when the docker container starts up (`entrypoint.sh`) +ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file diff --git a/.github/workflows/docker/entrypoint.sh b/.github/workflows/docker/entrypoint.sh new file mode 100644 index 0000000..2b66e3c --- /dev/null +++ b/.github/workflows/docker/entrypoint.sh @@ -0,0 +1,45 @@ +#!/bin/sh -l + +# 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 + +sudo sed -i 's/deb http/deb [arch=amd64,i386] http/' /etc/apt/sources.list +grep "ubuntu.com/ubuntu" /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/ports.list +sudo sed -i 's/amd64,i386/armhf,arm64/' /etc/apt/sources.list.d/ports.list +sudo sed -i 's#http://.*/ubuntu#http://ports.ubuntu.com/ubuntu-ports#' /etc/apt/sources.list.d/ports.list +# Add extra platform architectures +sudo dpkg --add-architecture i386; sudo dpkg --add-architecture armhf; sudo dpkg --add-architecture arm64 +sudo apt-get update +# Install Windows compilers +sudo apt-get -yq install g++-mingw-w64-i686 g++-mingw-w64-x86-64 +# Install Linux x86 compilers/libraries +sudo apt-get -yq install gcc-multilib g++-multilib linux-libc-dev:i386 +# Install Linux arm32 compilers/libraries +sudo apt-get -yq install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf +# Install Linux arm64 compilers/libraries +sudo apt-get -yq install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu + From 9c02c0e38cfb9b7f8026a29f1ed769e3f1a86357 Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Wed, 27 Nov 2024 15:20:34 +0000 Subject: [PATCH 02/34] test ls --- .github/workflows/docker/entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker/entrypoint.sh b/.github/workflows/docker/entrypoint.sh index 2b66e3c..d7664bf 100644 --- a/.github/workflows/docker/entrypoint.sh +++ b/.github/workflows/docker/entrypoint.sh @@ -43,3 +43,4 @@ sudo apt-get -yq install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf binutil # Install Linux arm64 compilers/libraries sudo apt-get -yq install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu +ls \ No newline at end of file From 3349e529d0bf0fc98b723509e16eb0eab8d5f819 Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Wed, 27 Nov 2024 15:36:55 +0000 Subject: [PATCH 03/34] Fix docker action not being called Used local action see https://github.com/orgs/community/discussions/26245#discussioncomment-3250938 --- .github/workflows/docker/docker.yml | 16 ++++++++++ .github/workflows/pushaction.yml | 48 ++++------------------------- 2 files changed, 22 insertions(+), 42 deletions(-) create mode 100644 .github/workflows/docker/docker.yml diff --git a/.github/workflows/docker/docker.yml b/.github/workflows/docker/docker.yml new file mode 100644 index 0000000..6929309 --- /dev/null +++ b/.github/workflows/docker/docker.yml @@ -0,0 +1,16 @@ +# docker.yml +name: 'Build Linux Natives in Docker' +description: 'Build Linux Natives in Ubuntu 18.04 docker container' +inputs: + who-to-greet: # id of input + description: 'Who to greet' + required: true + default: 'World' +outputs: + time: # id of output + description: 'The time we greeted you' +runs: + using: 'docker' + image: 'Dockerfile' + args: + - ${{ inputs.who-to-greet }} diff --git a/.github/workflows/pushaction.yml b/.github/workflows/pushaction.yml index 4c054e5..0cc326c 100644 --- a/.github/workflows/pushaction.yml +++ b/.github/workflows/pushaction.yml @@ -53,37 +53,10 @@ 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: - - 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' @@ -97,27 +70,18 @@ jobs: - name: Setup Gradle uses: gradle/gradle-build-action@v2.4.2 - - 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 - - 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 - run: sudo apt-get -yq install gcc-multilib g++-multilib linux-libc-dev:i386 - - name: Install Linux arm32 compilers/libraries - run: sudo apt-get -yq install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf - - name: Install Linux arm64 compilers/libraries - run: sudo apt-get -yq install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu - name: Download macOS natives uses: actions/download-artifact@v3 with: name: macos-natives path: libs + - name: Build in Docker Container + uses: ./.github/workflows/docker/docker.yml + id: docker + with: + who-to-greet: 'Mona the Octocat' + - run: find -type f -name "*.h" -exec sed -i 's/extern DECLSPEC//' {} \; working-directory: SDL - run: sed -i 's/#define SDL_DYNAMIC_API 1/#define SDL_DYNAMIC_API 0/' SDL/src/dynapi/SDL_dynapi.h From 859393e58f18f45cb5c48b6610f379a2c1f23bc2 Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Wed, 27 Nov 2024 15:42:16 +0000 Subject: [PATCH 04/34] Fix "Can't find 'action.yml', 'action.yaml' or 'Dockerfile" I thought the action name could be anything, but apparently it has to be action.yml. I created an actions folder just to make it clearer that this is an action, not a workflow --- .github/{workflows => actions}/docker/Dockerfile | 0 .../{workflows/docker/docker.yml => actions/docker/action.yml} | 2 +- .github/{workflows => actions}/docker/entrypoint.sh | 0 .github/workflows/pushaction.yml | 2 +- 4 files changed, 2 insertions(+), 2 deletions(-) rename .github/{workflows => actions}/docker/Dockerfile (100%) rename .github/{workflows/docker/docker.yml => actions/docker/action.yml} (96%) rename .github/{workflows => actions}/docker/entrypoint.sh (100%) diff --git a/.github/workflows/docker/Dockerfile b/.github/actions/docker/Dockerfile similarity index 100% rename from .github/workflows/docker/Dockerfile rename to .github/actions/docker/Dockerfile diff --git a/.github/workflows/docker/docker.yml b/.github/actions/docker/action.yml similarity index 96% rename from .github/workflows/docker/docker.yml rename to .github/actions/docker/action.yml index 6929309..2fefe87 100644 --- a/.github/workflows/docker/docker.yml +++ b/.github/actions/docker/action.yml @@ -1,4 +1,4 @@ -# docker.yml +# action.yml name: 'Build Linux Natives in Docker' description: 'Build Linux Natives in Ubuntu 18.04 docker container' inputs: diff --git a/.github/workflows/docker/entrypoint.sh b/.github/actions/docker/entrypoint.sh similarity index 100% rename from .github/workflows/docker/entrypoint.sh rename to .github/actions/docker/entrypoint.sh diff --git a/.github/workflows/pushaction.yml b/.github/workflows/pushaction.yml index 0cc326c..d9c5414 100644 --- a/.github/workflows/pushaction.yml +++ b/.github/workflows/pushaction.yml @@ -77,7 +77,7 @@ jobs: path: libs - name: Build in Docker Container - uses: ./.github/workflows/docker/docker.yml + uses: ./.github/actions/docker id: docker with: who-to-greet: 'Mona the Octocat' From ae551ff52383972c09cb6bf281c2523f7170b40f Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Wed, 27 Nov 2024 15:46:43 +0000 Subject: [PATCH 05/34] add execute permission for entrypoint.sh --- .github/actions/docker/entrypoint.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .github/actions/docker/entrypoint.sh diff --git a/.github/actions/docker/entrypoint.sh b/.github/actions/docker/entrypoint.sh old mode 100644 new mode 100755 From d19d06b7366b64aa3e5d611cea14344ced25e513 Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Wed, 27 Nov 2024 16:00:00 +0000 Subject: [PATCH 06/34] Add most of the rest of the job to the docker script Used cd in a weird way but if it works it works --- .github/actions/docker/entrypoint.sh | 42 +++++++++++++++++++++++++- .github/workflows/pushaction.yml | 44 ---------------------------- 2 files changed, 41 insertions(+), 45 deletions(-) diff --git a/.github/actions/docker/entrypoint.sh b/.github/actions/docker/entrypoint.sh index d7664bf..8a66c9d 100755 --- a/.github/actions/docker/entrypoint.sh +++ b/.github/actions/docker/entrypoint.sh @@ -43,4 +43,44 @@ sudo apt-get -yq install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf binutil # Install Linux arm64 compilers/libraries sudo apt-get -yq install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu -ls \ No newline at end of file +find -type f -path "SDL/*.h" -exec sed -i 's/extern DECLSPEC//' {} \; +sed -i 's/#define SDL_DYNAMIC_API 1/#define SDL_DYNAMIC_API 0/' SDL/src/dynapi/SDL_dynapi.h + +mkdir -p SDL/build-linux64 +cd SDL/build-linux64 +../configure CFLAGS="-fPIC" CPPFLAGS="-fPIC" --disable-audio --disable-video --disable-video-vulkan --disable-render --disable-filesystem --disable-threads --disable-directx --disable-mmx --disable-3dnow --disable-sse --disable-sse2 --disable-sse3 --disable-cpuinfo --disable-sensor --enable-hidapi +make -j +cd - + +mkdir -p SDL/build-linux32 +cd SDL/build-linux32 +../configure CFLAGS="-fPIC -m32" CPPFLAGS="-fPIC -m32" LDFLAGS="-m32" --disable-audio --disable-video --disable-video-vulkan --disable-render --disable-filesystem --disable-threads --disable-directx --disable-mmx --disable-3dnow --disable-sse --disable-sse2 --disable-sse3 --disable-cpuinfo --disable-sensor --enable-hidapi +make -j +cd - + +mkdir -p SDL/build-linuxarm32 +cd SDL/build-linuxarm32 +../configure --host=arm-linux-gnueabihf CFLAGS="-fPIC" CPPFLAGS="-fPIC" --disable-audio --disable-video --disable-video-vulkan --disable-render --disable-filesystem --disable-threads --disable-directx --disable-mmx --disable-3dnow --disable-sse --disable-sse2 --disable-sse3 --disable-cpuinfo --disable-sensor --enable-hidapi +make -j +cd - + +mkdir -p SDL/build-linuxarm64 +cd SDL/build-linuxarm64 +../configure --host=aarch64-linux-gnu CFLAGS="-fPIC" CPPFLAGS="-fPIC" --disable-audio --disable-video --disable-video-vulkan --disable-render --disable-filesystem --disable-threads --disable-directx --disable-mmx --disable-3dnow --disable-sse --disable-sse2 --disable-sse3 --disable-cpuinfo --disable-sensor --enable-hidapi +run: make -j +cd - + +mkdir -p SDL/build-windows32 +cd SDL/build-windows32 +../configure --host=i686-w64-mingw32 --disable-audio --disable-render --disable-power --disable-filesystem --disable-hidapi +run: make -j +cd - + +mkdir -p SDL/build-windows64 +cd SDL/build-windows64 +./configure --host=x86_64-w64-mingw32 --disable-audio --disable-render --disable-power --disable-filesystem --disable-hidapi +run: make -j +cd - + +chmod +x gradlew +./gradlew jnigen jnigenBuild jnigenJarNativesDesktop \ No newline at end of file diff --git a/.github/workflows/pushaction.yml b/.github/workflows/pushaction.yml index d9c5414..05d4569 100644 --- a/.github/workflows/pushaction.yml +++ b/.github/workflows/pushaction.yml @@ -82,50 +82,6 @@ jobs: with: who-to-greet: 'Mona the Octocat' - - run: find -type f -name "*.h" -exec sed -i 's/extern DECLSPEC//' {} \; - working-directory: SDL - - run: sed -i 's/#define SDL_DYNAMIC_API 1/#define SDL_DYNAMIC_API 0/' SDL/src/dynapi/SDL_dynapi.h - - - run: mkdir -p SDL/build-linux64 - - run: ../configure CFLAGS="-fPIC" CPPFLAGS="-fPIC" --disable-audio --disable-video --disable-video-vulkan --disable-render --disable-filesystem --disable-threads --disable-directx --disable-mmx --disable-3dnow --disable-sse --disable-sse2 --disable-sse3 --disable-cpuinfo --disable-sensor --enable-hidapi - working-directory: SDL/build-linux64 - - run: make -j - working-directory: SDL/build-linux64 - - - run: mkdir -p SDL/build-linux32 - - run: ../configure CFLAGS="-fPIC -m32" CPPFLAGS="-fPIC -m32" LDFLAGS="-m32" --disable-audio --disable-video --disable-video-vulkan --disable-render --disable-filesystem --disable-threads --disable-directx --disable-mmx --disable-3dnow --disable-sse --disable-sse2 --disable-sse3 --disable-cpuinfo --disable-sensor --enable-hidapi - working-directory: SDL/build-linux32 - - run: make -j - working-directory: SDL/build-linux32 - - - run: mkdir -p SDL/build-linuxarm32 - - run: ../configure --host=arm-linux-gnueabihf CFLAGS="-fPIC" CPPFLAGS="-fPIC" --disable-audio --disable-video --disable-video-vulkan --disable-render --disable-filesystem --disable-threads --disable-directx --disable-mmx --disable-3dnow --disable-sse --disable-sse2 --disable-sse3 --disable-cpuinfo --disable-sensor --enable-hidapi - working-directory: SDL/build-linuxarm32 - - run: make -j - working-directory: SDL/build-linuxarm32 - - - run: mkdir -p SDL/build-linuxarm64 - - run: ../configure --host=aarch64-linux-gnu CFLAGS="-fPIC" CPPFLAGS="-fPIC" --disable-audio --disable-video --disable-video-vulkan --disable-render --disable-filesystem --disable-threads --disable-directx --disable-mmx --disable-3dnow --disable-sse --disable-sse2 --disable-sse3 --disable-cpuinfo --disable-sensor --enable-hidapi - working-directory: SDL/build-linuxarm64 - - run: make -j - working-directory: SDL/build-linuxarm64 - - - run: mkdir -p SDL/build-windows32 - - run: ../configure --host=i686-w64-mingw32 --disable-audio --disable-render --disable-power --disable-filesystem --disable-hidapi - working-directory: SDL/build-windows32 - - run: make -j - working-directory: SDL/build-windows32 - - - run: mkdir -p SDL/build-windows64 - - run: ../configure --host=x86_64-w64-mingw32 --disable-audio --disable-render --disable-power --disable-filesystem --disable-hidapi - working-directory: SDL/build-windows64 - - run: make -j - working-directory: SDL/build-windows64 - - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Build with Gradle - run: ./gradlew jnigen jnigenBuild jnigenJarNativesDesktop - name: Upload all output libs uses: actions/upload-artifact@v3 with: From dcc73315f19e1e6d50a894accf64e867cf893d2b Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Wed, 27 Nov 2024 16:09:25 +0000 Subject: [PATCH 07/34] Install Zulu in docker container --- .github/actions/docker/entrypoint.sh | 9 +++++++++ .github/workflows/pushaction.yml | 16 ++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/actions/docker/entrypoint.sh b/.github/actions/docker/entrypoint.sh index 8a66c9d..613d4b7 100755 --- a/.github/actions/docker/entrypoint.sh +++ b/.github/actions/docker/entrypoint.sh @@ -27,6 +27,11 @@ 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 +# add zulu apt repository - https://docs.azul.com/core/install/debian +sudo apt -yq install gnupg ca-certificates curl +curl -s https://repos.azul.com/azul-repo.key | sudo gpg --dearmor -o /usr/share/keyrings/azul.gpg +echo "deb [signed-by=/usr/share/keyrings/azul.gpg] https://repos.azul.com/zulu/deb stable main" | sudo tee /etc/apt/sources.list.d/zulu.list + sudo sed -i 's/deb http/deb [arch=amd64,i386] http/' /etc/apt/sources.list grep "ubuntu.com/ubuntu" /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/ports.list sudo sed -i 's/amd64,i386/armhf,arm64/' /etc/apt/sources.list.d/ports.list @@ -34,6 +39,10 @@ sudo sed -i 's#http://.*/ubuntu#http://ports.ubuntu.com/ubuntu-ports#' /etc/apt/ # Add extra platform architectures sudo dpkg --add-architecture i386; sudo dpkg --add-architecture armhf; sudo dpkg --add-architecture arm64 sudo apt-get update + +# install zulu +sudo apt-get -yq install zulu8-jdk + # Install Windows compilers sudo apt-get -yq install g++-mingw-w64-i686 g++-mingw-w64-x86-64 # Install Linux x86 compilers/libraries diff --git a/.github/workflows/pushaction.yml b/.github/workflows/pushaction.yml index 05d4569..c1111ea 100644 --- a/.github/workflows/pushaction.yml +++ b/.github/workflows/pushaction.yml @@ -61,14 +61,14 @@ jobs: with: submodules: 'recursive' - - name: Set up JDK 8 - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 8 - - - name: Setup Gradle - uses: gradle/gradle-build-action@v2.4.2 +# - name: Set up JDK 8 +# uses: actions/setup-java@v3 +# with: +# distribution: 'zulu' +# java-version: 8 +# +# - name: Setup Gradle +# uses: gradle/gradle-build-action@v2.4.2 - name: Download macOS natives uses: actions/download-artifact@v3 From f00b905868f83a917a426dda9e8a6a77e8221e6b Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Wed, 27 Nov 2024 16:24:06 +0000 Subject: [PATCH 08/34] Fix script mistakes Few mistakes I made while porting over the code --- .github/actions/docker/entrypoint.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/docker/entrypoint.sh b/.github/actions/docker/entrypoint.sh index 613d4b7..9d51ec2 100755 --- a/.github/actions/docker/entrypoint.sh +++ b/.github/actions/docker/entrypoint.sh @@ -76,19 +76,19 @@ cd - mkdir -p SDL/build-linuxarm64 cd SDL/build-linuxarm64 ../configure --host=aarch64-linux-gnu CFLAGS="-fPIC" CPPFLAGS="-fPIC" --disable-audio --disable-video --disable-video-vulkan --disable-render --disable-filesystem --disable-threads --disable-directx --disable-mmx --disable-3dnow --disable-sse --disable-sse2 --disable-sse3 --disable-cpuinfo --disable-sensor --enable-hidapi -run: make -j +make -j cd - mkdir -p SDL/build-windows32 cd SDL/build-windows32 ../configure --host=i686-w64-mingw32 --disable-audio --disable-render --disable-power --disable-filesystem --disable-hidapi -run: make -j +make -j cd - mkdir -p SDL/build-windows64 cd SDL/build-windows64 -./configure --host=x86_64-w64-mingw32 --disable-audio --disable-render --disable-power --disable-filesystem --disable-hidapi -run: make -j +../configure --host=x86_64-w64-mingw32 --disable-audio --disable-render --disable-power --disable-filesystem --disable-hidapi +make -j cd - chmod +x gradlew From 882b29b9bef94fc0ce25a874a44850dc0dabe4d9 Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Wed, 27 Nov 2024 18:37:50 +0000 Subject: [PATCH 09/34] Read and re-add gradle build action Need it for the snapshot and publish outside the docker container --- .github/workflows/pushaction.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pushaction.yml b/.github/workflows/pushaction.yml index c1111ea..9809fbb 100644 --- a/.github/workflows/pushaction.yml +++ b/.github/workflows/pushaction.yml @@ -67,8 +67,6 @@ jobs: # distribution: 'zulu' # java-version: 8 # -# - name: Setup Gradle -# uses: gradle/gradle-build-action@v2.4.2 - name: Download macOS natives uses: actions/download-artifact@v3 @@ -87,6 +85,10 @@ jobs: with: name: output-libs path: build/libs/ + + - name: Setup Gradle + uses: gradle/gradle-build-action@v2.4.2 + - name: Snapshot build run: ./gradlew build From 132db5b31a660b7a92e253065a8ed3085916ad6a Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Wed, 27 Nov 2024 18:52:23 +0000 Subject: [PATCH 10/34] Fix gradle permission denied error in setup gradle setup once docker build finishes Caused by gradle files being left behind by the docker container. Having to install gradle two times for the linux job is a bit unclean, though. Also added no-daemon to the gradle task used because only one gradle command is being executed in the docker container. --- .github/actions/docker/entrypoint.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/actions/docker/entrypoint.sh b/.github/actions/docker/entrypoint.sh index 9d51ec2..20cc3c4 100755 --- a/.github/actions/docker/entrypoint.sh +++ b/.github/actions/docker/entrypoint.sh @@ -92,4 +92,7 @@ make -j cd - chmod +x gradlew -./gradlew jnigen jnigenBuild jnigenJarNativesDesktop \ No newline at end of file +./gradlew jnigen jnigenBuild jnigenJarNativesDesktop --no-daemon + +# clean up gradle files after building +rm -rf ./gradle \ No newline at end of file From 8f7ebcf3280503f6f9bf87c51bb04de1115eceb2 Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Wed, 27 Nov 2024 18:53:23 +0000 Subject: [PATCH 11/34] Exit if cd fails in docker script See https://github.com/koalaman/shellcheck/wiki/SC2164 for why this is good practice. --- .github/actions/docker/entrypoint.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/actions/docker/entrypoint.sh b/.github/actions/docker/entrypoint.sh index 20cc3c4..6361ecc 100755 --- a/.github/actions/docker/entrypoint.sh +++ b/.github/actions/docker/entrypoint.sh @@ -56,40 +56,40 @@ find -type f -path "SDL/*.h" -exec sed -i 's/extern DECLSPEC//' {} \; sed -i 's/#define SDL_DYNAMIC_API 1/#define SDL_DYNAMIC_API 0/' SDL/src/dynapi/SDL_dynapi.h mkdir -p SDL/build-linux64 -cd SDL/build-linux64 +cd SDL/build-linux64 || exit ../configure CFLAGS="-fPIC" CPPFLAGS="-fPIC" --disable-audio --disable-video --disable-video-vulkan --disable-render --disable-filesystem --disable-threads --disable-directx --disable-mmx --disable-3dnow --disable-sse --disable-sse2 --disable-sse3 --disable-cpuinfo --disable-sensor --enable-hidapi make -j -cd - +cd - || exit mkdir -p SDL/build-linux32 -cd SDL/build-linux32 +cd SDL/build-linux32 || exit ../configure CFLAGS="-fPIC -m32" CPPFLAGS="-fPIC -m32" LDFLAGS="-m32" --disable-audio --disable-video --disable-video-vulkan --disable-render --disable-filesystem --disable-threads --disable-directx --disable-mmx --disable-3dnow --disable-sse --disable-sse2 --disable-sse3 --disable-cpuinfo --disable-sensor --enable-hidapi make -j -cd - +cd - || exit mkdir -p SDL/build-linuxarm32 -cd SDL/build-linuxarm32 +cd SDL/build-linuxarm32 || exit ../configure --host=arm-linux-gnueabihf CFLAGS="-fPIC" CPPFLAGS="-fPIC" --disable-audio --disable-video --disable-video-vulkan --disable-render --disable-filesystem --disable-threads --disable-directx --disable-mmx --disable-3dnow --disable-sse --disable-sse2 --disable-sse3 --disable-cpuinfo --disable-sensor --enable-hidapi make -j -cd - +cd - || exit mkdir -p SDL/build-linuxarm64 -cd SDL/build-linuxarm64 +cd SDL/build-linuxarm64 || exit ../configure --host=aarch64-linux-gnu CFLAGS="-fPIC" CPPFLAGS="-fPIC" --disable-audio --disable-video --disable-video-vulkan --disable-render --disable-filesystem --disable-threads --disable-directx --disable-mmx --disable-3dnow --disable-sse --disable-sse2 --disable-sse3 --disable-cpuinfo --disable-sensor --enable-hidapi make -j -cd - +cd - || exit mkdir -p SDL/build-windows32 -cd SDL/build-windows32 +cd SDL/build-windows32 || exit ../configure --host=i686-w64-mingw32 --disable-audio --disable-render --disable-power --disable-filesystem --disable-hidapi make -j -cd - +cd - || exit mkdir -p SDL/build-windows64 -cd SDL/build-windows64 +cd SDL/build-windows64 || exit ../configure --host=x86_64-w64-mingw32 --disable-audio --disable-render --disable-power --disable-filesystem --disable-hidapi make -j -cd - +cd - || exit chmod +x gradlew ./gradlew jnigen jnigenBuild jnigenJarNativesDesktop --no-daemon From 1447c4273ba6426140e1ef8292e1f4c0d78595ef Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Wed, 27 Nov 2024 18:55:59 +0000 Subject: [PATCH 12/34] Use apt-get and sudo consistently Using apt-get because apparently apt does not have a stable CLI interface. While apt install is probably safe, using apt-get will prevent the warnings in the log at least. See https://askubuntu.com/a/990838 As for sudo, while it's not needed sudo also doesn't cause any harm and those commands technically do need root permissions and using sudo makes that clear. --- .github/actions/docker/entrypoint.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/actions/docker/entrypoint.sh b/.github/actions/docker/entrypoint.sh index 6361ecc..7f9d284 100755 --- a/.github/actions/docker/entrypoint.sh +++ b/.github/actions/docker/entrypoint.sh @@ -2,12 +2,12 @@ # 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 +sudo apt-get update +sudo apt-get install -y software-properties-common +sudo add-apt-repository ppa:git-core/ppa -y # install dependencies expected by other steps -apt update -apt install -y git \ +sudo apt-get update +sudo apt-get install -y git \ curl \ ca-certificates \ wget \ @@ -28,7 +28,7 @@ echo "LANGUAGE=en_US.UTF-8" >> $GITHUB_ENV echo "LC_ALL=en_US.UTF-8" >> $GITHUB_ENV # add zulu apt repository - https://docs.azul.com/core/install/debian -sudo apt -yq install gnupg ca-certificates curl +sudo apt-get -yq install gnupg ca-certificates curl curl -s https://repos.azul.com/azul-repo.key | sudo gpg --dearmor -o /usr/share/keyrings/azul.gpg echo "deb [signed-by=/usr/share/keyrings/azul.gpg] https://repos.azul.com/zulu/deb stable main" | sudo tee /etc/apt/sources.list.d/zulu.list From fa7772d56c11946df9cf198ef6b5a21ad1cedc99 Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Wed, 27 Nov 2024 18:57:57 +0000 Subject: [PATCH 13/34] Use headless zulu and remove unnecessary apt install line Seems the zulu package I'm adding pulls in x11 which is unnecessary as we are running this in a headless setting. --- .github/actions/docker/entrypoint.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/docker/entrypoint.sh b/.github/actions/docker/entrypoint.sh index 7f9d284..59689f9 100755 --- a/.github/actions/docker/entrypoint.sh +++ b/.github/actions/docker/entrypoint.sh @@ -20,7 +20,8 @@ maven \ build-essential \ ant \ sudo \ -locales +locales \ +gnupg # 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 @@ -28,7 +29,6 @@ echo "LANGUAGE=en_US.UTF-8" >> $GITHUB_ENV echo "LC_ALL=en_US.UTF-8" >> $GITHUB_ENV # add zulu apt repository - https://docs.azul.com/core/install/debian -sudo apt-get -yq install gnupg ca-certificates curl curl -s https://repos.azul.com/azul-repo.key | sudo gpg --dearmor -o /usr/share/keyrings/azul.gpg echo "deb [signed-by=/usr/share/keyrings/azul.gpg] https://repos.azul.com/zulu/deb stable main" | sudo tee /etc/apt/sources.list.d/zulu.list @@ -41,7 +41,7 @@ sudo dpkg --add-architecture i386; sudo dpkg --add-architecture armhf; sudo dpkg sudo apt-get update # install zulu -sudo apt-get -yq install zulu8-jdk +sudo apt-get -yq install zulu8-jdk-headless # Install Windows compilers sudo apt-get -yq install g++-mingw-w64-i686 g++-mingw-w64-x86-64 From 698ce1ef3c54308bb0f7054fe089eb2c7fc020ab Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Wed, 27 Nov 2024 19:09:16 +0000 Subject: [PATCH 14/34] Actually remove .gradle folder whoops --- .github/actions/docker/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/docker/entrypoint.sh b/.github/actions/docker/entrypoint.sh index 59689f9..e443d28 100755 --- a/.github/actions/docker/entrypoint.sh +++ b/.github/actions/docker/entrypoint.sh @@ -95,4 +95,4 @@ chmod +x gradlew ./gradlew jnigen jnigenBuild jnigenJarNativesDesktop --no-daemon # clean up gradle files after building -rm -rf ./gradle \ No newline at end of file +rm -rf .gradle \ No newline at end of file From 062ca393e06269dc2eab82f3208edeeacdc6730e Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Wed, 27 Nov 2024 19:14:28 +0000 Subject: [PATCH 15/34] Remove usages of sudo in entrypoint.sh Can't use sudo as the start as it needs to be installed first... so I just decided to not use sudo at all if it's not needed. But I'll keep the package install of sudo in case some other command needs it --- .github/actions/docker/entrypoint.sh | 36 ++++++++++++++-------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/actions/docker/entrypoint.sh b/.github/actions/docker/entrypoint.sh index e443d28..06591e0 100755 --- a/.github/actions/docker/entrypoint.sh +++ b/.github/actions/docker/entrypoint.sh @@ -2,12 +2,12 @@ # ubuntu dockerfile is very minimal (only 122 packages are installed) # need to install updated git (from official git ppa) -sudo apt-get update -sudo apt-get install -y software-properties-common -sudo add-apt-repository ppa:git-core/ppa -y +apt-get update +apt-get install -y software-properties-common +add-apt-repository ppa:git-core/ppa -y # install dependencies expected by other steps -sudo apt-get update -sudo apt-get install -y git \ +apt-get update +apt-get install -y git \ curl \ ca-certificates \ wget \ @@ -29,28 +29,28 @@ echo "LANGUAGE=en_US.UTF-8" >> $GITHUB_ENV echo "LC_ALL=en_US.UTF-8" >> $GITHUB_ENV # add zulu apt repository - https://docs.azul.com/core/install/debian -curl -s https://repos.azul.com/azul-repo.key | sudo gpg --dearmor -o /usr/share/keyrings/azul.gpg -echo "deb [signed-by=/usr/share/keyrings/azul.gpg] https://repos.azul.com/zulu/deb stable main" | sudo tee /etc/apt/sources.list.d/zulu.list +curl -s https://repos.azul.com/azul-repo.key | gpg --dearmor -o /usr/share/keyrings/azul.gpg +echo "deb [signed-by=/usr/share/keyrings/azul.gpg] https://repos.azul.com/zulu/deb stable main" | tee /etc/apt/sources.list.d/zulu.list -sudo sed -i 's/deb http/deb [arch=amd64,i386] http/' /etc/apt/sources.list -grep "ubuntu.com/ubuntu" /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/ports.list -sudo sed -i 's/amd64,i386/armhf,arm64/' /etc/apt/sources.list.d/ports.list -sudo sed -i 's#http://.*/ubuntu#http://ports.ubuntu.com/ubuntu-ports#' /etc/apt/sources.list.d/ports.list +sed -i 's/deb http/deb [arch=amd64,i386] http/' /etc/apt/sources.list +grep "ubuntu.com/ubuntu" /etc/apt/sources.list | tee /etc/apt/sources.list.d/ports.list +sed -i 's/amd64,i386/armhf,arm64/' /etc/apt/sources.list.d/ports.list +sed -i 's#http://.*/ubuntu#http://ports.ubuntu.com/ubuntu-ports#' /etc/apt/sources.list.d/ports.list # Add extra platform architectures -sudo dpkg --add-architecture i386; sudo dpkg --add-architecture armhf; sudo dpkg --add-architecture arm64 -sudo apt-get update +dpkg --add-architecture i386; dpkg --add-architecture armhf; dpkg --add-architecture arm64 +apt-get update # install zulu -sudo apt-get -yq install zulu8-jdk-headless +apt-get -yq install zulu8-jdk-headless # Install Windows compilers -sudo apt-get -yq install g++-mingw-w64-i686 g++-mingw-w64-x86-64 +apt-get -yq install g++-mingw-w64-i686 g++-mingw-w64-x86-64 # Install Linux x86 compilers/libraries -sudo apt-get -yq install gcc-multilib g++-multilib linux-libc-dev:i386 +apt-get -yq install gcc-multilib g++-multilib linux-libc-dev:i386 # Install Linux arm32 compilers/libraries -sudo apt-get -yq install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf +apt-get -yq install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf # Install Linux arm64 compilers/libraries -sudo apt-get -yq install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu +apt-get -yq install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu find -type f -path "SDL/*.h" -exec sed -i 's/extern DECLSPEC//' {} \; sed -i 's/#define SDL_DYNAMIC_API 1/#define SDL_DYNAMIC_API 0/' SDL/src/dynapi/SDL_dynapi.h From 9eb4517a642b2a6e87f9079ddc4aae7dfb23393d Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Wed, 27 Nov 2024 19:27:18 +0000 Subject: [PATCH 16/34] Remove openjdk-11-jdk-headless install We're installing zulu, so I don't think this is needed. --- .github/actions/docker/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/docker/entrypoint.sh b/.github/actions/docker/entrypoint.sh index 06591e0..67d7e78 100755 --- a/.github/actions/docker/entrypoint.sh +++ b/.github/actions/docker/entrypoint.sh @@ -15,7 +15,7 @@ bzip2 \ zip \ unzip \ xz-utils \ -openjdk-11-jdk-headless \ +#openjdk-11-jdk-headless \ maven \ build-essential \ ant \ From a7482727633895d7cd07282c16ef6e18618e592c Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Wed, 27 Nov 2024 19:29:57 +0000 Subject: [PATCH 17/34] Move snapshot build inside docker script Hopefully this fixes the "Unable to delete directory build/generated/sources/annotationProcessor/java/main" error Not using a daemon still because it's only two tasks. --- .github/actions/docker/entrypoint.sh | 7 ++++++- .github/workflows/pushaction.yml | 6 ++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/actions/docker/entrypoint.sh b/.github/actions/docker/entrypoint.sh index 67d7e78..3005e8a 100755 --- a/.github/actions/docker/entrypoint.sh +++ b/.github/actions/docker/entrypoint.sh @@ -15,13 +15,15 @@ bzip2 \ zip \ unzip \ xz-utils \ -#openjdk-11-jdk-headless \ maven \ build-essential \ ant \ sudo \ locales \ gnupg +#openjdk-11-jdk-headless \ + + # 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 @@ -94,5 +96,8 @@ cd - || exit chmod +x gradlew ./gradlew jnigen jnigenBuild jnigenJarNativesDesktop --no-daemon +# Build Snapshot +./gradlew build --no-daemon + # clean up gradle files after building rm -rf .gradle \ No newline at end of file diff --git a/.github/workflows/pushaction.yml b/.github/workflows/pushaction.yml index 9809fbb..c92dfc9 100644 --- a/.github/workflows/pushaction.yml +++ b/.github/workflows/pushaction.yml @@ -89,13 +89,11 @@ jobs: - name: Setup Gradle uses: gradle/gradle-build-action@v2.4.2 - - name: Snapshot build - run: - ./gradlew build + # Snapshot was built inside docker container - name: Snapshot deploy if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository_owner == 'libgdx' env: NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} run: - ./gradlew publish + ./gradlew publish --no-daemon From ffe95624d56f4415cd4848b06bae4a0462a490a5 Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Wed, 27 Nov 2024 19:44:01 +0000 Subject: [PATCH 18/34] Read setup java action Probably needed for the deploy to work properly. Honestly maybe I could move the deploy into the docker container but thing is it'd require passing in the secrets --- .github/workflows/pushaction.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pushaction.yml b/.github/workflows/pushaction.yml index c92dfc9..642cd3f 100644 --- a/.github/workflows/pushaction.yml +++ b/.github/workflows/pushaction.yml @@ -61,19 +61,13 @@ jobs: with: submodules: 'recursive' -# - name: Set up JDK 8 -# uses: actions/setup-java@v3 -# with: -# distribution: 'zulu' -# java-version: 8 -# - - name: Download macOS natives uses: actions/download-artifact@v3 with: name: macos-natives path: libs + # Build natives and snapshot in docker container - name: Build in Docker Container uses: ./.github/actions/docker id: docker @@ -86,6 +80,13 @@ jobs: name: output-libs path: build/libs/ + + - name: Set up JDK 8 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 8 + - name: Setup Gradle uses: gradle/gradle-build-action@v2.4.2 From d559e8a168317a619ff62db46a62f6e78dcdc04a Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Wed, 27 Nov 2024 19:46:41 +0000 Subject: [PATCH 19/34] Remove template inputs /outputs from action I used https://docs.github.com/en/actions/sharing-automations/creating-actions/creating-a-docker-container-action#creating-an-action-metadata-file as a starting point, but don't need these inputs or outputs. --- .github/actions/docker/action.yml | 10 ---------- .github/workflows/pushaction.yml | 2 -- 2 files changed, 12 deletions(-) diff --git a/.github/actions/docker/action.yml b/.github/actions/docker/action.yml index 2fefe87..98d6d7e 100644 --- a/.github/actions/docker/action.yml +++ b/.github/actions/docker/action.yml @@ -1,16 +1,6 @@ # action.yml name: 'Build Linux Natives in Docker' description: 'Build Linux Natives in Ubuntu 18.04 docker container' -inputs: - who-to-greet: # id of input - description: 'Who to greet' - required: true - default: 'World' -outputs: - time: # id of output - description: 'The time we greeted you' runs: using: 'docker' image: 'Dockerfile' - args: - - ${{ inputs.who-to-greet }} diff --git a/.github/workflows/pushaction.yml b/.github/workflows/pushaction.yml index 642cd3f..792dc51 100644 --- a/.github/workflows/pushaction.yml +++ b/.github/workflows/pushaction.yml @@ -71,8 +71,6 @@ jobs: - name: Build in Docker Container uses: ./.github/actions/docker id: docker - with: - who-to-greet: 'Mona the Octocat' - name: Upload all output libs uses: actions/upload-artifact@v3 From 65089f7793d87b63ce1a618f0aa03fba4c197c35 Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Wed, 27 Nov 2024 21:05:07 +0000 Subject: [PATCH 20/34] Export language environment variables properly No longer doing it in multiple steps, so adding it to GITHUB_ENV won't really do anything, if it even works in the docker container right now which it probably doesn't. --- .github/actions/docker/entrypoint.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/docker/entrypoint.sh b/.github/actions/docker/entrypoint.sh index 3005e8a..9925bb4 100755 --- a/.github/actions/docker/entrypoint.sh +++ b/.github/actions/docker/entrypoint.sh @@ -26,9 +26,9 @@ gnupg # 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 +export LANG=en_US.UTF-8 +export LANGUAGE=en_US.UTF-8 +export LC_ALL=en_US.UTF-8 # add zulu apt repository - https://docs.azul.com/core/install/debian curl -s https://repos.azul.com/azul-repo.key | gpg --dearmor -o /usr/share/keyrings/azul.gpg From d43b263e56567c43c02e1f8da643b2d6946f7222 Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Wed, 27 Nov 2024 21:14:00 +0000 Subject: [PATCH 21/34] Move maven and ant installation until when zulu is installed Hopefully should prevent java 11 JRE from being installed, as zulu should provide what maven and ant needs. Also specified default find path as recommended by https://github.com/koalaman/shellcheck/wiki/SC2185 --- .github/actions/docker/entrypoint.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/actions/docker/entrypoint.sh b/.github/actions/docker/entrypoint.sh index 9925bb4..0b0ee37 100755 --- a/.github/actions/docker/entrypoint.sh +++ b/.github/actions/docker/entrypoint.sh @@ -15,9 +15,7 @@ bzip2 \ zip \ unzip \ xz-utils \ -maven \ build-essential \ -ant \ sudo \ locales \ gnupg @@ -42,8 +40,8 @@ sed -i 's#http://.*/ubuntu#http://ports.ubuntu.com/ubuntu-ports#' /etc/apt/sourc dpkg --add-architecture i386; dpkg --add-architecture armhf; dpkg --add-architecture arm64 apt-get update -# install zulu -apt-get -yq install zulu8-jdk-headless +# install zulu and java build tools +apt-get -yq install zulu8-jdk-headless maven ant # Install Windows compilers apt-get -yq install g++-mingw-w64-i686 g++-mingw-w64-x86-64 @@ -54,7 +52,7 @@ apt-get -yq install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf binutils-arm # Install Linux arm64 compilers/libraries apt-get -yq install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu -find -type f -path "SDL/*.h" -exec sed -i 's/extern DECLSPEC//' {} \; +find . -type f -path "SDL/*.h" -exec sed -i 's/extern DECLSPEC//' {} \; sed -i 's/#define SDL_DYNAMIC_API 1/#define SDL_DYNAMIC_API 0/' SDL/src/dynapi/SDL_dynapi.h mkdir -p SDL/build-linux64 From 7f31c70d86ad4d885ca3a42a658df59d3a10d172 Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Wed, 27 Nov 2024 21:18:51 +0000 Subject: [PATCH 22/34] Add --quiet to the other apt-get installs The log seems to be massive for the docker step so hopefully this reduces it a bit. --- .github/actions/docker/entrypoint.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/docker/entrypoint.sh b/.github/actions/docker/entrypoint.sh index 0b0ee37..d73e6ac 100755 --- a/.github/actions/docker/entrypoint.sh +++ b/.github/actions/docker/entrypoint.sh @@ -3,11 +3,11 @@ # ubuntu dockerfile is very minimal (only 122 packages are installed) # need to install updated git (from official git ppa) apt-get update -apt-get install -y software-properties-common +apt-get install -yq software-properties-common add-apt-repository ppa:git-core/ppa -y # install dependencies expected by other steps apt-get update -apt-get install -y git \ +apt-get install -yq git \ curl \ ca-certificates \ wget \ @@ -38,7 +38,7 @@ sed -i 's/amd64,i386/armhf,arm64/' /etc/apt/sources.list.d/ports.list sed -i 's#http://.*/ubuntu#http://ports.ubuntu.com/ubuntu-ports#' /etc/apt/sources.list.d/ports.list # Add extra platform architectures dpkg --add-architecture i386; dpkg --add-architecture armhf; dpkg --add-architecture arm64 -apt-get update +apt-get -q update # install zulu and java build tools apt-get -yq install zulu8-jdk-headless maven ant From 629c3516fafbfcc0512fd538cfb6ba2d4af01cb8 Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Wed, 27 Nov 2024 21:22:44 +0000 Subject: [PATCH 23/34] Use latest versions of actions Strangely I got an error while trying to download an artifact for no reason. So maybe updating actions could help? Either way we should be good to do this now that the job is no longer being run in a docker container with glibc 2.17 May need to audit these actions though. --- .github/workflows/pushaction.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pushaction.yml b/.github/workflows/pushaction.yml index 792dc51..e49d75f 100644 --- a/.github/workflows/pushaction.yml +++ b/.github/workflows/pushaction.yml @@ -16,13 +16,13 @@ jobs: submodules: 'recursive' - name: Set up JDK 8 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'zulu' java-version: 8 - name: Setup Gradle - uses: gradle/gradle-build-action@v2.4.2 + uses: gradle/actions/setup-gradle@v4 - run: mkdir -p SDL/build-macosarm64 # No --disable-video for macOS https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c70c727c98b24ad8b44e05285b8785be15062af0 @@ -45,7 +45,7 @@ jobs: - name: Build with Gradle run: ./gradlew jnigen jnigenBuild - name: Upload macOS natives - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: macos-natives path: libs @@ -57,12 +57,12 @@ jobs: ORG_GRADLE_PROJECT_GITHUB_USERNAME: "" ORG_GRADLE_PROJECT_GITHUB_API_TOKEN: "" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: Download macOS natives - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: macos-natives path: libs @@ -73,20 +73,20 @@ jobs: id: docker - name: Upload all output libs - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: output-libs path: build/libs/ - name: Set up JDK 8 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'zulu' java-version: 8 - name: Setup Gradle - uses: gradle/gradle-build-action@v2.4.2 + uses: gradle/setup-gradle@v4 # Snapshot was built inside docker container - name: Snapshot deploy From e828bb299f3509fb1eed9d6903cd417e1a77d24b Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Wed, 27 Nov 2024 21:26:08 +0000 Subject: [PATCH 24/34] Revert update of gradle-build-action The new setup-gradle seems to validate the wrappers, but strangely the wrappers from the sdl submodule fail to verify for some reason. --- .github/workflows/pushaction.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pushaction.yml b/.github/workflows/pushaction.yml index e49d75f..563e307 100644 --- a/.github/workflows/pushaction.yml +++ b/.github/workflows/pushaction.yml @@ -22,7 +22,7 @@ jobs: java-version: 8 - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 + uses: gradle/gradle-build-action@v2.4.2 - run: mkdir -p SDL/build-macosarm64 # No --disable-video for macOS https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c70c727c98b24ad8b44e05285b8785be15062af0 @@ -86,7 +86,7 @@ jobs: java-version: 8 - name: Setup Gradle - uses: gradle/setup-gradle@v4 + uses: gradle/gradle-build-action@v2.4.2 # Snapshot was built inside docker container - name: Snapshot deploy From aaa90ea6f047bc6c6078f9d97b00d923f9906cc1 Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Thu, 28 Nov 2024 12:54:43 +0000 Subject: [PATCH 25/34] Add comments explaining the sources.list edits From TheOfficialGman's response to my questions here: https://github.com/libgdx/Jamepad/pull/23#discussion_r1799541222 --- .github/actions/docker/entrypoint.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/actions/docker/entrypoint.sh b/.github/actions/docker/entrypoint.sh index d73e6ac..633af2c 100755 --- a/.github/actions/docker/entrypoint.sh +++ b/.github/actions/docker/entrypoint.sh @@ -32,9 +32,13 @@ export LC_ALL=en_US.UTF-8 curl -s https://repos.azul.com/azul-repo.key | gpg --dearmor -o /usr/share/keyrings/azul.gpg echo "deb [signed-by=/usr/share/keyrings/azul.gpg] https://repos.azul.com/zulu/deb stable main" | tee /etc/apt/sources.list.d/zulu.list +# default Ubuntu jammy archive doesn't support armhf or arm64 +# so remove those architectures in this list to avoid invalid URL errors sed -i 's/deb http/deb [arch=amd64,i386] http/' /etc/apt/sources.list +# make a copy of sources.list that we'll use for armhf and arm64 ports grep "ubuntu.com/ubuntu" /etc/apt/sources.list | tee /etc/apt/sources.list.d/ports.list sed -i 's/amd64,i386/armhf,arm64/' /etc/apt/sources.list.d/ports.list +# change URLs in ports.list to use Ubuntu ports repo sed -i 's#http://.*/ubuntu#http://ports.ubuntu.com/ubuntu-ports#' /etc/apt/sources.list.d/ports.list # Add extra platform architectures dpkg --add-architecture i386; dpkg --add-architecture armhf; dpkg --add-architecture arm64 From 590481621ed351d6232cb81e2a3d4c60671c72f8 Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Tue, 3 Dec 2024 11:51:03 +0000 Subject: [PATCH 26/34] Use docker script for release action as well I think the main issue is still just verifying that publish works properly. Unfortunately publish still seems to build stuff in the runner even when the build command was run inside the container. Hopefully it doesn't cause any issues though. Also added some comments I missed when porting the action steps to the script --- .github/actions/docker/entrypoint.sh | 4 +- .github/workflows/releaseaction.yml | 119 +++++---------------------- 2 files changed, 23 insertions(+), 100 deletions(-) diff --git a/.github/actions/docker/entrypoint.sh b/.github/actions/docker/entrypoint.sh index 633af2c..7301ec5 100755 --- a/.github/actions/docker/entrypoint.sh +++ b/.github/actions/docker/entrypoint.sh @@ -95,11 +95,13 @@ cd SDL/build-windows64 || exit make -j cd - || exit +# Grant execute permission for gradlew chmod +x gradlew +# Build with Gradle ./gradlew jnigen jnigenBuild jnigenJarNativesDesktop --no-daemon # Build Snapshot ./gradlew build --no-daemon -# clean up gradle files after building +# clean up gradle files before handing back to runner rm -rf .gradle \ No newline at end of file diff --git a/.github/workflows/releaseaction.yml b/.github/workflows/releaseaction.yml index 0587b8d..8e2370e 100644 --- a/.github/workflows/releaseaction.yml +++ b/.github/workflows/releaseaction.yml @@ -55,121 +55,42 @@ jobs: linux: needs: macos - runs-on: ubuntu-20.04 - container: ubuntu:18.04 + runs-on: ubuntu-latest env: ORG_GRADLE_PROJECT_GITHUB_USERNAME: "" ORG_GRADLE_PROJECT_GITHUB_API_TOKEN: "" steps: - - 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 + - uses: actions/checkout@v4 with: submodules: 'recursive' - - name: Set up JDK 8 - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 8 - - - name: Setup Gradle - uses: gradle/gradle-build-action@v2.4.2 - - - 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 - - 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 - run: sudo apt-get -yq install gcc-multilib g++-multilib linux-libc-dev:i386 - - name: Install Linux arm32 compilers/libraries - run: sudo apt-get -yq install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf - - name: Install Linux arm64 compilers/libraries - run: sudo apt-get -yq install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu - name: Download macOS natives - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: macos-natives path: libs - - run: find -type f -name "*.h" -exec sed -i 's/extern DECLSPEC//' {} \; - working-directory: SDL - - run: sed -i 's/#define SDL_DYNAMIC_API 1/#define SDL_DYNAMIC_API 0/' SDL/src/dynapi/SDL_dynapi.h - - - run: mkdir -p SDL/build-linux64 - - run: ../configure CFLAGS="-fPIC" CPPFLAGS="-fPIC" --disable-audio --disable-video --disable-video-vulkan --disable-render --disable-filesystem --disable-threads --disable-directx --disable-mmx --disable-3dnow --disable-sse --disable-sse2 --disable-sse3 --disable-cpuinfo --disable-sensor --enable-hidapi - working-directory: SDL/build-linux64 - - run: make -j - working-directory: SDL/build-linux64 - - - run: mkdir -p SDL/build-linux32 - - run: ../configure CFLAGS="-fPIC -m32" CPPFLAGS="-fPIC -m32" LDFLAGS="-m32" --disable-audio --disable-video --disable-video-vulkan --disable-render --disable-filesystem --disable-threads --disable-directx --disable-mmx --disable-3dnow --disable-sse --disable-sse2 --disable-sse3 --disable-cpuinfo --disable-sensor --enable-hidapi - working-directory: SDL/build-linux32 - - run: make -j - working-directory: SDL/build-linux32 - - - run: mkdir -p SDL/build-linuxarm32 - - run: ../configure --host=arm-linux-gnueabihf CFLAGS="-fPIC" CPPFLAGS="-fPIC" --disable-audio --disable-video --disable-video-vulkan --disable-render --disable-filesystem --disable-threads --disable-directx --disable-mmx --disable-3dnow --disable-sse --disable-sse2 --disable-sse3 --disable-cpuinfo --disable-sensor --enable-hidapi - working-directory: SDL/build-linuxarm32 - - run: make -j - working-directory: SDL/build-linuxarm32 - - - run: mkdir -p SDL/build-linuxarm64 - - run: ../configure --host=aarch64-linux-gnu CFLAGS="-fPIC" CPPFLAGS="-fPIC" --disable-audio --disable-video --disable-video-vulkan --disable-render --disable-filesystem --disable-threads --disable-directx --disable-mmx --disable-3dnow --disable-sse --disable-sse2 --disable-sse3 --disable-cpuinfo --disable-sensor --enable-hidapi - working-directory: SDL/build-linuxarm64 - - run: make -j - working-directory: SDL/build-linuxarm64 - - - run: mkdir -p SDL/build-windows32 - - run: ../configure --host=i686-w64-mingw32 --disable-audio --disable-render --disable-power --disable-filesystem --disable-hidapi - working-directory: SDL/build-windows32 - - run: make -j - working-directory: SDL/build-windows32 + # Build natives and snapshot in docker container + - name: Build in Docker Container + uses: ./.github/actions/docker + id: docker - - run: mkdir -p SDL/build-windows64 - - run: ../configure --host=x86_64-w64-mingw32 --disable-audio --disable-render --disable-power --disable-filesystem --disable-hidapi - working-directory: SDL/build-windows64 - - run: make -j - working-directory: SDL/build-windows64 - - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Build with Gradle - run: ./gradlew jnigen jnigenBuild jnigenJarNativesDesktop - name: Upload all output libs - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: output-libs path: build/libs/ + + + - name: Set up JDK 8 + uses: actions/setup-java@v4 + with: + distribution: 'zulu' + java-version: 8 + + - name: Setup Gradle + uses: gradle/gradle-build-action@v2.4.2 + - name: Import GPG key id: import_gpg uses: crazy-max/ghaction-import-gpg@v5 @@ -181,4 +102,4 @@ jobs: NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} run: - ./gradlew build publish -PRELEASE -Psigning.gnupg.keyId=${{ secrets.GPG_KEYID }} -Psigning.gnupg.passphrase=${{ secrets.GPG_PASSPHRASE }} -Psigning.gnupg.keyName=${{ secrets.GPG_KEYID }} + ./gradlew publish -PRELEASE -Psigning.gnupg.keyId=${{ secrets.GPG_KEYID }} -Psigning.gnupg.passphrase=${{ secrets.GPG_PASSPHRASE }} -Psigning.gnupg.keyName=${{ secrets.GPG_KEYID }} --no-daemon From c553462050423eb266db8f18eca5db601e42bcdc Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Tue, 3 Dec 2024 11:57:46 +0000 Subject: [PATCH 27/34] Use -quiet for all apt-get update usages and use consistent option ordering for apt-get apt-get update is pretty noisy by default as there are a lot of lines for it reading the database. This should make it a bit quieter I also noticed in the later part of the script -yq was before the install/update command so I made that consistent as well. --- .github/actions/docker/entrypoint.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/actions/docker/entrypoint.sh b/.github/actions/docker/entrypoint.sh index 7301ec5..a47cf2f 100755 --- a/.github/actions/docker/entrypoint.sh +++ b/.github/actions/docker/entrypoint.sh @@ -2,12 +2,12 @@ # ubuntu dockerfile is very minimal (only 122 packages are installed) # need to install updated git (from official git ppa) -apt-get update -apt-get install -yq software-properties-common -add-apt-repository ppa:git-core/ppa -y +apt-get -q update +apt-get -yq install software-properties-common +add-apt-repository -y ppa:git-core/ppa # install dependencies expected by other steps -apt-get update -apt-get install -yq git \ +apt-get -q update +apt-get -yq install git \ curl \ ca-certificates \ wget \ From 02e82bf656e06fa5e99673420a3fad38f3488b33 Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Tue, 3 Dec 2024 12:08:29 +0000 Subject: [PATCH 28/34] Use if condition for setting up JDK and Gradle in push action If not deploying the snapshot, there is no benefit to setting up JDK or Gradle, so we might as well skip those steps too to save a bit of time. --- .github/workflows/pushaction.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pushaction.yml b/.github/workflows/pushaction.yml index 563e307..3418635 100644 --- a/.github/workflows/pushaction.yml +++ b/.github/workflows/pushaction.yml @@ -80,12 +80,14 @@ jobs: - name: Set up JDK 8 + if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository_owner == 'libgdx' uses: actions/setup-java@v4 with: distribution: 'zulu' java-version: 8 - name: Setup Gradle + if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository_owner == 'libgdx' uses: gradle/gradle-build-action@v2.4.2 # Snapshot was built inside docker container From 768cf309e0f01a9a6a21eeb1dcc27812df835122 Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Tue, 3 Dec 2024 12:22:28 +0000 Subject: [PATCH 29/34] Build snapshot/release in runner instead of in container When I inspected the natives of a build from my branch and compared it to master, I noticed that while the master output-libs artifact only had one jar file in it (jamepad-2.30.0.0-SNAPSHOT-natives-desktop.jar) mine had 4 files in them (jamepad-2.30.0.0-SNAPSHOT.jar alongside other files with "workspace" at the start instead of jamepad for some reason, including the one with natives-desktop at the end). I figure this is because the build was being done before the deploy. As for the workspace name, it may be to do with how the container is configured... --- .github/actions/docker/entrypoint.sh | 3 --- .github/workflows/pushaction.yml | 6 +++--- .github/workflows/releaseaction.yml | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/actions/docker/entrypoint.sh b/.github/actions/docker/entrypoint.sh index a47cf2f..e6735f6 100755 --- a/.github/actions/docker/entrypoint.sh +++ b/.github/actions/docker/entrypoint.sh @@ -100,8 +100,5 @@ chmod +x gradlew # Build with Gradle ./gradlew jnigen jnigenBuild jnigenJarNativesDesktop --no-daemon -# Build Snapshot -./gradlew build --no-daemon - # clean up gradle files before handing back to runner rm -rf .gradle \ No newline at end of file diff --git a/.github/workflows/pushaction.yml b/.github/workflows/pushaction.yml index 3418635..b00c8f7 100644 --- a/.github/workflows/pushaction.yml +++ b/.github/workflows/pushaction.yml @@ -67,7 +67,7 @@ jobs: name: macos-natives path: libs - # Build natives and snapshot in docker container + # Build natives in docker container - name: Build in Docker Container uses: ./.github/actions/docker id: docker @@ -91,10 +91,10 @@ jobs: uses: gradle/gradle-build-action@v2.4.2 # Snapshot was built inside docker container - - name: Snapshot deploy + - name: Snapshot build deploy if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository_owner == 'libgdx' env: NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} run: - ./gradlew publish --no-daemon + ./gradlew build publish --no-daemon diff --git a/.github/workflows/releaseaction.yml b/.github/workflows/releaseaction.yml index 8e2370e..5d7c321 100644 --- a/.github/workflows/releaseaction.yml +++ b/.github/workflows/releaseaction.yml @@ -70,7 +70,7 @@ jobs: name: macos-natives path: libs - # Build natives and snapshot in docker container + # Build natives in docker container - name: Build in Docker Container uses: ./.github/actions/docker id: docker @@ -102,4 +102,4 @@ jobs: NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} run: - ./gradlew publish -PRELEASE -Psigning.gnupg.keyId=${{ secrets.GPG_KEYID }} -Psigning.gnupg.passphrase=${{ secrets.GPG_PASSPHRASE }} -Psigning.gnupg.keyName=${{ secrets.GPG_KEYID }} --no-daemon + ./gradlew build publish -PRELEASE -Psigning.gnupg.keyId=${{ secrets.GPG_KEYID }} -Psigning.gnupg.passphrase=${{ secrets.GPG_PASSPHRASE }} -Psigning.gnupg.keyName=${{ secrets.GPG_KEYID }} --no-daemon From 6e9c836439e5bf9d8f40e03e93a047f28159773d Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Tue, 3 Dec 2024 12:28:12 +0000 Subject: [PATCH 30/34] Disable daemon for macos build as well It's only one gradle command being run in the job, so the daemon probably isn't needed. --- .github/workflows/pushaction.yml | 3 ++- .github/workflows/releaseaction.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pushaction.yml b/.github/workflows/pushaction.yml index b00c8f7..eb3da32 100644 --- a/.github/workflows/pushaction.yml +++ b/.github/workflows/pushaction.yml @@ -43,7 +43,7 @@ jobs: - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Build with Gradle - run: ./gradlew jnigen jnigenBuild + run: ./gradlew jnigen jnigenBuild --no-daemon - name: Upload macOS natives uses: actions/upload-artifact@v4 with: @@ -97,4 +97,5 @@ jobs: NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} run: + # Execute permission was granted in the docker script ./gradlew build publish --no-daemon diff --git a/.github/workflows/releaseaction.yml b/.github/workflows/releaseaction.yml index 5d7c321..e056ddc 100644 --- a/.github/workflows/releaseaction.yml +++ b/.github/workflows/releaseaction.yml @@ -46,7 +46,7 @@ jobs: - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Build with Gradle - run: ./gradlew jnigen jnigenBuild + run: ./gradlew jnigen jnigenBuild --no-daemon - name: Upload macOS natives uses: actions/upload-artifact@v3 with: @@ -102,4 +102,5 @@ jobs: NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} run: + # Execute permission was granted in the docker script ./gradlew build publish -PRELEASE -Psigning.gnupg.keyId=${{ secrets.GPG_KEYID }} -Psigning.gnupg.passphrase=${{ secrets.GPG_PASSPHRASE }} -Psigning.gnupg.keyName=${{ secrets.GPG_KEYID }} --no-daemon From 8bcc33d09a022ff26e9abbaa718660ac9e5388f8 Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:22:43 +0000 Subject: [PATCH 31/34] Revert action version updates but remove unsecure node env variable Main libgdx repo uses v3 of setup-java and upload/download artifact so I thought it didn't make sense to use v4 of those here. Similarly it uses ubuntu 20.04. Keeping checkout at v4 because it is currently being used in this repo. --- .github/workflows/pushaction.yml | 21 +++++++-------------- .github/workflows/releaseaction.yml | 15 +++++---------- 2 files changed, 12 insertions(+), 24 deletions(-) diff --git a/.github/workflows/pushaction.yml b/.github/workflows/pushaction.yml index eb3da32..81e0de7 100644 --- a/.github/workflows/pushaction.yml +++ b/.github/workflows/pushaction.yml @@ -3,9 +3,6 @@ name: Compile and deploy snapshot artifacts on: [push, pull_request] # Don't worry, the actual deployment is guarded with an "if" and only done on push to master env: GRADLE_USER_HOME: .gradle - # Needed in order to use Node 16. Node 20 does not work with glibc 2.17 - # See https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/ - ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true jobs: macos: @@ -16,7 +13,7 @@ jobs: submodules: 'recursive' - name: Set up JDK 8 - uses: actions/setup-java@v4 + uses: actions/setup-java@v3 with: distribution: 'zulu' java-version: 8 @@ -45,7 +42,7 @@ jobs: - name: Build with Gradle run: ./gradlew jnigen jnigenBuild --no-daemon - name: Upload macOS natives - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: macos-natives path: libs @@ -57,31 +54,28 @@ jobs: ORG_GRADLE_PROJECT_GITHUB_USERNAME: "" ORG_GRADLE_PROJECT_GITHUB_API_TOKEN: "" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 with: submodules: 'recursive' - name: Download macOS natives - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v3 with: name: macos-natives path: libs - # Build natives in docker container - - name: Build in Docker Container + - name: Build natives in Docker Container uses: ./.github/actions/docker id: docker - - name: Upload all output libs - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: output-libs path: build/libs/ - - name: Set up JDK 8 if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository_owner == 'libgdx' - uses: actions/setup-java@v4 + uses: actions/setup-java@v3 with: distribution: 'zulu' java-version: 8 @@ -90,7 +84,6 @@ jobs: if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository_owner == 'libgdx' uses: gradle/gradle-build-action@v2.4.2 - # Snapshot was built inside docker container - name: Snapshot build deploy if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository_owner == 'libgdx' env: diff --git a/.github/workflows/releaseaction.yml b/.github/workflows/releaseaction.yml index e056ddc..4c57021 100644 --- a/.github/workflows/releaseaction.yml +++ b/.github/workflows/releaseaction.yml @@ -6,9 +6,6 @@ on: env: GRADLE_USER_HOME: .gradle - # Needed in order to use Node 16. Node 20 does not work with glibc 2.17 - # See https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/ - ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true jobs: macos: @@ -55,17 +52,17 @@ jobs: linux: needs: macos - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 env: ORG_GRADLE_PROJECT_GITHUB_USERNAME: "" ORG_GRADLE_PROJECT_GITHUB_API_TOKEN: "" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 with: submodules: 'recursive' - name: Download macOS natives - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v3 with: name: macos-natives path: libs @@ -74,16 +71,14 @@ jobs: - name: Build in Docker Container uses: ./.github/actions/docker id: docker - - name: Upload all output libs - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: output-libs path: build/libs/ - - name: Set up JDK 8 - uses: actions/setup-java@v4 + uses: actions/setup-java@v3 with: distribution: 'zulu' java-version: 8 From ea7fc4663d81f3cb988635a9155fc6b6c287fafa Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:35:19 +0000 Subject: [PATCH 32/34] Fix jar file being workspace-x.x.x.x-SNAPSHOT-natives-desktop.jar instead of Jamepad-x.x.x.x-SNAPSHOT-natives-desktop.jar --- .github/actions/docker/entrypoint.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/actions/docker/entrypoint.sh b/.github/actions/docker/entrypoint.sh index e6735f6..b6907cf 100755 --- a/.github/actions/docker/entrypoint.sh +++ b/.github/actions/docker/entrypoint.sh @@ -18,7 +18,7 @@ xz-utils \ build-essential \ sudo \ locales \ -gnupg +gnupg rename #openjdk-11-jdk-headless \ @@ -100,5 +100,9 @@ chmod +x gradlew # Build with Gradle ./gradlew jnigen jnigenBuild jnigenJarNativesDesktop --no-daemon +# fix built jars being of the form workspace-*.jar instead of Jamepad-*.jar +# due to the directory being mounted to /github/workspace on the container +rename 's/workspace/Jamepad' build/libs/* + # clean up gradle files before handing back to runner rm -rf .gradle \ No newline at end of file From 98d70a697764686604271386e3cd511c97f7adda Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:40:41 +0000 Subject: [PATCH 33/34] whoops --- .github/workflows/pushaction.yml | 2 +- .github/workflows/releaseaction.yml | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pushaction.yml b/.github/workflows/pushaction.yml index 81e0de7..1256d42 100644 --- a/.github/workflows/pushaction.yml +++ b/.github/workflows/pushaction.yml @@ -54,7 +54,7 @@ jobs: ORG_GRADLE_PROJECT_GITHUB_USERNAME: "" ORG_GRADLE_PROJECT_GITHUB_API_TOKEN: "" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' diff --git a/.github/workflows/releaseaction.yml b/.github/workflows/releaseaction.yml index 4c57021..d66d6c3 100644 --- a/.github/workflows/releaseaction.yml +++ b/.github/workflows/releaseaction.yml @@ -57,7 +57,7 @@ jobs: ORG_GRADLE_PROJECT_GITHUB_USERNAME: "" ORG_GRADLE_PROJECT_GITHUB_API_TOKEN: "" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' @@ -67,8 +67,7 @@ jobs: name: macos-natives path: libs - # Build natives in docker container - - name: Build in Docker Container + - name: Build natives in Docker Container uses: ./.github/actions/docker id: docker - name: Upload all output libs From a17591d0803b3cf23e79bb6678589045778f8188 Mon Sep 17 00:00:00 2001 From: SonicGDX <114670430+SonicGDX@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:54:27 +0000 Subject: [PATCH 34/34] Fix "Substitution replacement not terminated at (user-supplied code)" --- .github/actions/docker/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/docker/entrypoint.sh b/.github/actions/docker/entrypoint.sh index b6907cf..309f02d 100755 --- a/.github/actions/docker/entrypoint.sh +++ b/.github/actions/docker/entrypoint.sh @@ -102,7 +102,7 @@ chmod +x gradlew # fix built jars being of the form workspace-*.jar instead of Jamepad-*.jar # due to the directory being mounted to /github/workspace on the container -rename 's/workspace/Jamepad' build/libs/* +rename 's/workspace/Jamepad/' build/libs/* # clean up gradle files before handing back to runner rm -rf .gradle \ No newline at end of file