From 10d4a751da5e221a85ea68d60c4b658fa1c037be Mon Sep 17 00:00:00 2001 From: Ryan Clary <9618975+mrclary@users.noreply.github.com> Date: Fri, 3 Feb 2023 11:22:05 -0800 Subject: [PATCH 1/6] Add linux installer test --- .github/workflows/installers-conda.yml | 38 ++++++++++++++++++-------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/.github/workflows/installers-conda.yml b/.github/workflows/installers-conda.yml index 58ae1886622..690e1305db4 100644 --- a/.github/workflows/installers-conda.yml +++ b/.github/workflows/installers-conda.yml @@ -244,19 +244,35 @@ jobs: echo "PKG_GLOB=$PKG_GLOB" >> $GITHUB_ENV echo "PKG_BASE_NAME=$PKG_BASE_NAME" >> $GITHUB_ENV - - name: Test Application Bundle - if: runner.os == 'macOS' + - name: Test Installer Application run: | - installer -dumplog -pkg $PKG_PATH -target CurrentUserHomeDirectory 2>&1 - app_path=$HOME/Applications/Spyder.app - if [[ -e "$app_path" ]]; then - ls -al $app_path/Contents/MacOS - cat $app_path/Contents/Info.plist - echo "" - cat $app_path/Contents/MacOS/spyder-script - echo "" + if [[ $RUNNER_OS == "macOS" ]]; then + installer -dumplog -pkg $PKG_PATH -target CurrentUserHomeDirectory 2>&1 + app_path=$HOME/Applications/Spyder.app + if [[ -e "$app_path" ]]; then + ls -al $app_path/Contents/MacOS + cat $app_path/Contents/Info.plist + echo "" + cat $app_path/Contents/MacOS/spyder-script + echo "" + else + echo "$app_path does not exist" + fi + elif [[ $RUNNER_OS == "Linux" ]]; then + $PKG_PATH -b + shortcut_path=$HOME/.local/share/applications/spyder_spyder.desktop + if [[ -e $shortcut_path ]]; then + echo "Contents of" $HOME/.local/Spyder-* : + ls -al $HOME/.local/Spyder-* + echo "" + echo "Contents of $shortcut_path :" + cat $shortcut_path + echo "" + else + echo "$shortcut_path does not exist" + fi else - echo "$app_path does not exist" + echo "TEST WINDOWS INSTALLER HERE" fi - name: Notarize or Compute Checksum From fdf7f30c66190262c2de6f3d6a666362b8828a52 Mon Sep 17 00:00:00 2001 From: Ryan Clary <9618975+mrclary@users.noreply.github.com> Date: Sat, 18 Feb 2023 12:02:31 -0800 Subject: [PATCH 2/6] Add Windows installer test --- .github/workflows/installers-conda.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/installers-conda.yml b/.github/workflows/installers-conda.yml index 690e1305db4..4a3893214e0 100644 --- a/.github/workflows/installers-conda.yml +++ b/.github/workflows/installers-conda.yml @@ -272,7 +272,17 @@ jobs: echo "$shortcut_path does not exist" fi else - echo "TEST WINDOWS INSTALLER HERE" + cmd.exe /C start /wait "$PKG_PATH" /S + + ls -al $HOME/AppData/Local + ls -alr $HOME/AppData/Roaming + + shortcut_path="$HOME/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/spyder/Spyder.lnk" + if [[ -e $shortcut_path ]]; then + echo "$shortcut_path successfully created" + else + echo "$shortcut_path odes not exist" + fi fi - name: Notarize or Compute Checksum From fb0f7ace4bc2cb7f84c7811573b38a7c1d2fb7bc Mon Sep 17 00:00:00 2001 From: Ryan Clary <9618975+mrclary@users.noreply.github.com> Date: Thu, 23 Feb 2023 19:19:49 -0800 Subject: [PATCH 3/6] Exit with code 1 if shortcut paths don't exist --- .github/workflows/installers-conda.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/installers-conda.yml b/.github/workflows/installers-conda.yml index 4a3893214e0..a8b67d7e8f2 100644 --- a/.github/workflows/installers-conda.yml +++ b/.github/workflows/installers-conda.yml @@ -257,6 +257,7 @@ jobs: echo "" else echo "$app_path does not exist" + exit 1 fi elif [[ $RUNNER_OS == "Linux" ]]; then $PKG_PATH -b @@ -270,6 +271,7 @@ jobs: echo "" else echo "$shortcut_path does not exist" + exit 1 fi else cmd.exe /C start /wait "$PKG_PATH" /S @@ -282,6 +284,7 @@ jobs: echo "$shortcut_path successfully created" else echo "$shortcut_path odes not exist" + exit 1 fi fi From c445f1d72b393721639cfd2b8608c853dd455407 Mon Sep 17 00:00:00 2001 From: Ryan Clary <9618975+mrclary@users.noreply.github.com> Date: Thu, 23 Feb 2023 19:24:42 -0800 Subject: [PATCH 4/6] Build Windows installer on release --- .github/workflows/installers-conda.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/installers-conda.yml b/.github/workflows/installers-conda.yml index a8b67d7e8f2..721c5c0e69f 100644 --- a/.github/workflows/installers-conda.yml +++ b/.github/workflows/installers-conda.yml @@ -105,8 +105,6 @@ jobs: - name: Determine Build Matrix id: build-matrix run: | - [[ $IS_RELEASE == "true" ]] && BUILD_WIN="false" - if [[ $BUILD_MAC == "true" ]]; then target_platform="'osx-64'" include="{'os': 'macos-11', 'target-platform': 'osx-64'}" From b1da0ac41cedaca24f10b7de679f15a9b48c00b4 Mon Sep 17 00:00:00 2001 From: Ryan Clary <9618975+mrclary@users.noreply.github.com> Date: Fri, 24 Feb 2023 10:28:30 -0800 Subject: [PATCH 5/6] Provide ssh debugging --- .github/workflows/installers-conda.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/installers-conda.yml b/.github/workflows/installers-conda.yml index 721c5c0e69f..5f08f25a654 100644 --- a/.github/workflows/installers-conda.yml +++ b/.github/workflows/installers-conda.yml @@ -21,6 +21,11 @@ on: required: false default: true type: boolean + ssh: + description: 'Enable ssh debugging' + required: false + default: false + type: boolean mac: description: 'Build macOS installer' required: false @@ -50,6 +55,7 @@ env: BUILD_MAC: ${{ github.event_name != 'workflow_dispatch' || inputs.mac }} BUILD_LNX: ${{ github.event_name != 'workflow_dispatch' || inputs.linux }} BUILD_WIN: ${{ github.event_name != 'workflow_dispatch' || inputs.win }} + ENABLE_SSH: ${{ github.event_name == 'workflow_dispatch' && inputs.ssh }} jobs: build-noarch-pkgs: @@ -296,6 +302,16 @@ jobs: echo $(sha256sum $PKG_NAME) > "${PKG_GLOB}-sha256sum.txt" fi + - name: Setup Remote SSH Connection + # Notes: + # 1. This only works for conda, probably because it has the necessary + # MSYS2 packages to create the connection. + # 2. Check https://github.com/marketplace/actions/debugging-with-tmate for + # usage. + if: failure() || env.ENABLE_SSH + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 45 + - name: Upload Artifact if: env.IS_RELEASE == 'false' uses: actions/upload-artifact@v3 From fc63e2ea32f0cb4a9e0b3b5996b10e2bab22e983 Mon Sep 17 00:00:00 2001 From: Ryan Clary <9618975+mrclary@users.noreply.github.com> Date: Sat, 25 Feb 2023 10:25:50 -0800 Subject: [PATCH 6/6] Windows test to use cmd shell in separate step Tried the following: * cmd shell instead of bash * removing start /wait * cmd.exe -c * //C instead of /C Note: double forward slash required on CI when executing cmd.exe from bash, else only cmd.exe is executed and remainder is ignored; this is opposite of WSL on local VM in which double forward slash only executes cmd.exe, while single slash behaves as expected. --- .github/workflows/installers-conda.yml | 31 ++++++++++++++------------ 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/installers-conda.yml b/.github/workflows/installers-conda.yml index 5f08f25a654..73cf48230d1 100644 --- a/.github/workflows/installers-conda.yml +++ b/.github/workflows/installers-conda.yml @@ -248,7 +248,8 @@ jobs: echo "PKG_GLOB=$PKG_GLOB" >> $GITHUB_ENV echo "PKG_BASE_NAME=$PKG_BASE_NAME" >> $GITHUB_ENV - - name: Test Installer Application + - name: Test macOS & Linux Installers + if: runner.os != 'Windows' run: | if [[ $RUNNER_OS == "macOS" ]]; then installer -dumplog -pkg $PKG_PATH -target CurrentUserHomeDirectory 2>&1 @@ -277,20 +278,22 @@ jobs: echo "$shortcut_path does not exist" exit 1 fi - else - cmd.exe /C start /wait "$PKG_PATH" /S + fi - ls -al $HOME/AppData/Local - ls -alr $HOME/AppData/Roaming + - name: Test Windows Installer + if: runner.os == 'Windows' + shell: cmd + run: | + start /wait %PKG_PATH% /InstallationType=JustMe /NoRegistry=1 /S - shortcut_path="$HOME/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/spyder/Spyder.lnk" - if [[ -e $shortcut_path ]]; then - echo "$shortcut_path successfully created" - else - echo "$shortcut_path odes not exist" - exit 1 - fi - fi + set "shortcut_path=%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\spyder\Spyder.lnk" + if exist "%shortcut_path%" ( + echo "Spyder installed successfully" + ) else ( + echo "Spyder NOT installed successfully" + EXIT /B 1 + ) + EXIT /B %ERRORLEVEL% - name: Notarize or Compute Checksum if: env.IS_RELEASE == 'true' || env.IS_PRE == 'true' @@ -308,7 +311,7 @@ jobs: # MSYS2 packages to create the connection. # 2. Check https://github.com/marketplace/actions/debugging-with-tmate for # usage. - if: failure() || env.ENABLE_SSH + if: failure() && env.ENABLE_SSH == 'true' uses: mxschmitt/action-tmate@v3 timeout-minutes: 45