From 721f2e82979e7b4af8d96569e583f4461f2174d9 Mon Sep 17 00:00:00 2001 From: LUCASTUCIOUS Date: Thu, 25 Jul 2024 22:12:08 +0200 Subject: [PATCH] runner test --- .forgejo/actions/build-godot.yaml | 35 +++++++++++++++++++++++++++ .forgejo/actions/entrypoint.sh | 39 +++++++++++++++++++++++++++++++ .forgejo/workflows/build.yaml | 39 +++++++++++++++++++++++++++++++ 3 files changed, 113 insertions(+) create mode 100644 .forgejo/actions/build-godot.yaml create mode 100644 .forgejo/actions/entrypoint.sh create mode 100644 .forgejo/workflows/build.yaml diff --git a/.forgejo/actions/build-godot.yaml b/.forgejo/actions/build-godot.yaml new file mode 100644 index 0000000..1339bd0 --- /dev/null +++ b/.forgejo/actions/build-godot.yaml @@ -0,0 +1,35 @@ +name: "Build Godot" +description: "Build a Godot project for multiple platforms" +author: josephbmanley +inputs: + name: + description: 'Name of the exported binary' + required: true + preset: + description: 'Name of the preset in `export_presets.cfg` to use' + required: true + subdirectory: + description: 'Optional name of the subdirectory to put exported project in' + default: "" + package: + description: 'Set true to output an artifact zip file' + default: false + projectDir: + description: 'Location of Godot project in repository' + default: "." + debugMode: + description: 'Whether or not to use `--export-debug`' + default: false +runs: + using: docker + image: Dockerfile + args: + - ${{ inputs.name }} + - ${{ inputs.preset }} + - ${{ inputs.subdirectory }} + - ${{ inputs.package }} + - ${{ inputs.projectDir }} + - ${{ inputs.debugMode }} +branding: + icon: loader + color: blue \ No newline at end of file diff --git a/.forgejo/actions/entrypoint.sh b/.forgejo/actions/entrypoint.sh new file mode 100644 index 0000000..daba9ca --- /dev/null +++ b/.forgejo/actions/entrypoint.sh @@ -0,0 +1,39 @@ +#!/bin/sh +set -e + +# Move godot templates already installed from the docker image to home +mkdir -v -p ~/.local/share/godot/export_templates +cp -a /root/.local/share/godot/export_templates/. ~/.local/share/godot/export_templates/ + + +if [ "$3" != "" ] +then + SubDirectoryLocation="$3/" +fi + +mode="export-release" +if [ "$6" = "true" ] +then + echo "Exporting in debug mode!" + mode="export-debug" +fi + +# Export for project +echo "Building $1 for $2" +mkdir -p $GITHUB_WORKSPACE/build/${SubDirectoryLocation:-""} +cd "$GITHUB_WORKSPACE/$5" +godot --headless --${mode} "$2" $GITHUB_WORKSPACE/build/${SubDirectoryLocation:-""}$1 +echo "Build Done" + +echo ::set-output name=build::build/${SubDirectoryLocation:-""} + + +if [ "$4" = "true" ] +then + echo "Packing Build" + mkdir -p $GITHUB_WORKSPACE/package + cd $GITHUB_WORKSPACE/build + zip $GITHUB_WORKSPACE/package/artifact.zip ${SubDirectoryLocation:-"."} -r + echo ::set-output name=artifact::package/artifact.zip + echo "Done" +fi \ No newline at end of file diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml new file mode 100644 index 0000000..2028db1 --- /dev/null +++ b/.forgejo/workflows/build.yaml @@ -0,0 +1,39 @@ +on: + push: + branches: + - main + - release +jobs: + Godot: + runs-on: linux_amd64 + strategy: + matrix: + platform: [linux, windows] + steps: + - uses: actions/checkout@v3 + with: + lfs: true + - name: Build + id: build + uses: ./.forgejo/actions/build-godot + with: + name: StickerClone + preset: ${{ matrix.platform }} + debugMode: "true" + - name: Upload + uses: actions/upload-artifact@v2 + with: + name: Client - ${{ matrix.platform }} + path: ${{ github.workspace }}/${{ steps.build.outputs.build }} + # - name: Build + # id: build + # uses: https://github.com/yeslayla/build-godot-action@v1.5.0 + # with: + # name: StickerClone + # preset: ${{ matrix.platform }} + # debugMode: "false" + # - name: Upload Artifact + # uses: actions/upload-artifact@v2 + # with: + # name: Client - ${{ matrix.platform }} + # path: ${{ github.workspace }}/${{ steps.build.outputs.build }}