From ff7e885f69e5041de9c70b805d58cbfe9b8a93b4 Mon Sep 17 00:00:00 2001 From: Biplob SD <43641536+biplobsd@users.noreply.github.com> Date: Wed, 24 Jun 2020 22:57:19 +0600 Subject: [PATCH 01/10] spec path --- action.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 6684dde..2b47af5 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: pyinstaller.spec 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 }} From f1f2d7035f3ff53df3411f2b0b7ec2834525c59f Mon Sep 17 00:00:00 2001 From: Biplob SD <43641536+biplobsd@users.noreply.github.com> Date: Wed, 24 Jun 2020 23:11:48 +0600 Subject: [PATCH 02/10] SPEC_FILE --- entrypoint.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 3acaab8..7ed1228 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -17,6 +17,8 @@ PYPI_INDEX_URL=$3 WORKDIR=${SRCDIR:-/src} +SPEC_FILE="${SRCDIR}/${4}" + # # In case the user specified a custom URL for PYPI, then use # that one, instead of the default one. @@ -44,7 +46,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 "$@" From 681336b7ae85624cb0721c43c403ff5f5db4528e Mon Sep 17 00:00:00 2001 From: Biplob SD <43641536+biplobsd@users.noreply.github.com> Date: Wed, 24 Jun 2020 23:52:49 +0600 Subject: [PATCH 03/10] upgrade builds tools --- entrypoint.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index 7ed1228..8a71c68 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -19,6 +19,8 @@ WORKDIR=${SRCDIR:-/src} SPEC_FILE="${SRCDIR}/${4}" +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. From ac8fd363b0d40070bffd71d7e68d4c5404e841db Mon Sep 17 00:00:00 2001 From: Biplob SD <43641536+biplobsd@users.noreply.github.com> Date: Thu, 25 Jun 2020 00:03:26 +0600 Subject: [PATCH 04/10] Update entrypoint.sh --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 8a71c68..2d877c9 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -19,7 +19,7 @@ WORKDIR=${SRCDIR:-/src} SPEC_FILE="${SRCDIR}/${4}" -pip install --upgrade pip wheel setuptools +python -m pip install --upgrade pip wheel setuptools # # In case the user specified a custom URL for PYPI, then use From b469d4d30a6047a2f3d6fc18307ecf36098fabbe Mon Sep 17 00:00:00 2001 From: Biplob SD <43641536+biplobsd@users.noreply.github.com> Date: Thu, 25 Jun 2020 00:24:03 +0600 Subject: [PATCH 05/10] Update entrypoint.sh --- entrypoint.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index 2d877c9..438e3f6 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -19,6 +19,9 @@ WORKDIR=${SRCDIR:-/src} SPEC_FILE="${SRCDIR}/${4}" +@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" +choco install visualcpp-build-tools + python -m pip install --upgrade pip wheel setuptools # From 99ed1fb8c9056f1f54fd08b1022bd5cbf8d3e43d Mon Sep 17 00:00:00 2001 From: Biplob SD <43641536+biplobsd@users.noreply.github.com> Date: Thu, 25 Jun 2020 00:43:06 +0600 Subject: [PATCH 06/10] Update entrypoint.sh --- entrypoint.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 438e3f6..2d877c9 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -19,9 +19,6 @@ WORKDIR=${SRCDIR:-/src} SPEC_FILE="${SRCDIR}/${4}" -@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" -choco install visualcpp-build-tools - python -m pip install --upgrade pip wheel setuptools # From b22424d290db8e3ea4b7f7b86a848b53131f7796 Mon Sep 17 00:00:00 2001 From: Biplob SD <43641536+biplobsd@users.noreply.github.com> Date: Thu, 25 Jun 2020 17:35:29 +0600 Subject: [PATCH 07/10] default *.spec --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 2d877c9..06ef8a0 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -17,7 +17,7 @@ PYPI_INDEX_URL=$3 WORKDIR=${SRCDIR:-/src} -SPEC_FILE="${SRCDIR}/${4}" +SPEC_FILE=${4:-*.spec} python -m pip install --upgrade pip wheel setuptools From 9cdd37462273ec4fa856bb2832e6c71e33dc4004 Mon Sep 17 00:00:00 2001 From: Biplob SD <43641536+biplobsd@users.noreply.github.com> Date: Thu, 25 Jun 2020 17:37:37 +0600 Subject: [PATCH 08/10] default *.spec --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 2b47af5..7b68ab9 100644 --- a/action.yml +++ b/action.yml @@ -20,7 +20,7 @@ inputs: spec: description: 'Specify a file path for .spec file' required: False - default: pyinstaller.spec + default: *.spec outputs: output: description: 'The output of PyInstaller' From 4e2ef9706a08f9965ba51c47e0d195de6d294c69 Mon Sep 17 00:00:00 2001 From: Biplob SD <43641536+biplobsd@users.noreply.github.com> Date: Thu, 25 Jun 2020 18:12:28 +0600 Subject: [PATCH 09/10] Update action.yml --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 7b68ab9..44af939 100644 --- a/action.yml +++ b/action.yml @@ -20,7 +20,7 @@ inputs: spec: description: 'Specify a file path for .spec file' required: False - default: *.spec + default: "" outputs: output: description: 'The output of PyInstaller' From 7071c8c60172c910ee84a446714d18646e9d1aef Mon Sep 17 00:00:00 2001 From: Biplob SD <43641536+biplobsd@users.noreply.github.com> Date: Thu, 25 Jun 2020 19:30:22 +0600 Subject: [PATCH 10/10] specific file --- README.md | 1 + 1 file changed, 1 insertion(+) 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.