Merge pull request #2 from biplobsd/main
Argument for specifying .spec file to build
This commit is contained in:
commit
a8dee21ad0
|
@ -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.
|
||||
|
||||
|
|
|
@ -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'
|
||||
|
@ -28,3 +32,4 @@ runs:
|
|||
- ${{ inputs.path }}
|
||||
- ${{ inputs.pypi_url }}
|
||||
- ${{ inputs.pypi_index_url }}
|
||||
- ${{ inputs.spec }}
|
||||
|
|
|
@ -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 "$@"
|
||||
|
|
Loading…
Reference in New Issue