Skip to content

Commit

Permalink
Merge pull request #2 from biplobsd/main
Browse files Browse the repository at this point in the history
Argument for specifying .spec file to build
  • Loading branch information
JackMcKew authored Jun 25, 2020
2 parents 33e0125 + 7071c8c commit a8dee21
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: <YOUR_SPEC_FILE_NAME>`

If the `src` folder has a `requirements.txt` file, the packages will be installed into the environment before PyInstaller runs.

Expand Down
9 changes: 7 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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'
Expand All @@ -27,4 +31,5 @@ runs:
args:
- ${{ inputs.path }}
- ${{ inputs.pypi_url }}
- ${{ inputs.pypi_index_url }}
- ${{ inputs.pypi_index_url }}
- ${{ inputs.spec }}
6 changes: 5 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 "$@"
Expand Down

0 comments on commit a8dee21

Please sign in to comment.