Skip to content

Commit

Permalink
v2.7.0 (#54)
Browse files Browse the repository at this point in the history
* doc and editor settings updates

* try no build tool

* doc updates

* update docs
  • Loading branch information
firebelley authored Apr 21, 2021
1 parent 2c1be53 commit cbfbe05
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 30 deletions.
74 changes: 48 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# Godot Export
A workflow action to automatically export your Godot games. Supports standard and **Mono** builds!

## Contents
- [How it works](#how-it-works)
- [Setting Up Export Presets](#setting-up-export-presets)
- [Workflow Configuration](#workflow-configuration)
- [Example Configuration](#example-configuration)
- [Mono Builds](#mono-builds)
- [Android Builds](#android-builds)
- [Custom Editor Settings](#custom-editor-settings)
- [Tips](#tips)
- [Using tag pushes](#using-tag-as-base_version)
- [Supply custom editor settings](#supplying-a-custom-editor-settings-file)

## How it Works

### Automatic Exports
Expand All @@ -9,20 +21,13 @@ This action automatically reads your `export_presets.cfg` file to determine whic
### Automatic Release
This action creates a release tagged with a [Semantic Version](https://semver.org/). The zip files containing the export results will be attached to this release. More info about releases can be found below.

## Configuration
### In Godot
Make sure that you have defined at least 1 export preset by going to `Project -> Export` in the Godot editor and creating a configuration. Also set the file name in the "Export Path" box. This action will not know how how to name your file without this. Notice how the below image has "win.exe" in the "Export Path" for my windows export. Your executables can be named however you like, as long as they include the appropriate extension `.exe`, `.x86_64`, etc.
## Setting Up Export Presets
Define at least 1 export preset by going to `Project -> Export` in the Godot editor and creating a configuration. Set the file name in the "Export Path" box. This is how the action knows how to name your binary. Notice how the below image has "win.exe" in the "Export Path" for my windows export. Your executables can be named however you like, as long as they include the appropriate extension `.exe`, `.x86_64`, etc.
![](docs/exports.png)

**NOTE**: The file extension for the Mac OSX export must be anything but `.zip` for versions of Godot before 3.2. If the Mac OSX export file extension is `.zip` for a Godot version earlier than 3.2, then your project source files will be exported instead of a Mac application. [This was a known issue with the Godot command line export](https://github.com/godotengine/godot/issues/23073). For reference, I used a `.z` file extension to make it work for my Mac OSX builds.

### Workflow
This action requires that your job utilizes Github's `actions/checkout` so that the source code is available for Godot to export the game. See the below [example workflow configuration](#example-workflow-configuration) for an example.

### Environment Variables
Since this action creates releases and uploads the zip file assets, you will need to supply the `GITHUB_TOKEN` environment variable. For an example on how to do this, see the below [example workflow configuration](#example-workflow-configuration). This environment variable is not needed if you set `create_release` to `false`.


## Workflow Configuration
### Inputs

#### Required Inputs
Expand Down Expand Up @@ -59,8 +64,11 @@ Since this action creates releases and uploads the zip file assets, you will nee
- If Windows executable icons should be updated with the preset's `.ico` file.
- **Note**: This process installs Wine and will need a small amount of additional run time. In my tests, this setting increased run time by approximately 30 seconds.

### Example Workflow Configuration
Below is a sample workflow configuration file utilizing this action. This example workflow would be defined in `.github/workflows/main.yml`. For more information about defining workflows [check out the workflow docs](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/configuring-a-workflow).
### Environment Variables
Since this action creates releases and uploads the zip file assets, you will need to supply the `GITHUB_TOKEN` environment variable. For an example on how to do this, see the below [example workflow configuration](#example-configuration). This environment variable is not needed if you set `create_release` to `false`.

### Example Configuration
Below is a sample workflow configuration file utilizing this action. This example workflow could be defined in `.github/workflows/main.yml`. For more information about defining workflows see [the workflow docs](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/configuring-a-workflow).

```yml
# Whenever a push is made to the master branch then run the job
Expand All @@ -86,27 +94,31 @@ jobs:
fetch-depth: 0
- name: export game
# Use latest version (see releases for all versions)
uses: firebelley/godot-export@v2.6.1
uses: firebelley/godot-export@v2.7.0
with:
# Defining all the required inputs
# I used the mono version of Godot in this example
godot_executable_download_url: https://downloads.tuxfamily.org/godotengine/3.2.2/mono/Godot_v3.2.2-stable_mono_linux_headless_64.zip
godot_export_templates_download_url: https://downloads.tuxfamily.org/godotengine/3.2.2/mono/Godot_v3.2.2-stable_mono_export_templates.tpz
godot_executable_download_url: https://downloads.tuxfamily.org/godotengine/3.3/rc9/mono/Godot_v3.3-rc9_mono_linux_headless_64.zip
godot_export_templates_download_url: https://downloads.tuxfamily.org/godotengine/3.3/rc9/mono/Godot_v3.3-rc9_mono_export_templates.tpz
relative_project_path: ./
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
## Tips
## Mono Builds
Mono builds do not require additional configuration. However, if you want to change the build tool that is used (currently defaults to `dotnet cli`) then you need to [supply your own editor settings](#custom-editor-settings) with the line `mono/builds/build_tool`. The value of this setting should be a number between `0` and `3`. This value corresponds to the build tool dropdown in the editor settings window at `Editor Settings -> Mono -> Builds -> Build Tool`. You can look at your local `editor_settings-3.tres` to see what this value should be if you want to match the build tool used during local development.

## Android Builds
For Android builds, use the [setup-android](https://github.com/android-actions/setup-android) action before this one in your workflow. [The default editor settings file](./dist/editor_settings-3.tres) used by this action already provides a default path to the Android SDK. If your path is different then [supply your own editor settings file](#custom-editor-settings).

## Custom Editor Settings
Some Godot configurations are editor-based and not project-based. This includes items like Android paths. This repository provides a [base editor settings](./dist/editor_settings-3.tres) that will be used by default when exporting your games. However, you can supply a custom editor settings configuration file by simply copying your custom editor settings file to `~/.config/godot/editor_settings-3.tres` _before_ this action runs. This action will not overwrite an existing `editor_settings-3.tres` file.

### Separate branches for release and development
I recommend creating a separate branch just for the purposes of running this action. Suppose I want the action to run on `master` pushes, but I am in the middle of working on game-breaking changes. Rather than push directly to master and create broken builds (and releases) you might want to consider some different approaches:
- You could create a `release` branch that this action runs on. Then merge your `master` branch into `release` whenever you want to generate a release.
- You could keep `master` as your release-generating branch, and do active development on a `dev` branch. Merge `dev` into `master` when you want to create a release.
## Tips

### Using tag as base_version
You can use git tags to set the release version.
E.g. using `git tag v1.0.0` and then `git push --tags` results in base-version 1.0.0 when using the following workflow.
For example, using `git tag v1.0.0` and then `git push --tags` results in base-version 1.0.0 when using the following workflow.

```yml
# Whenever tag in the form of `v1.0.0` is pushed then run the job
Expand Down Expand Up @@ -138,18 +150,28 @@ jobs:
echo ::set-output name=TAG_VERSION::${GITHUB_REF#refs/tags/v}
- name: export game
# Use latest version (see releases for all versions)
uses: firebelley/godot-export@v2.6.1
uses: firebelley/godot-export@v2.7.0
with:
# Defining all the required inputs
# I used the mono version of Godot in this example
godot_executable_download_url: https://downloads.tuxfamily.org/godotengine/3.2.2/mono/Godot_v3.2.2-stable_mono_linux_headless_64.zip
godot_export_templates_download_url: https://downloads.tuxfamily.org/godotengine/3.2.2/mono/Godot_v3.2.2-stable_mono_export_templates.tpz
godot_executable_download_url: https://downloads.tuxfamily.org/godotengine/3.3/rc9/mono/Godot_v3.3-rc9_mono_linux_headless_64.zip
godot_export_templates_download_url: https://downloads.tuxfamily.org/godotengine/3.3/rc9/mono/Godot_v3.3-rc9_mono_export_templates.tpz
relative_project_path: ./
create_release: true
base_version: ${{ steps.tag_version.outputs.TAG_VERSION}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
### Using custom editor settings
Some Godot configurations are editor-based and not project-based. This includes things like Android paths. This repository provides a [base editor settings](./dist/editor_settings-3.tres) that will be used by default when exporting your games. However, you can supply a custom editor settings configuration by simply copying a a custom editor settings file to `~/.config/godot/editor_settings-3.tres` _before_ this action runs. This action will not overwrite an existing `editor_settings-3.tres` file.
### Supplying a custom editor settings file
Include the following step before this action. For example:
```yml
# ...above this line is the workflow job setup
- name: use custom editor settings
run: |
mkdir -p ~/.config/godot
cp ~/path/to/my/editor_settings-3.tres ~/.config/godot/
- name: export game
uses: firebelley/godot-export@v2.7.0
# ...the rest of the action config goes here
```
5 changes: 1 addition & 4 deletions dist/editor_settings-3.tres
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
[gd_resource type="EditorSettings" format=2]

[resource]
export/android/adb = "/usr/bin/adb"
export/android/jarsigner = "/usr/bin/jarsigner"
export/android/custom_build_sdk_path = "/usr/local/lib/android/sdk"
mono/builds/build_tool = 0
export/android/android_sdk_path = "/usr/local/lib/android/sdk"

0 comments on commit cbfbe05

Please sign in to comment.