yeslayla / build-godot-action

GitHub action that builds a Godot project for multiple platforms
https://github.com/josephbmanley/build-godot-action
MIT License
124 stars 27 forks source link

Filetypes gone after building #16

Open lreinink opened 3 years ago

lreinink commented 3 years ago

Hello, when I'm building the project on my machine it works for Windows and Mac, but when using your tool, the filetypes are gone. For Windows, I can just add .exe behind it, and it works, but for Mac, adding .app behind it does not work. Am I doing something wrong here?

kb173 commented 2 years ago

We've run into this as well and after some testing, it seems like it is because this Action invokes the command like this:

godot --export "platform" name

The name specifies the filename of the exported file, and it comes from what's written in your Action yml, e.g.:

        with:
          name: my-game

In this case, it'd run godot --export "platform" my-game, and this my-game overrides the name from the export preset which presumably has the correct ending.

The Godot docs sound like the ending should be appended automatically when exporting like this, so maybe that's where this issue comes from. Elsewhere in the docs, however, the ending is included in this name parameter.

Either way, it might be helpful to add an option which does not include any name override and just uses the name configured in the preset.

semirix commented 2 years ago

This is easily fixed by adding some extra fields in the matrix. Here's an example config:

name: Build Godot

on:
  push: {}
  pull_request: {}

jobs:
  Godot:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        platform:
        - name: Windows
          file: game.exe
        - name: MacOS
          file: game.zip
        - name: Linux
          file: game
    steps:
      - uses: actions/checkout@v2
      - name: Build
        id: build
        uses: manleydev/build-godot-action@v1.4.1
        with:
          name: ${{ matrix.platform.file }}
          preset: ${{ matrix.platform.name }}
          debugMode: false
      - name: Upload Artifact
        uses: actions/upload-artifact@v2
        with:
          name: Game - ${{ matrix.platform.name }}
          path: ${{ github.workspace }}/${{ steps.build.outputs.build }}

Edit: Fixed MacOS file extension for anyone googling for a solution.

Calinou commented 2 years ago

For Windows, I can just add .exe behind it, and it works, but for Mac, adding .app behind it does not work. Am I doing something wrong here?

The suffix to use for macOS exporting is .zip or .dmg. .app can't be used directly (although an .app is contained within the generated ZIP).

semirix commented 2 years ago

The suffix to use for macOS exporting is .zip or .dmg. .app can't be used directly (although an .app is contained within the generated ZIP).

@Calinou Ah, so for MacOS binaries, the following applies:

OS Used to Export Resulting File for Mac Binary
Linux .zip
Windows .zip
MacOS .dmg
Calinou commented 2 years ago

@Calinou Ah, so for MacOS binaries, the following applies: OS Used to Export Resulting File for Mac Binary Linux .zip Windows .zip MacOS .dmg

Yes, although you can still use the .zip target when exporting from macOS (it can do both .zip and .dmg).