diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 03216669..f79bd81a 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -15,18 +15,31 @@ serialize = [bumpversion:file:./docs/conf.py] -[bumpversion:file:./release/one_click_linux_gui/control] +[bumpversion:file:./README.md] -[bumpversion:file:./release/one_click_linux_gui/create_installer_linux.sh] +[bumpversion:file:./release/linux/control] -[bumpversion:file:./release/one_click_macos_gui/distribution.xml] +[bumpversion:file:./release/linux/build_installer_linux.sh] -[bumpversion:file:./release/one_click_macos_gui/Info.plist] +[bumpversion:file:./release/linux/build_package_linux.sh] -[bumpversion:file:./release/one_click_macos_gui/create_installer_macos.sh] +[bumpversion:file:./release/linux/create_installer_linux.sh] # TODO remove with old release workflow -[bumpversion:file:./release/one_click_windows_gui/create_installer_windows.sh] +[bumpversion:file:./release/macos/distribution.xml] + +[bumpversion:file:./release/macos/Info.plist] + +[bumpversion:file:./release/macos/create_installer_macos.sh] # TODO remove with old release workflow + +[bumpversion:file:./release/macos/build_installer_macos.sh] + +[bumpversion:file:./release/macos/build_package_macos.sh] + +[bumpversion:file:./release/windows/create_installer_windows.sh] # TODO remove with old release workflow + +[bumpversion:file:./release/windows/build_installer_windows.ps1] + +[bumpversion:file:./release/windows/peptdeep_innoinstaller.iss] -[bumpversion:file:./release/one_click_windows_gui/peptdeep_innoinstaller.iss] search = {current_version} replace = {new_version} diff --git a/.github/workflows/publish_and_release.yml b/.github/workflows/publish_and_release.yml index ae2ec239..b2caa18f 100644 --- a/.github/workflows/publish_and_release.yml +++ b/.github/workflows/publish_and_release.yml @@ -1,3 +1,4 @@ +# TODO remove with old release workflow on: # push: # branches: [ main ] @@ -57,12 +58,12 @@ jobs: - name: Creating installer for Linux shell: bash -l {0} run: | - cd release/one_click_linux_gui + cd release/linux . ./create_installer_linux.sh CPU - name: Test installer for Linux shell: bash -l {0} run: | - sudo dpkg -i release/one_click_linux_gui/dist/peptdeep_gui_installer_linux.deb + sudo dpkg -i release/linux/dist/peptdeep_gui_installer_linux.deb - name: Upload Linux Installer id: upload-release-asset uses: actions/upload-release-asset@v1 @@ -70,7 +71,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.Create_Draft_On_GitHub.outputs.upload_url }} - asset_path: release/one_click_linux_gui/dist/peptdeep_gui_installer_linux.deb + asset_path: release/linux/dist/peptdeep_gui_installer_linux.deb asset_name: peptdeep_gui_installer_linux.deb asset_content_type: application/octet-stream Create_MacOS_Release: @@ -89,12 +90,12 @@ jobs: - name: Creating installer for MacOS shell: bash -l {0} run: | - cd release/one_click_macos_gui + cd release/macos . ./create_installer_macos.sh - name: Test installer for MacOS shell: bash -l {0} run: | - sudo installer -pkg release/one_click_macos_gui/dist/peptdeep_gui_installer_macos.pkg -target / + sudo installer -pkg release/macos/dist/peptdeep_gui_installer_macos.pkg -target / - name: Upload MacOS Installer id: upload-release-asset uses: actions/upload-release-asset@v1 @@ -102,12 +103,14 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.Create_Draft_On_GitHub.outputs.upload_url }} - asset_path: release/one_click_macos_gui/dist/peptdeep_gui_installer_macos.pkg + asset_path: release/macos/dist/peptdeep_gui_installer_macos.pkg asset_name: peptdeep_gui_installer_macos.pkg asset_content_type: application/octet-stream Create_Windows_Release: runs-on: windows-latest needs: Create_Draft_On_GitHub + env: + BUILD_NAME: peptdeep-1.2.1-win-x64 steps: - name: Checkout code uses: actions/checkout@v3 @@ -121,14 +124,14 @@ jobs: - name: Creating installer for Windows shell: bash -l {0} run: | - cd release/one_click_windows_gui + cd release/windows . ./create_installer_windows.sh - name: Test installer for Windows shell: bash -l {0} run: | - cd release/one_click_windows_gui/dist/ + cd release/windows/dist/ echo "TODO, this test seems to freeze the runner..." - # ./peptdeep_gui_installer_windows.exe //verysilent //log=log.txt //noicons //tasks= //portable=1 + # ./peptdeep-${{ needs.Version_Bumped.outputs.version }}-win-x64.exe //verysilent //log=log.txt //noicons //tasks= //portable=1 # cat log.txt - name: Upload Windows Installer id: upload-release-asset @@ -137,9 +140,10 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.Create_Draft_On_GitHub.outputs.upload_url }} - asset_path: release/one_click_windows_gui/dist/peptdeep_gui_installer_windows.exe - asset_name: peptdeep_gui_installer_windows.exe + asset_path: release/windows/dist/peptdeep-${{ needs.Version_Bumped.outputs.version }}-win-x64.exe + asset_name: peptdeep-${{ needs.Version_Bumped.outputs.version }}-win-x64.exe asset_content_type: application/octet-stream + Create_PyPi_Release: runs-on: ubuntu-latest needs: Version_Bumped diff --git a/.github/workflows/release_installers.yml b/.github/workflows/release_installers.yml index a02790ac..a1a9742b 100644 --- a/.github/workflows/release_installers.yml +++ b/.github/workflows/release_installers.yml @@ -1,3 +1,4 @@ +# TODO remove with old release workflow on: workflow_dispatch: @@ -54,12 +55,12 @@ jobs: - name: Creating installer for Linux shell: bash -l {0} run: | - cd release/one_click_linux_gui + cd release/linux . ./create_installer_linux.sh CPU - name: Test installer for Linux shell: bash -l {0} run: | - sudo dpkg -i release/one_click_linux_gui/dist/peptdeep_gui_installer_linux.deb + sudo dpkg -i release/linux/dist/peptdeep_gui_installer_linux.deb - name: Upload Linux Installer id: upload-release-asset uses: actions/upload-release-asset@v1 @@ -67,7 +68,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.Create_Draft_On_GitHub.outputs.upload_url }} - asset_path: release/one_click_linux_gui/dist/peptdeep_gui_installer_linux.deb + asset_path: release/linux/dist/peptdeep_gui_installer_linux.deb asset_name: peptdeep_gui_installer_linux.deb asset_content_type: application/octet-stream Create_MacOS_Release: @@ -86,12 +87,12 @@ jobs: - name: Creating installer for MacOS shell: bash -l {0} run: | - cd release/one_click_macos_gui + cd release/macos . ./create_installer_macos.sh - name: Test installer for MacOS shell: bash -l {0} run: | - sudo installer -pkg release/one_click_macos_gui/dist/peptdeep_gui_installer_macos.pkg -target / + sudo installer -pkg release/macos/dist/peptdeep_gui_installer_macos.pkg -target / - name: Upload MacOS Installer id: upload-release-asset uses: actions/upload-release-asset@v1 @@ -99,7 +100,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.Create_Draft_On_GitHub.outputs.upload_url }} - asset_path: release/one_click_macos_gui/dist/peptdeep_gui_installer_macos.pkg + asset_path: release/macos/dist/peptdeep_gui_installer_macos.pkg asset_name: peptdeep_gui_installer_macos.pkg asset_content_type: application/octet-stream Create_MacOS_Arm_Release: @@ -118,12 +119,12 @@ jobs: - name: Creating installer for MacOS shell: bash -l {0} run: | - cd release/one_click_macos_gui + cd release/macos . ./create_installer_macos.sh - name: Test installer for MacOS shell: bash -l {0} run: | - sudo installer -pkg release/one_click_macos_gui/dist/peptdeep_gui_installer_macos.pkg -target / + sudo installer -pkg release/macos/dist/peptdeep_gui_installer_macos.pkg -target / - name: Upload MacOS Installer id: upload-release-asset uses: actions/upload-release-asset@v1 @@ -131,12 +132,14 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.Create_Draft_On_GitHub.outputs.upload_url }} - asset_path: release/one_click_macos_gui/dist/peptdeep_gui_installer_macos.pkg + asset_path: release/macos/dist/peptdeep_gui_installer_macos.pkg asset_name: peptdeep_gui_installer_macos_arm.pkg asset_content_type: application/octet-stream Create_Windows_Release: runs-on: windows-latest needs: Create_Draft_On_GitHub + env: + BUILD_NAME: peptdeep-1.2.1-win-x64 steps: - name: Checkout code uses: actions/checkout@v3 @@ -150,14 +153,14 @@ jobs: - name: Creating installer for Windows shell: bash -l {0} run: | - cd release/one_click_windows_gui + cd release/windows . ./create_installer_windows.sh - name: Test installer for Windows shell: bash -l {0} run: | - cd release/one_click_windows_gui/dist/ + cd release/windows/dist/ echo "TODO, this test seems to freeze the runner..." - # ./peptdeep_gui_installer_windows.exe //verysilent //log=log.txt //noicons //tasks= //portable=1 + # ./peptdeep-1.2.1-win-x64.exe //verysilent //log=log.txt //noicons //tasks= //portable=1 # cat log.txt - name: Upload Windows Installer id: upload-release-asset @@ -166,6 +169,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.Create_Draft_On_GitHub.outputs.upload_url }} - asset_path: release/one_click_windows_gui/dist/peptdeep_gui_installer_windows.exe - asset_name: peptdeep_gui_installer_windows.exe + asset_path: release/windows/dist/peptdeep-${{ needs.Version_Bumped.outputs.version }}-win-x64.exe + asset_name: peptdeep-${{ needs.Version_Bumped.outputs.version }}-win-x64.exe asset_content_type: application/octet-stream diff --git a/.gitignore b/.gitignore index ffd5c3e6..bad1e7c4 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,8 @@ share/python-wheels/ .installed.cfg *.egg MANIFEST +dist_pyinstaller/ +build_pyinstaller/ # PyInstaller # Usually these files are written by a python script from a template diff --git a/README.md b/README.md index b6e3789e..a0cb58d8 100644 --- a/README.md +++ b/README.md @@ -112,19 +112,23 @@ The GUI of peptdeep is a completely stand-alone tool that requires no knowledge of Python or CLI tools. Click on one of the links below to download the latest release for: -- [**Windows**](https://github.com/MannLabs/alphapeptdeep/releases/latest/download/peptdeep_gui_installer_windows.exe) -- [**macOS**](https://github.com/MannLabs/alphapeptdeep/releases/latest/download/peptdeep_gui_installer_macos.pkg) -- [**Linux**](https://github.com/MannLabs/alphapeptdeep/releases/latest/download/peptdeep_gui_installer_linux.deb) +- [**Windows**](https://github.com/MannLabs/alphapeptdeep/releases/latest/download/peptdeep-1.2.1-windows-amd64.exe) +- [**macOS**](https://github.com/MannLabs/alphapeptdeep/releases/latest/download/peptdeep-1.2.1-macos-darwin-x64.pkg) +- [**macOS ARM**](https://github.com/MannLabs/alphapeptdeep/releases/latest/download/peptdeep-1.2.1-macos-darwin-arm64.pkg ) +- [**Linux**](https://github.com/MannLabs/alphapeptdeep/releases/latest/download/peptdeep-1.2.1-linux-x64.deb) Older releases remain available on the [release page](https://github.com/MannLabs/alphapeptdeep/releases), but no backwards compatibility is guaranteed. -Note that, as GitHub does not allow large release files, these installers do not have GPU support. To create GPU version installers, clone the source code and install GPU-version pytorch (#use-gpu), and then use `release/one_click_xxx_gui/create_installer_xxx.sh` to build installer locally. For example in Windows, run - +Note that, as GitHub does not allow large release files, these installers do not have GPU support. +To create GPU version installers: clone the source code, install the GPU-version of pytorch [see here](#use-gpu), +and then use the `build_installer_*.sh` and `build_package_*.sh` +script in the respective `release/[macos, linux, windows]` folder to build the installer locally. +For Linux you need to additionally pass the "GPU" flag, i.e. run ```bash -cd release/one_click_windows_gui -. ./create_installer_windows.sh +release/linux/build_installer_linux.sh GPU +release/linux/build_package_linux.sh ``` ### Pip @@ -945,6 +949,17 @@ branch. For an even more interactive participation, check out the the [Contributors License Agreement](misc/CLA.md). ### Notes for developers + +#### Tagging of changes +In order to have release notes automatically generated, changes need to be tagged with labels. +The following labels are used (should be safe-explanatory): +`breaking-change`, `bug`, `enhancement`. + +#### Release a new version +This package uses a shared release process defined in the +[alphashared](https://github.com/MannLabs/alphashared) repository. Please see the instructions +[there](https://github.com/MannLabs/alphashared/blob/reusable-release-workflow/.github/workflows/README.md#release-a-new-version). + #### pre-commit hooks It is highly recommended to use the provided pre-commit hooks, as the CI pipeline enforces all checks therein to pass in order to merge a branch. diff --git a/release/linux/build_installer_linux.sh b/release/linux/build_installer_linux.sh new file mode 100755 index 00000000..b0263187 --- /dev/null +++ b/release/linux/build_installer_linux.sh @@ -0,0 +1,24 @@ +#!/bin/bash +set -e -u + +# Build the installer for Linux. +# This script must be run from the root of the repository. + +CPU_OR_GPU=${1:-CPU} + +rm -rf dist build *.egg-info +rm -rf dist_pyinstaller build_pyinstaller + +# Creating the wheel +python setup.py sdist bdist_wheel + +# Setting up the local package +# Make sure you include the required extra packages and always use the stable or very-stable options! +pip install "dist/peptdeep-1.2.1-py3-none-any.whl[stable]" + +if [ "${CPU_OR_GPU}" != "GPU" ]; then + pip install torch -U --extra-index-url https://download.pytorch.org/whl/cpu +fi + +# Creating the stand-alone pyinstaller folder +pyinstaller release/pyinstaller/peptdeep.spec --distpath dist_pyinstaller --workpath build_pyinstaller -y diff --git a/release/linux/build_package_linux.sh b/release/linux/build_package_linux.sh new file mode 100755 index 00000000..ba69d641 --- /dev/null +++ b/release/linux/build_package_linux.sh @@ -0,0 +1,24 @@ +#!/bin/bash +set -e -u + +# Build the install package for Linux. +# This script must be run from the root of the repository after running build_installer_linux.sh + +PACKAGE_NAME=peptdeep + +# BUILD_NAME is taken from environment variables, e.g. 'peptdeep-1.2.1-linux-x64' +rm -rf ${BUILD_NAME}.deb + +# If needed, include additional source such as e.g.: +# cp ../../peptdeep/data/*.fasta dist/peptdeep/data +# WARNING: this probably does not work!!!! + +# Wrapping the pyinstaller folder in a .deb package +mkdir -p dist_pyinstaller/${BUILD_NAME}/usr/local/bin +mv dist_pyinstaller/${PACKAGE_NAME} dist_pyinstaller/${BUILD_NAME}/usr/local/bin/${PACKAGE_NAME} +mkdir dist_pyinstaller/${BUILD_NAME}/DEBIAN +cp release/linux/control dist_pyinstaller/${BUILD_NAME}/DEBIAN +dpkg-deb --build --root-owner-group dist_pyinstaller/${BUILD_NAME} + +# release workflow expects artifact at root of repository +mv dist_pyinstaller/${BUILD_NAME}.deb . diff --git a/release/one_click_linux_gui/control b/release/linux/control similarity index 100% rename from release/one_click_linux_gui/control rename to release/linux/control diff --git a/release/one_click_linux_gui/create_installer_linux.sh b/release/linux/create_installer_linux.sh old mode 100644 new mode 100755 similarity index 95% rename from release/one_click_linux_gui/create_installer_linux.sh rename to release/linux/create_installer_linux.sh index e6729ba3..26ab126f --- a/release/one_click_linux_gui/create_installer_linux.sh +++ b/release/linux/create_installer_linux.sh @@ -1,5 +1,5 @@ #!bash - +# TODO remove with old release workflow # Initial cleanup rm -rf dist rm -rf build @@ -15,7 +15,7 @@ conda activate peptdeep_installer python setup.py sdist bdist_wheel # Setting up the local package -cd release/one_click_linux_gui +cd release/linux # Make sure you include the required extra packages and always use the stable or very-stable options! pip install "../../dist/peptdeep-1.2.1-py3-none-any.whl[stable]" diff --git a/release/one_click_macos_gui/Info.plist b/release/macos/Info.plist similarity index 100% rename from release/one_click_macos_gui/Info.plist rename to release/macos/Info.plist diff --git a/release/one_click_macos_gui/Resources/conclusion.html b/release/macos/Resources/conclusion.html similarity index 100% rename from release/one_click_macos_gui/Resources/conclusion.html rename to release/macos/Resources/conclusion.html diff --git a/release/one_click_macos_gui/Resources/welcome.html b/release/macos/Resources/welcome.html similarity index 100% rename from release/one_click_macos_gui/Resources/welcome.html rename to release/macos/Resources/welcome.html diff --git a/release/macos/build_installer_macos.sh b/release/macos/build_installer_macos.sh new file mode 100755 index 00000000..9fda2e39 --- /dev/null +++ b/release/macos/build_installer_macos.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -e -u + +# Build the installer for MacOS. +# This script must be run from the root of the repository. + +rm -rf dist +rm -rf build + +# Creating the wheel +python setup.py sdist bdist_wheel +pip install "dist/peptdeep-1.2.1-py3-none-any.whl[stable]" + +# Creating the stand-alone pyinstaller folder +pyinstaller release/pyinstaller/peptdeep.spec --distpath dist_pyinstaller --workpath build_pyinstaller -y diff --git a/release/macos/build_package_macos.sh b/release/macos/build_package_macos.sh new file mode 100755 index 00000000..7ec0eabc --- /dev/null +++ b/release/macos/build_package_macos.sh @@ -0,0 +1,34 @@ +#!/bin/bash +set -e -u + +# Build the install package for MacOS. +# This script must be run from the root of the repository after running build_installer_macos.sh + +PACKAGE_NAME=peptdeep +# BUILD_NAME is taken from environment variables, e.g. peptdeep-1.2.1-macos-darwin-arm64 or peptdeep-1.2.1-macos-darwin-x64 +rm -rf ${BUILD_NAME}.pkg + +# If needed, include additional source such as e.g.: +# cp ../../peptdeep/data/*.fasta dist/peptdeep/data + +# Wrapping the pyinstaller folder in a .pkg package +CONTENTS_FOLDER=dist_pyinstaller/${PACKAGE_NAME}/Contents + +mkdir -p ${CONTENTS_FOLDER}/Resources +cp release/logos/alpha_logo.icns ${CONTENTS_FOLDER}/Resources +mv dist_pyinstaller/peptdeep_gui ${CONTENTS_FOLDER}/MacOS +cp release/macos/Info.plist ${CONTENTS_FOLDER} +cp release/macos/peptdeep_terminal ${CONTENTS_FOLDER}/MacOS +cp LICENSE.txt ${CONTENTS_FOLDER}/Resources +cp release/logos/alpha_logo.png ${CONTENTS_FOLDER}/Resources + +# link _internal folder containing the python libraries to the Frameworks folder where they are expected +# to avoid e.g. "Failed to load Python shared library '/Applications/AlphaMap.app/Contents/Frameworks/libpython3.8.dylib'" +cd ${CONTENTS_FOLDER} +ln -s ./MacOS/_internal ./Frameworks +cd - + +chmod 777 release/macos/scripts/* + +pkgbuild --root dist_pyinstaller/${PACKAGE_NAME} --identifier de.mpg.biochem.${PACKAGE_NAME}.app --version 1.2.1 --install-location /Applications/${PACKAGE_NAME}.app --scripts release/macos/scripts ${PACKAGE_NAME}.pkg +productbuild --distribution release/macos/distribution.xml --resources release/macos/Resources --package-path ${PACKAGE_NAME}.pkg ${BUILD_NAME}.pkg diff --git a/release/one_click_macos_gui/create_installer_macos.sh b/release/macos/create_installer_macos.sh similarity index 95% rename from release/one_click_macos_gui/create_installer_macos.sh rename to release/macos/create_installer_macos.sh index d42c581f..d8c88fdb 100644 --- a/release/one_click_macos_gui/create_installer_macos.sh +++ b/release/macos/create_installer_macos.sh @@ -1,4 +1,5 @@ #!bash +# TODO remove with old release workflow # Initial cleanup rm -rf dist @@ -19,7 +20,7 @@ conda activate peptdeepinstaller python setup.py sdist bdist_wheel # Setting up the local package -cd release/one_click_macos_gui +cd release/macos pip install "../../dist/peptdeep-1.2.1-py3-none-any.whl[stable]" # Creating the stand-alone pyinstaller folder diff --git a/release/one_click_macos_gui/distribution.xml b/release/macos/distribution.xml similarity index 100% rename from release/one_click_macos_gui/distribution.xml rename to release/macos/distribution.xml diff --git a/release/one_click_macos_gui/peptdeep_terminal b/release/macos/peptdeep_terminal similarity index 100% rename from release/one_click_macos_gui/peptdeep_terminal rename to release/macos/peptdeep_terminal diff --git a/release/one_click_macos_gui/scripts/postinstall b/release/macos/scripts/postinstall similarity index 100% rename from release/one_click_macos_gui/scripts/postinstall rename to release/macos/scripts/postinstall diff --git a/release/one_click_macos_gui/scripts/preinstall b/release/macos/scripts/preinstall similarity index 100% rename from release/one_click_macos_gui/scripts/preinstall rename to release/macos/scripts/preinstall diff --git a/release/pyinstaller/peptdeep.spec b/release/pyinstaller/peptdeep.spec index 3e9f8b9b..9cd0a520 100644 --- a/release/pyinstaller/peptdeep.spec +++ b/release/pyinstaller/peptdeep.spec @@ -205,7 +205,7 @@ elif sys.platform.startswith('win32'): upx_exclude=[], name=cli_name ) -else: +else: # macOS gui_exe = EXE( gui_pyz, gui_a.scripts, diff --git a/release/pypi/install_pypi_wheel.sh b/release/pypi/install_pypi_wheel.sh index 4c25f657..f9019a40 100644 --- a/release/pypi/install_pypi_wheel.sh +++ b/release/pypi/install_pypi_wheel.sh @@ -1,3 +1,4 @@ +# TODO remove with old release workflow conda create -n peptdeep_pip_test python=3.9 -y conda activate peptdeep_pip_test pip install "peptdeep[stable]" diff --git a/release/pypi/install_test_pypi_wheel.sh b/release/pypi/install_test_pypi_wheel.sh index 0140af63..51807c4d 100644 --- a/release/pypi/install_test_pypi_wheel.sh +++ b/release/pypi/install_test_pypi_wheel.sh @@ -1,3 +1,4 @@ +# TODO remove with old release workflow conda create -n peptdeep_pip_test python=3.9 -y conda activate peptdeep_pip_test pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple "peptdeep[stable]" diff --git a/release/pypi/prepare_pypi_wheel.sh b/release/pypi/prepare_pypi_wheel.sh index db29d210..a37c9e64 100644 --- a/release/pypi/prepare_pypi_wheel.sh +++ b/release/pypi/prepare_pypi_wheel.sh @@ -1,3 +1,4 @@ +# TODO remove with old release workflow cd ../.. conda create -n peptdeep_pypi_wheel python=3.9 conda activate peptdeep_pypi_wheel diff --git a/release/windows/build_installer_windows.ps1 b/release/windows/build_installer_windows.ps1 new file mode 100644 index 00000000..765d5be4 --- /dev/null +++ b/release/windows/build_installer_windows.ps1 @@ -0,0 +1,16 @@ +# Build the installer for Windows. +# This script must be run from the root of the repository. + +Remove-Item -Recurse -Force -ErrorAction SilentlyContinue ./build +Remove-Item -Recurse -Force -ErrorAction SilentlyContinue ./dist +Remove-Item -Recurse -Force -ErrorAction SilentlyContinue ./*.egg-info +Remove-Item -Recurse -Force -ErrorAction SilentlyContinue ./build_pyinstaller +Remove-Item -Recurse -Force -ErrorAction SilentlyContinue ./dist_pyinstaller + +# Creating the wheel +python setup.py sdist bdist_wheel +# Make sure you include the required extra packages and always use the stable or very-stable options! +pip install "dist/peptdeep-1.2.1-py3-none-any.whl[stable]" + +# Creating the stand-alone pyinstaller folder +pyinstaller release/pyinstaller/peptdeep.spec --distpath dist_pyinstaller --workpath build_pyinstaller -y diff --git a/release/windows/build_package_windows.ps1 b/release/windows/build_package_windows.ps1 new file mode 100644 index 00000000..289823ab --- /dev/null +++ b/release/windows/build_package_windows.ps1 @@ -0,0 +1,6 @@ +# Build the install package for Windows. +# This script must be run from the root of the repository after running build_installer_windows.ps1 + + +# Wrapping the pyinstaller folder in a .exe package +& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" .\release\windows\peptdeep_innoinstaller.iss diff --git a/release/one_click_windows_gui/create_installer_windows.sh b/release/windows/create_installer_windows.sh similarity index 92% rename from release/one_click_windows_gui/create_installer_windows.sh rename to release/windows/create_installer_windows.sh index f46b1a14..21abe9d4 100644 --- a/release/one_click_windows_gui/create_installer_windows.sh +++ b/release/windows/create_installer_windows.sh @@ -1,4 +1,5 @@ #!bash +# TODO remove with old release workflow # Initial cleanup rm -rf dist @@ -15,7 +16,7 @@ conda activate peptdeep_installer python setup.py sdist bdist_wheel # Setting up the local package -cd release/one_click_windows_gui +cd release/windows # Make sure you include the required extra packages and always use the stable or very-stable options! pip install "../../dist/peptdeep-1.2.1-py3-none-any.whl[stable]" @@ -28,5 +29,5 @@ conda deactivate # cp ../../peptdeep/data/*.fasta dist/peptdeep/data # Wrapping the pyinstaller folder in a .exe package -"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" peptdeep_innoinstaller.iss +"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" peptdeep_innoinstaller_old.iss # WARNING: this assumes a static location for innosetup diff --git a/release/windows/peptdeep_innoinstaller.iss b/release/windows/peptdeep_innoinstaller.iss new file mode 100644 index 00000000..c71fb45b --- /dev/null +++ b/release/windows/peptdeep_innoinstaller.iss @@ -0,0 +1,57 @@ +; Script generated by the Inno Setup Script Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +; Note: apparently, ISCC uses the directory of the .iss input file as the working directory, +; so all paths are given relative to the location of this .iss file. + +#define MyAppName "peptdeep" +#define MyAppVersion "1.2.1" +#define MyAppPublisher "Max Planck Institute of Biochemistry and the University of Copenhagen, Mann Labs" +#define MyAppURL "https://github.com/MannLabs/peptdeep" +#define MyAppExeName "peptdeep_gui.exe" +#define MyAppCLIExeName "peptdeep.exe" + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppId={{peptdeep_Mann_Labs_MPI_CPR} +AppName={#MyAppName} +AppVersion={#MyAppVersion} +;AppVerName={#MyAppName} {#MyAppVersion} +AppPublisher={#MyAppPublisher} +AppPublisherURL={#MyAppURL} +AppSupportURL={#MyAppURL} +AppUpdatesURL={#MyAppURL} +DefaultDirName={autopf}\{#MyAppName} +DisableProgramGroupPage=yes +LicenseFile=..\..\LICENSE.txt +; Uncomment the following line to run in non administrative install mode (install for current user only.) +PrivilegesRequired=lowest +PrivilegesRequiredOverridesAllowed=dialog +; release workflow expects artifact at root of repository +OutputDir=..\..\ +; example for BUILD_NAME: peptdeep-1.2.1-windows-amd64 +OutputBaseFilename={#GetEnv('BUILD_NAME')} +SetupIconFile=..\logos\alpha_logo.ico +Compression=lzma +SolidCompression=yes +WizardStyle=modern + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked + +[Files] +Source: "..\..\dist_pyinstaller\peptdeep_gui\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion +Source: "..\..\dist_pyinstaller\peptdeep_gui\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "..\..\dist_pyinstaller\peptdeep\{#MyAppCLIExeName}"; DestDir: "{app}"; Flags: ignoreversion +Source: "..\..\dist_pyinstaller\peptdeep\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +; NOTE: Don't use "Flags: ignoreversion" on any shared system files +[Icons] +Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" +Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon + +[Run] +Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent diff --git a/release/one_click_windows_gui/peptdeep_innoinstaller.iss b/release/windows/peptdeep_innoinstaller_old.iss similarity index 94% rename from release/one_click_windows_gui/peptdeep_innoinstaller.iss rename to release/windows/peptdeep_innoinstaller_old.iss index ff0bdd3e..7a7b7f1b 100644 --- a/release/one_click_windows_gui/peptdeep_innoinstaller.iss +++ b/release/windows/peptdeep_innoinstaller_old.iss @@ -1,6 +1,8 @@ ; Script generated by the Inno Setup Script Wizard. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! +# TODO remove with old release workflow + #define MyAppName "peptdeep" #define MyAppVersion "1.2.1" #define MyAppPublisher "Max Planck Institute of Biochemistry and the University of Copenhagen, Mann Labs" @@ -26,7 +28,8 @@ LicenseFile=..\..\LICENSE.txt PrivilegesRequired=lowest PrivilegesRequiredOverridesAllowed=dialog OutputDir=dist -OutputBaseFilename=peptdeep_gui_installer_windows +; example for BUILD_NAME: peptdeep-1.2.1-windows-amd64 +OutputBaseFilename={#GetEnv('BUILD_NAME')} SetupIconFile=..\logos\alpha_logo.ico Compression=lzma SolidCompression=yes