diff --git a/README.md b/README.md index b58f523..23c619f 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ Github Action for building executables with PyInstaller To build your application, you need to specify where your source code is via the `path` argument, this defaults to `src`. The source code directory should have your `.spec` file that PyInstaller generates. If you don't have one, you'll need to run PyInstaller once locally to generate it. +Also if you have another program `.spec` file you can set specific pyinstaller `.spec` file by `spec: ` If the `src` folder has a `requirements.txt` file, the packages will be installed into the environment before PyInstaller runs. diff --git a/action.yml b/action.yml index 6684dde..44af939 100644 --- a/action.yml +++ b/action.yml @@ -6,7 +6,7 @@ branding: color: 'blue' inputs: path: - description: 'Directory containing source code & .spec file (optional requirements.txt).' + description: 'Directory containing source code (optional requirements.txt).' required: True default: src pypi_url: @@ -17,6 +17,10 @@ inputs: description: 'Specify a custom URL for PYPI Index' required: False default: https://pypi.python.org/simple + spec: + description: 'Specify a file path for .spec file' + required: False + default: "" outputs: output: description: 'The output of PyInstaller' @@ -27,4 +31,5 @@ runs: args: - ${{ inputs.path }} - ${{ inputs.pypi_url }} - - ${{ inputs.pypi_index_url }} \ No newline at end of file + - ${{ inputs.pypi_index_url }} + - ${{ inputs.spec }} diff --git a/entrypoint.sh b/entrypoint.sh index 3acaab8..06ef8a0 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -17,6 +17,10 @@ PYPI_INDEX_URL=$3 WORKDIR=${SRCDIR:-/src} +SPEC_FILE=${4:-*.spec} + +python -m pip install --upgrade pip wheel setuptools + # # In case the user specified a custom URL for PYPI, then use # that one, instead of the default one. @@ -44,7 +48,7 @@ fi # [ -f requirements.txt ] # if [[ "$@" == "" ]]; then -pyinstaller --clean -y --dist ./dist/windows --workpath /tmp *.spec +pyinstaller --clean -y --dist ./dist/windows --workpath /tmp $SPEC_FILE chown -R --reference=. ./dist/windows # else # sh -c "$@"