add `add_data_dirs` input
This commit is contained in:
parent
c1a1d21957
commit
0ce759f0a3
11
action.yml
11
action.yml
|
@ -9,22 +9,32 @@ inputs:
|
||||||
description: 'Directory containing source code (optional requirements.txt).'
|
description: 'Directory containing source code (optional requirements.txt).'
|
||||||
required: True
|
required: True
|
||||||
default: src
|
default: src
|
||||||
|
|
||||||
pypi_url:
|
pypi_url:
|
||||||
description: 'Specify a custom URL for PYPI'
|
description: 'Specify a custom URL for PYPI'
|
||||||
required: False
|
required: False
|
||||||
default: https://pypi.python.org/
|
default: https://pypi.python.org/
|
||||||
|
|
||||||
pypi_index_url:
|
pypi_index_url:
|
||||||
description: 'Specify a custom URL for PYPI Index'
|
description: 'Specify a custom URL for PYPI Index'
|
||||||
required: False
|
required: False
|
||||||
default: https://pypi.python.org/simple
|
default: https://pypi.python.org/simple
|
||||||
|
|
||||||
spec:
|
spec:
|
||||||
description: 'Specify a file path for .spec file'
|
description: 'Specify a file path for .spec file'
|
||||||
required: False
|
required: False
|
||||||
default: ""
|
default: ""
|
||||||
|
|
||||||
requirements:
|
requirements:
|
||||||
description: 'Specify a file path for requirements.txt file'
|
description: 'Specify a file path for requirements.txt file'
|
||||||
required: False
|
required: False
|
||||||
default: "requirements.txt"
|
default: "requirements.txt"
|
||||||
|
|
||||||
|
add_data_dirs:
|
||||||
|
description: 'Specify a list of directories to add to the `--add-data` flag, the dirs must be separated by a blank space'
|
||||||
|
required: False
|
||||||
|
default: ""
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
output:
|
output:
|
||||||
description: 'The output of PyInstaller'
|
description: 'The output of PyInstaller'
|
||||||
|
@ -38,3 +48,4 @@ runs:
|
||||||
- ${{ inputs.pypi_index_url }}
|
- ${{ inputs.pypi_index_url }}
|
||||||
- ${{ inputs.spec }}
|
- ${{ inputs.spec }}
|
||||||
- ${{ inputs.requirements }}
|
- ${{ inputs.requirements }}
|
||||||
|
- ${{ inputs.add_data_dirs }}
|
||||||
|
|
|
@ -19,6 +19,8 @@ WORKDIR=${SRCDIR:-/src}
|
||||||
|
|
||||||
SPEC_FILE=${4:-*.spec}
|
SPEC_FILE=${4:-*.spec}
|
||||||
|
|
||||||
|
ADD_DATA_DIRS=$6
|
||||||
|
|
||||||
python -m pip install --upgrade pip wheel setuptools
|
python -m pip install --upgrade pip wheel setuptools
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -46,9 +48,23 @@ if [ -f $5 ]; then
|
||||||
fi # [ -f $5 ]
|
fi # [ -f $5 ]
|
||||||
|
|
||||||
|
|
||||||
|
ADD_DATA=""
|
||||||
|
|
||||||
|
# ADD_DATA_DIRS is empty or not provided
|
||||||
|
if [ ! -z "$ADD_DATA_DIRS" ]; then
|
||||||
|
|
||||||
|
# Process every directory in the ADD_DATA_DIRS string
|
||||||
|
for dir in $ADD_DATA_DIRS; do
|
||||||
|
# Add the formatted directory to the output string
|
||||||
|
ADD_DATA+="--add-data $SRCDIR/$dir:$dir "
|
||||||
|
done
|
||||||
|
|
||||||
|
# Remove the extra space at the end of the output string
|
||||||
|
ADD_DATA=${ADD_DATA::-1}
|
||||||
|
fi
|
||||||
|
|
||||||
# if [[ "$@" == "" ]]; then
|
# if [[ "$@" == "" ]]; then
|
||||||
pyinstaller --clean -y --dist ./dist/windows --workpath /tmp $SPEC_FILE
|
pyinstaller --clean -y $ADD_DATA --dist ./dist/windows --workpath /tmp $SPEC_FILE
|
||||||
chown -R --reference=. ./dist/windows
|
chown -R --reference=. ./dist/windows
|
||||||
# else
|
# else
|
||||||
# sh -c "$@"
|
# sh -c "$@"
|
||||||
|
|
Loading…
Reference in New Issue