Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions build-godot/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: 'Build Godot'
description: 'Build Godot applications for Windows, macOS, and Linux'

inputs:
project-dir:
description: 'The path to the Godot project (folder that contains the project.godot file)'
required: false
default: ''
build-dir:
description: 'The chosen build directory'
required: true
Expand All @@ -16,62 +20,70 @@ runs:
steps:
- name: Open Godot editor for reimport
shell: bash
working-directory: ${{ inputs.project-dir }}
run: ${{ inputs.godot-executable }} --import --headless --verbose

- name: Apply version to export information
shell: bash
working-directory: ${{ inputs.project-dir }}
run: ${{ inputs.godot-executable }} --script scripts/apply_version.gd --headless

- name: Build macOS application
shell: bash
working-directory: ${{ inputs.project-dir }}
run: |
mkdir -p ${{ inputs.build-dir }}/macos
${{ inputs.godot-executable }} --export-debug macOS --headless
[ "$(ls -A ${{ inputs.build-dir }}/macos)" ]

- name: Compress macOS build (to preserve permissions)
shell: bash
working-directory: ${{ inputs.project-dir }}
run: |
cd ${{ inputs.build-dir }}/macos
tar -cvf ./macos.tar --exclude='*.command' ./*

- uses: actions/upload-artifact@v3
with:
name: macos
path: ${{ inputs.build-dir }}/macos/macos.tar
path: ${{ inputs.project-dir }}${{ inputs.build-dir }}/macos/macos.tar

- name: Build Windows application
shell: bash
working-directory: ${{ inputs.project-dir }}
run: |
mkdir -p ${{ inputs.build-dir }}/windows
${{ inputs.godot-executable }} --export-debug Windows --headless
[ "$(ls -A ${{ inputs.build-dir }}/windows)" ]

- name: Compress Windows build
shell: bash
working-directory: ${{ inputs.project-dir }}
run: |
cd ${{ inputs.build-dir }}/windows
zip -m ./windows.zip ./*

- uses: actions/upload-artifact@v3
with:
name: windows
path: ${{ inputs.build-dir }}/windows/windows.zip
path: ${{ inputs.project-dir }}${{ inputs.build-dir }}/windows/windows.zip

- name: Build Linux application
shell: bash
working-directory: ${{ inputs.project-dir }}
run: |
mkdir -p ${{ inputs.build-dir }}/linux
${{ inputs.godot-executable }} --export-debug Linux --headless
[ "$(ls -A ${{ inputs.build-dir }}/linux)" ]

- name: Compress Linux build (to preserve permissions)
shell: bash
working-directory: ${{ inputs.project-dir }}
run: |
cd ${{ inputs.build-dir }}/linux
tar -cvf ./linux.tar ./*

- uses: actions/upload-artifact@v3
with:
name: linux
path: ${{ inputs.build-dir }}/linux/linux.tar
path: ${{ inputs.project-dir }}${{ inputs.build-dir }}/linux/linux.tar