diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6ac593c..d368d54 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,11 +9,9 @@ jobs: create_release: name: Create Release runs-on: ubuntu-latest - outputs: - upload_url: ${{ steps.create_release.outputs.upload_url }} steps: - name: Create Release - id: create_release + id: create_release_step uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -22,6 +20,8 @@ jobs: release_name: Release ${{ github.ref }} draft: false prerelease: false + - name: Set output + run: echo "{upload_url}={${{ steps.create_release_step.outputs.upload_url }}}" >> $GITHUB_OUTPUT build: name: Build packages @@ -36,14 +36,17 @@ jobs: CMD_BUILD: > pyinstaller -F -w -n tiled_gif_export src/tiled_gif_export.py && cd dist/ && - zip -r9 tiled_gif_export tiled_gif_export.app/ - OUT_FILE_NAME: tiled_gif_export.zip + zip -r9 "tiled_gif_export (mac).zip" tiled_gif_export.app/ + OUT_FILE_NAME: tiled_gif_export (mac).zip ASSET_MIME: application/zip - os: windows-latest TARGET: windows - CMD_BUILD: pyinstaller -F -w -n tiled_gif_export src/tiled_gif_export.py - OUT_FILE_NAME: tiled_gif_export.exe - ASSET_MIME: application/vnd.microsoft.portable-executable + CMD_BUILD: > + pyinstaller -w -n "Tiled gif export" src/tiled_gif_export.py && + cd dist && + tar.exe -a -c -f "tiled_gif_export (windows).zip" -C tiled_gif_export * + OUT_FILE_NAME: tiled_gif_export (windows).zip + ASSET_MIME: application/zip - os: ubuntu-latest TARGET: linux CMD_BUILD: pyinstaller -F -w -n tiled_gif_export src/tiled_gif_export.py diff --git a/README.md b/README.md index f6676c3..637197c 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ optional arguments: Frame duration in ms (has to be devisible by 10) -n FRAMES, --frames FRAMES Number of Frames to render - -f FILE, --file FILE Input file (Tiled file '.tmx' or '.world' + -f FILE, --file FILE Input file (Tiled file '.tmx' or '.world') -o OUTPUT, --output OUTPUT Output file (.gif) ``` diff --git a/src/settings.py b/src/settings.py index b199c87..afa25e3 100644 --- a/src/settings.py +++ b/src/settings.py @@ -3,6 +3,7 @@ from dataclasses import dataclass import os from os.path import exists +import sys @dataclass class Settings: @@ -17,7 +18,7 @@ class Settings: @staticmethod def get_config_path() -> str: - return os.path.join(os.path.dirname(os.path.realpath(__file__)), "config.ini") + return os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), "config.ini") @classmethod def load_config(cls) -> 'Settings': @@ -57,7 +58,7 @@ def generate_config(cls) -> None: with open(cls.get_config_path(), 'w') as configfile: config.write(configfile) - print("Config Generated. Please edit and restart this program.") + print(f"Config Generated at {cls.get_config_path()}. Please edit and restart this program.") @classmethod def parse_args(cls):