mirror of
https://github.com/yeslayla/build-godot-action.git
synced 2025-12-06 17:33:34 +01:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1158964084 | |||
| a473f49739 | |||
| 0fcde89bd7 | |||
| 5206884b2f | |||
| 9615502e35 | |||
| 80800f3c97 | |||
| fd0b55fc3a |
19
Contributors.md
Normal file
19
Contributors.md
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# Build Godot Action Contributors
|
||||||
|
|
||||||
|
## Maintainers
|
||||||
|
|
||||||
|
Name | Email | Twitter |
|
||||||
|
-----|-------|---------|
|
||||||
|
[Joseph Manley](https://github.com/josephbmanley) | [joseph@cloudsumu.com](mailto:joseph@cloudsumu.com) | [@josephbmanley](https://twitter.com/josephbmanley)
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
A giant thanks to everyone put in the time to improve Godot CI!
|
||||||
|
|
||||||
|
Name | Email | Twitter |
|
||||||
|
---- | ----- | ------- |
|
||||||
|
[Tomer Keren](https://github.com/Tadaboody) | [tomerpet@gmail.com](tomerpet@gmail.com) | [@Tadaboody](https://twitter.com/Tadaboody)
|
||||||
|
|
||||||
|
## Additional Credits
|
||||||
|
|
||||||
|
This action uses the [godot-ci](https://github.com/aBARICHELLO/godot-ci) docker image from [BARICHELLO](https://github.com/aBARICHELLO)
|
||||||
147
ReadMe.md
147
ReadMe.md
@@ -1,9 +1,139 @@
|
|||||||
 
|
 
|
||||||
|
|
||||||
# Build Godot Project
|

|
||||||
|
|
||||||
This action builds the godot project in your `$GITHUB_WORKSPACE`, so that you can easily automate builds.
|
This action builds the godot project in your `$GITHUB_WORKSPACE`, so that you can easily automate builds.
|
||||||
|
|
||||||
|
Table of Contents:
|
||||||
|
- [Quickstart](#Quickstart)
|
||||||
|
- [Usage](#Usage)
|
||||||
|
- [Contributors](Contributors.md)
|
||||||
|
|
||||||
|
## Quickstart
|
||||||
|
|
||||||
|
### Step 1: Configure Export Presets
|
||||||
|
|
||||||
|
In Godot create export templates for `linux`, `windows`, and `mac`.
|
||||||
|
|
||||||
|
The name of the Windows export would be of type `Windows Desktop` and have the name `windows`. For Mac, the name would `mac` and type `Mac OSX`. Then for linux, `Linux/X11`
|
||||||
|
|
||||||
|
Once you verify that `export_presets.cfg` is located in the same directory as your `project.godot` file, you can push your changes.
|
||||||
|
|
||||||
|
### Step 2: Setup Worfklow on GitHub
|
||||||
|
|
||||||
|
Add the following workflow file to your repository. An example file name would be `.github/workflows/build.yml`
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: Build Godot Project
|
||||||
|
|
||||||
|
on:
|
||||||
|
push: {}
|
||||||
|
pull_request: {}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Godot:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
platform: [linux, windows, mac]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
lfs: true
|
||||||
|
- name: Build
|
||||||
|
id: build
|
||||||
|
uses: josephbmanley/build-godot-action@v1.4.0
|
||||||
|
with:
|
||||||
|
name: example
|
||||||
|
preset: ${{ matrix.platform }}
|
||||||
|
debugMode: "true"
|
||||||
|
- name: Upload Artifact
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: Client - ${{ matrix.platform }}
|
||||||
|
path: ${{ github.workspace }}/${{ steps.build.outputs.build }}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Workflow Explaination
|
||||||
|
|
||||||
|
This workflow has three steps:
|
||||||
|
- **Checkout**: The Checkout step clones the project on the GitHub actions runner.
|
||||||
|
- **Build**: This step uses this action to build the Godot project.
|
||||||
|
- **Upload Artifact**: The Upload Artifact step uploads the output from the build step.
|
||||||
|
|
||||||
|
**Matrix Explaination**: The matrix object runs the job for EACH possible value. So in this job, we are using a `platform` matrix to automatically run our workflow for the values `linux`, `windows`, and `mac`.
|
||||||
|
|
||||||
|
#### Simple Changes
|
||||||
|
|
||||||
|
##### Change Exports
|
||||||
|
|
||||||
|
In this workflow, since it's using a matrix you can just add or remove export names from the `platform` matrix. The value being passed MUST have the same name as the preset.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
Godot:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
platform: [win32, win64] # This project will only export using the export presets `win32` and `win64`
|
||||||
|
```
|
||||||
|
|
||||||
|
Additionally if you are not using a matrix, you can set the export preset as the parameter `preset`:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Build
|
||||||
|
id: build
|
||||||
|
uses: josephbmanley/build-godot-action@v1.4.0
|
||||||
|
with:
|
||||||
|
name: example
|
||||||
|
preset: win32
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Change Project Name
|
||||||
|
|
||||||
|
To change the export name, you can the `name` parameter to whatever you want your project to export as.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Build
|
||||||
|
id: build
|
||||||
|
uses: josephbmanley/build-godot-action@v1.4.0
|
||||||
|
with:
|
||||||
|
name: test # This project will export with the name "test"
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Disable Debug Mode
|
||||||
|
|
||||||
|
This example is set to build with debug mode enable. To disable debug, either set `debugMode` to `false` or remove the field entirely.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Build
|
||||||
|
id: build
|
||||||
|
uses: josephbmanley/build-godot-action@v1.4.0
|
||||||
|
with:
|
||||||
|
name: example
|
||||||
|
preset: ${{ matrix.platform }}
|
||||||
|
debugMode: "false" # This project will not build in debug mode
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Change Project Directory
|
||||||
|
|
||||||
|
If your project is located in a subdirectory, you can use the `projectDir` to change build directories.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Build
|
||||||
|
id: build
|
||||||
|
uses: josephbmanley/build-godot-action@v1.4.0
|
||||||
|
with:
|
||||||
|
name: example
|
||||||
|
preset: ${{ matrix.platform }}
|
||||||
|
projectDir: "test" # The project in the `test` directory will be built
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### Step 3: Test your workflow!
|
||||||
|
|
||||||
|
Now, whenever you make a push or pull request in that repository, GitHub Actions will build . You see and download your project in the `Actions` tab of your repository.
|
||||||
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
This action will create a `build` folder an outputed build. You must have the export preset configured for the target platform to successfully export.
|
This action will create a `build` folder an outputed build. You must have the export preset configured for the target platform to successfully export.
|
||||||
@@ -40,6 +170,12 @@ steps:
|
|||||||
|
|
||||||
Boolean value, when set to true, builds artficat zip file.
|
Boolean value, when set to true, builds artficat zip file.
|
||||||
|
|
||||||
|
#### projectDir
|
||||||
|
|
||||||
|
*Optional*
|
||||||
|
|
||||||
|
Directory in workspace containing your godot project.
|
||||||
|
|
||||||
#### debugMode
|
#### debugMode
|
||||||
|
|
||||||
*Optional*
|
*Optional*
|
||||||
@@ -50,13 +186,8 @@ steps:
|
|||||||
|
|
||||||
#### build
|
#### build
|
||||||
|
|
||||||
The location the outputed build is placed.
|
The location the outputed build is placed relative to GitHub Workspace.
|
||||||
|
|
||||||
#### artifact
|
#### artifact
|
||||||
|
|
||||||
The location the outputed artifact is placed.
|
The location the outputed artifact is placed relative to GitHub Workspace.
|
||||||
|
|
||||||
|
|
||||||
## Credits
|
|
||||||
|
|
||||||
This action uses the [godot-ci](https://github.com/aBARICHELLO/godot-ci) docker image from [BARICHELLO](https://github.com/aBARICHELLO)
|
|
||||||
|
|||||||
@@ -10,12 +10,13 @@ inputs:
|
|||||||
required: true
|
required: true
|
||||||
subdirectory:
|
subdirectory:
|
||||||
description: 'Optional name of the subdirectory to put exported project in'
|
description: 'Optional name of the subdirectory to put exported project in'
|
||||||
required: false
|
default: ""
|
||||||
package:
|
package:
|
||||||
description: 'Set true to output an artifact zip file'
|
description: 'Set true to output an artifact zip file'
|
||||||
required: false
|
default: false
|
||||||
projectDir:
|
projectDir:
|
||||||
description: 'Location of Godot project in repository'
|
description: 'Location of Godot project in repository'
|
||||||
|
default: "."
|
||||||
debugMode:
|
debugMode:
|
||||||
description: 'Whether or not to use `--export-debug`'
|
description: 'Whether or not to use `--export-debug`'
|
||||||
default: false
|
default: false
|
||||||
|
|||||||
@@ -12,23 +12,26 @@ fi
|
|||||||
mode="export"
|
mode="export"
|
||||||
if [ "$6" = "true" ]
|
if [ "$6" = "true" ]
|
||||||
then
|
then
|
||||||
|
echo "Exporting in debug mode!"
|
||||||
mode="export-debug"
|
mode="export-debug"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Export for project
|
# Export for project
|
||||||
echo "Building $1 for $2"
|
echo "Building $1 for $2"
|
||||||
mkdir -p ~/build/${SubDirectoryLocation:-""}
|
mkdir -p $GITHUB_WORKSPACE/build/${SubDirectoryLocation:-""}
|
||||||
cd ${5-"~"}
|
cd ${5-"$GITHUB_WORKSPACE"}
|
||||||
godot --${mode} $2 ~/build/${SubDirectoryLocation:-""}$1
|
godot --${mode} $2 $GITHUB_WORKSPACE/build/${SubDirectoryLocation:-""}$1
|
||||||
cd ~
|
echo "Build Done"
|
||||||
|
|
||||||
echo ::set-output name=build::~/build/${SubDirectoryLocation:-""}
|
echo ::set-output name=build::build/${SubDirectoryLocation:-""}
|
||||||
|
|
||||||
|
|
||||||
if [ "$4" = "true" ]
|
if [ "$4" = "true" ]
|
||||||
then
|
then
|
||||||
mkdir -p ~/package
|
echo "Packing Build"
|
||||||
cd ~/build
|
mkdir -p $GITHUB_WORKSPACE/package
|
||||||
zip ~/package/artifact.zip ${SubDirectoryLocation:-"."} -r
|
cd $GITHUB_WORKSPACE/build
|
||||||
echo ::set-output name=artifact::~/package/artifact.zip
|
zip $GITHUB_WORKSPACE/package/artifact.zip ${SubDirectoryLocation:-"."} -r
|
||||||
|
echo ::set-output name=artifact::package/artifact.zip
|
||||||
|
echo "Done"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user