diff --git a/.github/workflows/legacy_create_release.yml b/.github/workflows/legacy_create_release.yml deleted file mode 100644 index 161d9898..00000000 --- a/.github/workflows/legacy_create_release.yml +++ /dev/null @@ -1,201 +0,0 @@ -# TODO delete once the new release workflow has run once -on: - workflow_dispatch: - inputs: - commit_to_release: - description: 'Enter commit hash to release (example: ef4037cb571f99cb4919b520fde7174972aae473)' - required: true - tag_to_release: - description: 'Enter tag to release (example: v1.5.5)' - required: true - - -name: LEGACY Create Draft Release - -jobs: - Get_New_Version: - runs-on: ubuntu-latest - outputs: - new_version: ${{ steps.check_release_tag.outputs.new_version }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - ref: ${{ inputs.commit_to_release }} - - - name: Check release tag - id: check_release_tag - shell: bash -le {0} - run: | - CURRENT_VERSION=$(./misc/get_current_version.sh) - if [ "v${CURRENT_VERSION}" != "${{ inputs.tag_to_release }}" ]; then - echo Code version "v${CURRENT_VERSION}" does not match the tag to release ${{ inputs.tag_to_release }} - exit 1 - fi - echo "new_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT - - - uses: mukunku/tag-exists-action@v1.6.0 - id: check-tag - with: - tag: ${{ inputs.tag_to_release }} - - - name: Check if tag already exists - run: | - echo "Tag already exists!" - exit 1 - if: steps.check-tag.outputs.exists == 'true' - - - Create_Draft_Release: - runs-on: ubuntu-latest - needs: Get_New_Version - outputs: - upload_url: ${{ steps.draft_release.outputs.upload_url }} - steps: - - name: Draft Release - id: draft_release - # TODO this action is deprecated, replace with https://github.com/ncipollo/release-action - # cf. https://github.com/actions/create-release/issues/119#issuecomment-783010321 - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ inputs.tag_to_release }} - release_name: ${{ inputs.tag_to_release }} - draft: true - prerelease: false - - Create_MacOS_Installer: - needs: [Create_Draft_Release, Get_New_Version] - env: - ARCH: x64 - EAGER_IMPORT: true - runs-on: macos-latest-xlarge - steps: - - name : Checkout code - uses: actions/checkout@v4 - with: - ref: ${{ inputs.commit_to_release }} - - # Build backend - - name: Install conda - uses: conda-incubator/setup-miniconda@v3 - with: - miniconda-version: "latest" - auto-update-conda: true - activate-environment: alpha - python-version: "3.11" - - - name: Check arm64 - shell: bash -el {0} - run: | - python -c "import platform; print(platform.machine())" - - - name: Build backend - shell: bash -el {0} - run: | - release/macos/build_backend_macos.sh - - - name: Test backend - shell: bash -el {0} - run: | - dist/alphadia/alphadia --version - - # Build GUI - - name: Setup Node.js - uses: actions/setup-node@v4 - - - name: Build GUI - run: | - release/macos/build_gui_macos.sh - - # combine backend and GUI - - name: Build package - shell: bash -el {0} - run: | - release/macos/build_pkg_macos.sh - - - name: List output files - run: | - ls dist - - # Upload the package - - name: Upload a Release Asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.Create_Draft_Release.outputs.upload_url }} - asset_path: dist/alphadia-${{ needs.Get_New_Version.outputs.new_version }}-darwin-${{ env.ARCH }}.pkg - asset_name: alphadia-${{ needs.Get_New_Version.outputs.new_version }}-darwin-${{ env.ARCH }}.pkg - asset_content_type: application/zip - - Create_Windows_Installer: - needs: [Create_Draft_Release, Get_New_Version] - env: - ARCH: x64 - runs-on: windows-latest - steps: - - name : Checkout code - uses: actions/checkout@v4 - with: - ref: ${{ inputs.commit_to_release }} - - # Build backend - - name: Install conda - uses: conda-incubator/setup-miniconda@v3 - with: - miniconda-version: "latest" - auto-update-conda: true - activate-environment: alpha - python-version: "3.11" - - - name: Build Backend - shell: powershell - run: | - release/windows/build_backend.ps1 - - - name: Test Backend - shell: powershell - run: | - dist\alphadia\alphadia.exe --version - - # Build GUI - - name: Setup Node.js - uses: actions/setup-node@v4 - - - name: Build GUI - shell: powershell - run: | - release/windows/build_gui.ps1 - - # combine backend and GUI - - name: Check if Innosetup is installed - shell: powershell - run: | - if (-not (Test-Path "C:\Program Files (x86)\Inno Setup 6\ISCC.exe")) { - Write-Host "Inno Setup is not installed" - exit 1 - } - else { - Write-Host "Inno Setup is installed" - } - - - name: Build Installer - shell: powershell - run: | - release/windows/build_installer.ps1 - - - name: List output files - run: | - ls dist - - - name: Upload a Release Asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.Create_Draft_Release.outputs.upload_url }} - asset_path: dist/alphadia-${{ needs.Get_New_Version.outputs.new_version }}-win-${{ env.ARCH }}.exe - asset_name: alphadia-${{ needs.Get_New_Version.outputs.new_version }}-win-${{ env.ARCH }}.exe - asset_content_type: application/zip diff --git a/.github/workflows/legacy_publish_on_pypi.yml b/.github/workflows/legacy_publish_on_pypi.yml deleted file mode 100644 index 2efb2470..00000000 --- a/.github/workflows/legacy_publish_on_pypi.yml +++ /dev/null @@ -1,126 +0,0 @@ -# TODO delete once the new release workflow has run once -on: - workflow_dispatch: - inputs: - tag_to_release: - description: 'Enter tag to release (example: v1.5.5)' - required: true - -name: LEGACY Publish on PyPi - -env: - PYTHON_VERSION: "3.11" - -jobs: - Create_PyPi_Release: - runs-on: ubuntu-latest - outputs: - new_version: ${{ steps.get_current_version.outputs.new_version }} - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ inputs.tag_to_release }} - - uses: conda-incubator/setup-miniconda@v3 - with: - miniconda-version: "latest" - auto-update-conda: true - python-version: ${{ env.PYTHON_VERSION }} - - name: Conda info - shell: bash -le {0} - run: conda info - - name: Get current version - id: get_current_version - shell: bash -l {0} - run: | - CURRENT_VERSION=$(./misc/get_current_version.sh) - echo "new_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT - - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }} - - name: Prepare distribution - shell: bash -le {0} - run: | - conda create -n alphadia_build python=${{ env.PYTHON_VERSION }} -y - conda activate alphadia_build - python -m pip install --upgrade pip - pip install build twine - rm -rf dist - rm -rf build - python -m build - twine check dist/* - conda deactivate - conda env remove --name alphadia_build -y - conda clean --all -y - - name: Publish distribution to Test-PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ - user: __token__ - password: ${{ secrets.TEST_PYPI_API_TOKEN }} - - name: Test Test-PyPI loose installation - shell: bash -le {0} - run: | - conda create -n pip_loose_test python=${{ env.PYTHON_VERSION }} -y - conda activate pip_loose_test - pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple "alphadia==${{ steps.get_current_version.outputs.new_version }}" - alphadia -v - conda deactivate - conda env remove --name pip_stable_test -y - conda clean --all -y - - name: Test Test-PyPI stable installation - shell: bash -le {0} - run: | - conda create -n pip_stable_test python=${{ env.PYTHON_VERSION }} -y - conda activate pip_stable_test - pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple "alphadia[stable]==${{ steps.get_current_version.outputs.new_version }}" - alphadia -v - conda deactivate - conda env remove --name pip_stable_test -y - conda clean --all -y - - name: Publish distribution to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} - Test_PyPi_Release: - name: Test_PyPi_version_on_${{ matrix.os }} - runs-on: ${{ matrix.os }} - needs: Create_PyPi_Release - strategy: - matrix: - os: [ubuntu-latest, macOS-latest, windows-latest] - steps: - - uses: actions/checkout@v4 - - uses: conda-incubator/setup-miniconda@v3 - with: - miniconda-version: "latest" - auto-update-conda: true - python-version: ${{ env.PYTHON_VERSION }} - - name: Conda info - shell: bash -le {0} - run: conda info - - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }} - - name: Test PyPI stable installation - shell: bash -le {0} - run: | - conda create -n pip_stable python=${{ env.PYTHON_VERSION }} -y - conda activate pip_stable - pip install "alphadia[stable]==${{ needs.Create_PyPi_Release.outputs.new_version }}" - alphadia -v - conda deactivate - conda env remove --name pip_stable -y - conda clean --all -y - - name: Test PyPI loose installation - shell: bash -le {0} - run: | - conda create -n pip_loose python=${{ env.PYTHON_VERSION }} -y - conda activate pip_loose - pip install alphadia==${{ needs.Create_PyPi_Release.outputs.new_version }} - alphadia -v - conda deactivate - conda env remove --name pip_loose -y - conda clean --all -y diff --git a/misc/.bumpversion.cfg b/misc/.bumpversion.cfg index f51e7b54..f9a7dadd 100644 --- a/misc/.bumpversion.cfg +++ b/misc/.bumpversion.cfg @@ -29,18 +29,11 @@ serialize = [bumpversion:file:../release/macos/build_package_macos.sh] -[bumpversion:file:../release/macos/build_backend_macos.sh] - -[bumpversion:file:../release/macos/build_pkg_macos.sh] - [bumpversion:file:../release/macos/distribution.xml] [bumpversion:file:../release/windows/alphadia_innoinstaller.iss] -[bumpversion:file:../release/windows/alphadia_innoinstaller_old.iss] - [bumpversion:file:../release/windows/build_installer_windows.ps1] -[bumpversion:file:../release/windows/build_backend.ps1] search = {current_version} replace = {new_version} diff --git a/release/macos/build_backend_macos.sh b/release/macos/build_backend_macos.sh deleted file mode 100755 index ea713320..00000000 --- a/release/macos/build_backend_macos.sh +++ /dev/null @@ -1,10 +0,0 @@ -# TODO remove with old release workflow - -# navigate to the root directory - -python -m build -pip install "dist/alphadia-1.8.0-py3-none-any.whl[stable]" - -# Creating the stand-alone pyinstaller folder -pip install pyinstaller -pyinstaller release/pyinstaller/alphadia.spec -y diff --git a/release/macos/build_pkg_macos.sh b/release/macos/build_pkg_macos.sh deleted file mode 100755 index 1f2a7bd6..00000000 --- a/release/macos/build_pkg_macos.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash -# TODO remove with old release workflow - -# Set up package name and version -PACKAGE_NAME="alphadia" -PACKAGE_VERSION="1.8.0" - -ARCH=$(uname -m) -if [ "$ARCH" == "x86_64" ]; then - ARCH="x64" -fi -echo "ARCH=${ARCH}" >> $GITHUB_ENV - -KERNEL=$(uname -s | tr '[:upper:]' '[:lower:]') - -BUILD_NAME="${PACKAGE_NAME}-${PACKAGE_VERSION}-${KERNEL}-${ARCH}" - -PKG_FOLDER="dist/alphadia.app" - -# Cleanup the package folder -echo "Cleaning up the package folder" - -rm -rf $PKG_FOLDER - -# === Prepare structure === -echo "Preparing package structure" - -mkdir -p $PKG_FOLDER -mkdir -p $PKG_FOLDER/Contents/Resources -mkdir -p $PKG_FOLDER/Contents/MacOS -mkdir -p $PKG_FOLDER/Contents/Frameworks - - - -# === Backend === -echo "Copying backend" - -BACKEND_BUILD="dist/alphadia" - -# Check if the backend build exists, otherwise exit with an error -if [ ! -d "$BACKEND_BUILD" ]; then - echo "Backend build not found at $BACKEND_BUILD" - exit 1 -fi - -# Copy the backend -cp -a ${BACKEND_BUILD}/. $PKG_FOLDER/Contents/Frameworks/ - - -# === GUI === -echo "Copying GUI" - -ls ./gui/out - -# Set the path to the GUI build -GUI_BUILD="./gui/out/alphadia-gui-${KERNEL}-${ARCH}" - -# Check if the GUI build exists, otherwise exit with an error -if [ ! -d "$GUI_BUILD" ]; then - echo "GUI build not found at $GUI_BUILD" - exit 1 -fi - -# Copy the electron forge build -cp -a ${GUI_BUILD}/. $PKG_FOLDER/Contents/Frameworks/ - -# === Resources === -echo "Copying resources" -cp release/logos/alphadia.icns $PKG_FOLDER/Contents/Resources/ -cp release/logos/alphadia.png $PKG_FOLDER/Contents/Resources/ -cp release/macos/alphadia $PKG_FOLDER/Contents/MacOS/ - -cp release/macos/Info.plist $PKG_FOLDER/Contents/ - -#change permissions for entry script -chmod +x $PKG_FOLDER/Contents/MacOS/alphadia - -pkgbuild --root $PKG_FOLDER --identifier de.mpg.biochem.alphadia.app --version $PACKAGE_VERSION --install-location /Applications/alphadia.app --scripts release/macos/scripts dist/$BUILD_NAME.pkg --nopayload diff --git a/release/windows/alphadia_innoinstaller_old.iss b/release/windows/alphadia_innoinstaller_old.iss deleted file mode 100644 index 58f0ef86..00000000 --- a/release/windows/alphadia_innoinstaller_old.iss +++ /dev/null @@ -1,54 +0,0 @@ -; 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 "AlphaDIA" -#define MyAppVersion "1.8.0" -#define MyAppPublisher "Max Planck Institute of Biochemistry, Mann Labs" -#define MyAppURL "https://github.com/MannLabs/alphadia" -#define MyAppExeName "alphadia-gui.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={{alphadia_Mann_Labs_MPI} -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 -OutputDir=..\..\dist -; example for BUILD_NAME: alphadia-1.9.0-win-x64 -OutputBaseFilename={#GetEnv('BUILD_NAME')} -SetupIconFile=..\logos\alphadia.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: "..\..\gui\out\alphadia-gui-win32-x64\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion -Source: "..\..\gui\out\alphadia-gui-win32-x64\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs -Source: "..\..\dist\alphadia\*"; 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/windows/build_backend.ps1 b/release/windows/build_backend.ps1 deleted file mode 100644 index 82543623..00000000 --- a/release/windows/build_backend.ps1 +++ /dev/null @@ -1,12 +0,0 @@ -# TODO remove with old release workflow - -Remove-Item -Recurse -Force -ErrorAction SilentlyContinue ./build -Remove-Item -Recurse -Force -ErrorAction SilentlyContinue ./dist - -pip install build -python -m build -pip install "dist/alphadia-1.8.0-py3-none-any.whl[stable]" - -# Creating the stand-alone pyinstaller folder -pip install pyinstaller tbb -pyinstaller release/pyinstaller/alphadia.spec -y diff --git a/release/windows/build_gui.ps1 b/release/windows/build_gui.ps1 deleted file mode 100644 index 8503d72f..00000000 --- a/release/windows/build_gui.ps1 +++ /dev/null @@ -1,14 +0,0 @@ -# TODO remove with old release workflow - -# Powershell script to build the GUI for Windows - -cd gui -# delete old build using powershell -Remove-Item -Recurse -Force -ErrorAction SilentlyContinue ./out -Remove-Item -Recurse -Force -ErrorAction SilentlyContinue ./dist - - -npm install -npm run make - -cd .. diff --git a/release/windows/build_installer.ps1 b/release/windows/build_installer.ps1 deleted file mode 100644 index feb8e965..00000000 --- a/release/windows/build_installer.ps1 +++ /dev/null @@ -1,4 +0,0 @@ -# TODO remove with old release workflow - - -& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" .\release\windows\alphadia_innoinstaller_old.iss