forked from libgdx/libgdx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move build from workflow job to container action
- Used apt-get instead of apt because using apt in a script gives the warning message "apt does not have a stable interface". - Removed usages of sudo just to be consistent (I can't always use sudo because initially sudo isn't installed) - Added --no-daemon to gradle command because only one gradle command is being run so the daemon isn't necessary. - Added --quiet to apt-get usages to cut down unuseful lines in logs Having the action be in a separate actions folder may not be desirable, in which case I can probably move the action into the workflow folder somewhere but I'm not sure where. Copy my docker action from my similar PR in Jamepad Copied from libgdx/Jamepad#34 Similar structure should work, but will of course need to adjust to suit the libgdx action
- Loading branch information
Showing
4 changed files
with
62 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# action.yml | ||
name: 'Build Linux Natives in Docker Container' | ||
description: 'Build Linux Natives in Ubuntu 18.04 docker container' | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/sh -l | ||
|
||
# ubuntu dockerfile is very minimal (only 122 packages are installed) | ||
# need to install updated git (from official git ppa) | ||
apt-get update | ||
apt-get -yq install software-properties-common | ||
add-apt-repository ppa:git-core/ppa -y | ||
# install dependencies expected by other steps | ||
apt-get -q update | ||
apt-get install -yq git \ | ||
curl \ | ||
ca-certificates \ | ||
wget \ | ||
bzip2 \ | ||
zip \ | ||
unzip \ | ||
xz-utils \ | ||
sudo locales | ||
|
||
# set Locale to en_US.UTF-8 (avoids hang during compilation) | ||
locale-gen en_US.UTF-8 | ||
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 | ||
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 | ||
apt-get -q update | ||
# install zulu JDK and Java build tools | ||
apt-get -yq install zulu17-jdk-headless maven ant | ||
|
||
# Install cross-compilation toolchains | ||
apt-get install -yq --force-yes gcc g++ | ||
apt-get install -yq --force-yes gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libc6-dev-arm64-cross | ||
apt-get install -yq --force-yes gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libc6-dev-armhf-cross | ||
|
||
# Build Linux natives | ||
./gradlew jniGen jnigenBuildLinux64 jnigenBuildLinuxARM jnigenBuildLinuxARM64 --no-daemon | ||
|
||
# Pack artifacts | ||
find . -name "*.a" -o -name "*.dll" -o -name "*.dylib" -o -name "*.so" | grep "libs" > native-files-list | ||
zip natives-linux -@ < native-files-list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters