You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Versatile PyInstaller
v1.3.0
Check all available usable tags here
You can also use any major tags like @v1
for any @v1.*.*
- This action packages the python source code into executables using pyinstaller.
- Use this action in your workflow to create & upload executables to GitHub (as artifacts).
- Use inputs to configure this action.
- Use outputs to get information from this action.
- Create executable for different kinds of os like linux, windows, mac etc.
- Specify OS in
jobs.<job-id>.runs-on=<your-os-name>
in your workflow file. - see examples for more info.
- You can use either
.py
or.spec
file to create the executable. - Specify it in
inputs.spec: <file.py/file.spec>
. - When
.py
file is used, generated.spec
file will also be uploaded as artifact. - Modify your
.spec
file according to your needs.
- Write your third party modules in a file (Ex:
requirements.txt
) , and - Use
inputs.requirements: <path-to-your-requirement-file>
.
- Specify pyinstaller options in
inputs.options: <comma-seperated-options-here>
. .py
and.spec
both supports different kind of options.- Check list of all supported options here.
- You can specify any python version for the executable.
- Specify specific python-version in
inputs.python_ver: <python-version-here>
.
- You can control if generated executable needs to be uploaded as artifact.
- You can choose a name of your liking.
- Specify the artifact name in
inputs.upload_exe_with_name: <name-here>
.
- Some inputs are required, while rest are optional.
- Check detailed info about these inputs & outputs here.
Input | Default ( - = empty string) |
Description |
---|---|---|
spec (required) |
- | Path of your .py or .spec file |
requirements |
- | Path of your requirements.txt file |
options |
- | Options to set for pyinstaller command |
python_ver |
3.10 | Specific python version you want to use |
python_arch |
x64 | Specific python architecture you want to use |
exe_path |
./dist | Path on runner-os, where executable will be stored |
upload_exe_with_name |
- | Upload exe_ artifact with this name. Else, it won't upload |
Output | Description |
---|---|
executable_path |
Path on runner-os, where executable will be stored |
is_uploaded |
true , if packaged executable has been uploaded as artifact |
π Supported Pyinstaller options
For .py |
For .py |
For .spec |
---|---|---|
--uac-admin |
--name <NAME> , -n <NAME> |
--ascii , -a |
--uac-uiaccess |
--icon <FILEICON> , -i <FILEICON> |
--upx-dir <UPX_DIR> |
--noupx |
--key <KEY> |
|
--onedir , -D |
--upx-dir <UPX_DIR> |
|
--onefile , -F |
--upx-exclude <FILE> |
|
--ascii , -a |
--add-data <SRC;DEST or SRC:DEST> |
|
--console , --nowindowed , -c |
--add-binary <SRC;DEST or SRC:DEST> |
|
--windowed , --noconsole , -w |
--collect-data <MODULENAME> |
|
--collect-all <MODULENAME> |
jobs:
pyinstaller-build:
runs-on: <windows-latest / ubuntu-latest / ..... etc>
steps:
- name: Create Executable
uses: sayyid5416/pyinstaller@v1
with:
python_ver: '3.6'
spec: 'src/build.spec'
requirements: 'src/requirements.txt'
upload_exe_with_name: 'My executable'
options: --onefile, --name "My App", --windowed,