builds godot
include --main-pack && make PKGBUILD && create release action
| -rw-r--r-- | .github/actions/build-upload-image/action.yml | 4 | ||||
| -rw-r--r-- | .github/actions/get-version/action.yml | 9 | ||||
| -rw-r--r-- | .github/actions/release/action.yml | 55 | ||||
| -rw-r--r-- | .github/workflows/reusable-build.yml | 10 | ||||
| -rw-r--r-- | PKGBUILD | 30 | ||||
| -rw-r--r-- | patches/no-arg-handling.patch | 68 |
6 files changed, 152 insertions, 24 deletions
diff --git a/.github/actions/build-upload-image/action.yml b/.github/actions/build-upload-image/action.yml index 769b96a..fcd7f77 100644 --- a/.github/actions/build-upload-image/action.yml +++ b/.github/actions/build-upload-image/action.yml @@ -44,9 +44,7 @@ runs: context: . file: Dockerfile push: true - tags: ghcr.io/${{ github.repository_owner }}/${{ inputs.name }}:${{ env.version-name }}${{ env.tag }} + tags: ghcr.io/${{ github.repository_owner }}/${{ inputs.name }}:${{ env.release-name }} build-args: | GODOT_VERSION=${{ env.version-name }} RELEASE_NAME=${{ env.release }} - env: - tag: ${{ env.release != 'stable' && format('.{0}', env.release) || '' }} diff --git a/.github/actions/get-version/action.yml b/.github/actions/get-version/action.yml index 1b8297a..ba8682e 100644 --- a/.github/actions/get-version/action.yml +++ b/.github/actions/get-version/action.yml @@ -21,7 +21,14 @@ runs: echo 'print(status)' >> version.py echo "release=$(python version.py)" >> $GITHUB_ENV release=$(python version.py) - echo "#### ${version}.${release} :rocket:" >> $GITHUB_STEP_SUMMARY + + release_name="$version" + [[ $release == 'stable' ]] || release_name+=".${release}" + echo "release-name=$release_name" >> $GITHUB_ENV + + prerelease="true" + [[ $release == 'stable' ]] && prerelease="false" + echo "prerelease=${prerelease}" >> $GITHUB_ENV shell: bash - name: Post get version diff --git a/.github/actions/release/action.yml b/.github/actions/release/action.yml new file mode 100644 index 0000000..da50012 --- /dev/null +++ b/.github/actions/release/action.yml @@ -0,0 +1,55 @@ +name: Build upload docker image +description: Build and upload docker image to ghcr.io + +inputs: + github-token: + required: true + description: GitHub token + name: + required: false + description: Name of the package + default: godot-2d + +runs: + using: "composite" + steps: + - name: Get version + uses: bend-n/godot-builds/.github/actions/get-version@main + + - name: Get templates + uses: actions/download-artifact@v3 + with: + name: templates + + - name: Get headless + uses: actions/download-artifact@v3 + with: + name: server-tools-release + + - name: Get editor + uses: actions/download-artifact@v3 + with: + name: x11-tools-release + + - name: Compress + run: | + mv godot.x11.opt.tools.64 ${{ env.fstart }}_x11.64 + mv godot_server.x11.opt.tools.64 ${{ env.fstart }}_linux_headless.64 + mv templates.tpz ${{ env.fstart }}_export_templates.tpz + shell: bash + env: + fstart: ${{ inputs.name }}_v${{ env.version-name }} + + - name: Release + uses: softprops/action-gh-release@v1 + with: + body: "### ${{ env.release-name}} :rocket:" + tag_name: ${{ env.release-name }} + files: | + ${{ env.fstart }}_export_templates.tpz + ${{ env.fstart }}_x11.64 + ${{ env.fstart }}_linux_headless.64 + token: ${{ inputs.github-token }} + prerelease: ${{ env.prerelease }} + env: + fstart: ${{ inputs.name }}_v${{ env.version-name }} diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml index 93773ad..2c0a0db 100644 --- a/.github/workflows/reusable-build.yml +++ b/.github/workflows/reusable-build.yml @@ -255,3 +255,13 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} name: ${{ inputs.name }} + + release: + name: Create/update a release + runs-on: ubuntu-latest + needs: [tools, templates] + steps: + - uses: bend-n/godot-builds/.github/actions/release@main + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + name: ${{ inputs.name }} diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..dd38f8b --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,30 @@ +# Maintainer: bendn <[email protected]> +# shellcheck disable=SC2148,SC2034 + +pkgname="godot2d" +pkgver='3.5.stable' +pkgrel=1 +pkgdesc="godot builds without all the 3d stuff." +arch=('any') +url="https://github.com/bend-n/godot-builds" +license=('MIT') +depends=(libxcursor libxinerama libxi libxrandr libglvnd) +makedepends=('github-cli' 'git') +md5sums=() +source=() +provides=('godot2d') + +_repo="github.com/bend-n/godot-builds" + +_get() { + gh run download "$1" -n "$2" -R "$_repo" +} + +package() { + id=$(gh workflow view build-3.5-2d.yml | sed '6q;d' | awk -F'\t' '{print $8}') + _get "$id" "x11-tools-release" & + _get "$id" "templates" + install -Dm755 godot.x11.opt.tools.64 "$pkgdir/usr/bin/godot2d" + install -Dm755 "$pkgdir/usr/share/godot/templates/${pkgver}.stable" + unzip -of templates.tpz -d "$pkgdir/usr/share/godot/templates/${pkgver}.stable" +} diff --git a/patches/no-arg-handling.patch b/patches/no-arg-handling.patch index 783b043..1323545 100644 --- a/patches/no-arg-handling.patch +++ b/patches/no-arg-handling.patch @@ -1,5 +1,5 @@ diff --git a/main/main.cpp b/main/main.cpp -index 37ef4332..f4baf553 100644 +index 37ef4332..ecc30d7e 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -128,7 +128,9 @@ static int audio_driver_idx = -1; @@ -40,7 +40,7 @@ index 37ef4332..f4baf553 100644 /* Engine initialization * -@@ -493,9 +495,8 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph +@@ -493,13 +495,22 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph #endif List<String>::Element *N = I->next(); @@ -51,7 +51,22 @@ index 37ef4332..f4baf553 100644 show_help = true; exit_code = ERR_HELP; // Hack to force an early exit in `main()` with a success code. goto error; -@@ -737,7 +738,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph +- ++#else ++ if (I->get() == "--main-pack") { // needed for JS bindings ++ if (I->next()) { ++ main_pack = I->next()->get(); ++ N = I->next()->next(); ++ } else { ++ OS::get_singleton()->print("Missing path to main pack file, aborting.\n"); ++ goto error; ++ }; ++#endif ++#ifdef TOOLS_ENABLED + } else if (I->get() == "--version") { + print_line(get_full_version_string()); + exit_code = ERR_HELP; // Hack to force an early exit in `main()` with a success code. +@@ -737,7 +748,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph OS::get_singleton()->print("Missing render thread mode argument, aborting.\n"); goto error; } @@ -59,7 +74,7 @@ index 37ef4332..f4baf553 100644 } else if (I->get() == "-e" || I->get() == "--editor") { // starts editor editor = true; -@@ -773,7 +773,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph +@@ -773,7 +783,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph editor = true; main_args.push_back(I->get()); @@ -67,7 +82,7 @@ index 37ef4332..f4baf553 100644 } else if (I->get() == "--path") { // set path of project to start or edit if (I->next()) { -@@ -806,9 +805,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph +@@ -806,9 +815,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } else { project_path = path; } @@ -77,18 +92,31 @@ index 37ef4332..f4baf553 100644 } else if (I->get() == "-b" || I->get() == "--breakpoints") { // add breakpoints if (I->next()) { -@@ -902,6 +899,10 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph - } +@@ -840,15 +847,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph + goto error; + } - I = N; -+#else -+ main_args.push_back(I->get()); -+ I = N; +- } else if (I->get() == "--main-pack") { +- if (I->next()) { +- main_pack = I->next()->get(); +- N = I->next()->next(); +- } else { +- OS::get_singleton()->print("Missing path to main pack file, aborting.\n"); +- goto error; +- }; +- + } else if (I->get() == "-d" || I->get() == "--debug") { + debug_mode = "local"; + OS::get_singleton()->_debug_stdout = true; +@@ -897,6 +895,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph + OS::get_singleton()->disable_crash_handler(); + } else if (I->get() == "--skip-breakpoints") { + skip_breakpoints = true; +#endif - } - - #ifdef TOOLS_ENABLED -@@ -909,7 +910,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph + } else { + main_args.push_back(I->get()); + } +@@ -909,7 +908,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph OS::get_singleton()->print("Error: Command line arguments implied opening both editor and project manager, which is not possible. Aborting.\n"); goto error; } @@ -96,7 +124,7 @@ index 37ef4332..f4baf553 100644 // Network file system needs to be configured before globals, since globals are based on the // 'project.godot' file which will only be available through the network if this is enabled -@@ -932,7 +932,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph +@@ -932,7 +930,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph FileAccess::make_default<FileAccessNetwork>(FileAccess::ACCESS_RESOURCES); } @@ -105,7 +133,7 @@ index 37ef4332..f4baf553 100644 if (globals->setup(project_path, main_pack, upwards, editor) == OK) { #ifdef TOOLS_ENABLED found_project = true; -@@ -1001,12 +1001,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph +@@ -1001,12 +999,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph if (editor) { packed_data->set_disabled(true); globals->set_disable_feature_overrides(true); @@ -118,7 +146,7 @@ index 37ef4332..f4baf553 100644 Engine::get_singleton()->set_editor_hint(true); main_args.push_back("--editor"); if (!init_windowed) { -@@ -1281,7 +1275,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph +@@ -1281,7 +1273,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph return OK; error: @@ -126,7 +154,7 @@ index 37ef4332..f4baf553 100644 video_driver = ""; audio_driver = ""; tablet_driver = ""; -@@ -1290,9 +1283,11 @@ error: +@@ -1290,9 +1281,11 @@ error: args.clear(); main_args.clear(); @@ -138,7 +166,7 @@ index 37ef4332..f4baf553 100644 if (performance) { memdelete(performance); -@@ -1338,7 +1333,7 @@ error: +@@ -1338,7 +1331,7 @@ error: Error Main::setup2(Thread::ID p_main_tid_override) { // Print engine name and version |