Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Dockerfile and script for building in container instead of running the entire job in the container #34

Open
wants to merge 30 commits into
base: master
Choose a base branch
from

Commits on Nov 25, 2024

  1. Configuration menu
    Copy the full SHA
    3f4b0e6 View commit details
    Browse the repository at this point in the history

Commits on Nov 27, 2024

  1. test ls

    SonicGDX committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    9c02c0e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3349e52 View commit details
    Browse the repository at this point in the history
  3. 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
    SonicGDX committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    859393e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ae551ff View commit details
    Browse the repository at this point in the history
  5. Add most of the rest of the job to the docker script

    Used cd in a weird way but if it works it works
    SonicGDX committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    d19d06b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    dcc7331 View commit details
    Browse the repository at this point in the history
  7. Fix script mistakes

    Few mistakes I made while porting over the code
    SonicGDX committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    f00b905 View commit details
    Browse the repository at this point in the history
  8. Read and re-add gradle build action

    Need it for the snapshot and publish outside the docker container
    SonicGDX committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    882b29b View commit details
    Browse the repository at this point in the history
  9. 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.
    SonicGDX committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    132db5b View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    8f7ebcf View commit details
    Browse the repository at this point in the history
  11. 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.
    SonicGDX committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    1447c42 View commit details
    Browse the repository at this point in the history
  12. 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.
    SonicGDX committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    fa7772d View commit details
    Browse the repository at this point in the history
  13. Actually remove .gradle folder

    whoops
    SonicGDX committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    698ce1e View commit details
    Browse the repository at this point in the history
  14. 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
    SonicGDX committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    062ca39 View commit details
    Browse the repository at this point in the history
  15. Remove openjdk-11-jdk-headless install

    We're installing zulu, so I don't think this is needed.
    SonicGDX committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    9eb4517 View commit details
    Browse the repository at this point in the history
  16. 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.
    SonicGDX committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    a748272 View commit details
    Browse the repository at this point in the history
  17. 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
    SonicGDX committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    ffe9562 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    d559e8a View commit details
    Browse the repository at this point in the history
  19. 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.
    SonicGDX committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    65089f7 View commit details
    Browse the repository at this point in the history
  20. 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
    SonicGDX committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    d43b263 View commit details
    Browse the repository at this point in the history
  21. 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.
    SonicGDX committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    7f31c70 View commit details
    Browse the repository at this point in the history
  22. 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.
    SonicGDX committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    629c351 View commit details
    Browse the repository at this point in the history
  23. 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.
    SonicGDX committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    e828bb2 View commit details
    Browse the repository at this point in the history

Commits on Nov 28, 2024

  1. Add comments explaining the sources.list edits

    From TheOfficialGman's response to my questions here:
    libgdx#23 (comment)
    SonicGDX committed Nov 28, 2024
    Configuration menu
    Copy the full SHA
    aaa90ea View commit details
    Browse the repository at this point in the history

Commits on Dec 3, 2024

  1. 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
    SonicGDX committed Dec 3, 2024
    Configuration menu
    Copy the full SHA
    5904816 View commit details
    Browse the repository at this point in the history
  2. Use -quiet for all apt-get update usages and use consistent option or…

    …dering 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.
    SonicGDX committed Dec 3, 2024
    Configuration menu
    Copy the full SHA
    c553462 View commit details
    Browse the repository at this point in the history
  3. 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.
    SonicGDX committed Dec 3, 2024
    Configuration menu
    Copy the full SHA
    02e82bf View commit details
    Browse the repository at this point in the history
  4. 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...
    SonicGDX committed Dec 3, 2024
    Configuration menu
    Copy the full SHA
    768cf30 View commit details
    Browse the repository at this point in the history
  5. 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.
    SonicGDX committed Dec 3, 2024
    Configuration menu
    Copy the full SHA
    6e9c836 View commit details
    Browse the repository at this point in the history