Skip to content

Commit

Permalink
Merge pull request #2900 from SasView/release_6_into_main
Browse files Browse the repository at this point in the history
Merge release_6.0.0 branch into main
  • Loading branch information
lucas-wilkins authored Jul 2, 2024
2 parents bd57dab + 6cf920a commit cd857c0
Show file tree
Hide file tree
Showing 104 changed files with 16,478 additions and 2,523 deletions.
88 changes: 73 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ jobs:

steps:
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: 3.11

- uses: actions/checkout@v3
- uses: actions/checkout@v4
- id: set-matrix
run: python .github/workflows/matrix.py >> $GITHUB_OUTPUT

Expand All @@ -65,10 +65,10 @@ jobs:
echo '${{ toJson(matrix) }}'
- name: Obtain SasView source from git
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
Expand Down Expand Up @@ -202,7 +202,7 @@ jobs:
- name: Install utilities to build installer
if: ${{ matrix.installer }}
run: |
python -m pip install pyinstaller==5.13.2
python -m pip install pyinstaller
- name: Build sasview with pyinstaller
if: ${{ matrix.installer }}
Expand Down Expand Up @@ -238,7 +238,7 @@ jobs:
- name: Collect a debug tarball of the installer package
if: ${{ matrix.installer }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Debug-SasView-Installer-${{ matrix.os }}-${{ matrix.python-version }}
path: |
Expand All @@ -248,33 +248,91 @@ jobs:
- name: Sign executable and create dmg (OSX)
if: ${{ matrix.installer && startsWith(matrix.os, 'macos') }}
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE_ISA }}
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_ISA_PWD }}
run: |
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
security create-keychain -p DloaAcYP build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p DloaAcYP build.keychain
security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k DloaAcYP build.keychain
security find-identity -p codesigning
cd installers/dist
python ../../build_tools/fix_qt_folder_names_for_codesign.py SasView6.app
python ../../build_tools/code_sign_osx.py
codesign --verify --options=runtime --entitlements ../../build_tools/entitlements.plist --timestamp --deep --verbose=4 --force --sign "Developer ID Application: European Spallation Source Eric (W2AG9MPZ43)" SasView6.app
codesign --verify --options=runtime --entitlements ../../build_tools/entitlements.plist --timestamp --deep --verbose=4 --force --sign "Developer ID Application: The International Scattering Alliance (8CX8K63BQM)" SasView6.app
hdiutil create SasView6.dmg -srcfolder SasView6.app -ov -format UDZO
codesign -s "Developer ID Application: European Spallation Source Eric (W2AG9MPZ43)" SasView6.dmg
codesign -s "Developer ID Application: The International Scattering Alliance (8CX8K63BQM)" SasView6.dmg
- name: Notarize Release Build (OSX)
if: ${{ matrix.installer && startsWith(matrix.os, 'macos') }}
uses: lando/notarize-action@v2
with:
product-path: "installers/dist/SasView6.dmg"
primary-bundle-id: "org.sasview.SasView6"
appstore-connect-username: ${{ secrets.NOTARIZATION_USERNAME }}
appstore-connect-password: ${{ secrets.NOTARIZATION_PASSWORD }}
appstore-connect-team-id: W2AG9MPZ43
verbose: True

- name: Staple Release Build (OSX)
if: ${{ matrix.installer && startsWith(matrix.os, 'macos') }}
uses: BoundfoxStudios/action-xcode-staple@v1
with:
product-path: "installers/dist/SasView6.dmg"

- name: Sign binary
if: ${{ matrix.installer && startsWith(matrix.os, 'windows') }}
uses: lando/code-sign-action@v2
with:
file: installers/dist/setupSasView.exe
certificate-data: ${{ secrets.WINDOZE_CERT_DATA }}
certificate-password: ${{ secrets.WINDOZE_CERT_PASSWORD }}
keylocker-host: ${{ secrets.KEYLOCKER_HOST }}
keylocker-api-key: ${{ secrets.KEYLOCKER_API_KEY }}
keylocker-cert-sha1-hash: ${{ secrets.KEYLOCKER_CERT_SHA1_HASH }}

- name: Publish installer package
if: ${{ matrix.installer }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: SasView-Installer-${{ matrix.os }}-${{ matrix.python-version }}
path: |
installers/dist/setupSasView.exe
installers/dist/SasView6.dmg
installers/dist/sasview6.tar.gz
if-no-files-found: error
if-no-files-found: ignore

- name: Rename artifacts (Windows)
if: ${{ matrix.installer && startsWith(matrix.os, 'windows') }}
run: |
mv installers/dist/setupSasView.exe installers/dist/setupSasView-6.0.0-alpha-Win64.exe
- name: Rename artifacts (MacOS)
if: ${{ matrix.installer && startsWith(matrix.os, 'macos') }}
run: |
mv installers/dist/SasView6.dmg installers/dist/SasView-6.0.0-alpha-MacOSX.dmg
- name: Rename artifacts (Linux)
if: ${{ matrix.installer && startsWith(matrix.os, 'ubuntu') }}
run: |
mv installers/dist/sasview6.tar.gz installers/dist/SasView-6.0.0-alpha-Linux.tar.gz
- name: Upload Release Installer to GitHub
if: ${{ matrix.installer }}
uses: ncipollo/release-action@v1
with:
draft: false
prerelease: true
allowUpdates: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "installers/dist/*SasView-6.0.0-*"
name: "Release 6.0.0-alpha"
bodyFile: "build_tools/release_notes/6.0.0_notes.txt"
tag: "v6.0.0-alpha"

test-installer:
needs: [ build-matrix ]
Expand Down Expand Up @@ -315,7 +373,7 @@ jobs:

- name: Retrieve installer (workflow image)
if: ${{ env.INSTALLER_USE_OLD_IMAGE != 'true' }}
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
id: download
with:
name: SasView-Installer-${{ matrix.os }}-${{ matrix.python-version }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@

# List of python versions to use for tests
python_test_list = python_release_list + [
'3.9',
'3.10'
]

Expand Down
29 changes: 27 additions & 2 deletions .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Retrieve saved artifacts
uses: actions/download-artifact@v3
Expand All @@ -34,7 +34,32 @@ jobs:
run: ls -R
working-directory: installers/dist

- name: Rename remaining artifacts artifacts
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Sign executable and create dmg (OSX)
if: ${{ matrix.installer && startsWith(matrix.os, 'macos') }}
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
run: |
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
security create-keychain -p DloaAcYP build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p DloaAcYP build.keychain
security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k DloaAcYP build.keychain
cd installers/dist
python ../../build_tools/fix_qt_folder_names_for_codesign.py SasView5.app
python ../../build_tools/code_sign_osx.py
codesign --verify --options=runtime --entitlements ../../build_tools/entitlements.plist --timestamp --deep --verbose=4 --force --sign "Developer ID Application: European Spallation Source Eric (W2AG9MPZ43)" SasView5.app
hdiutil create SasView5.dmg -srcfolder SasView5.app -ov -format UDZO
codesign -s "Developer ID Application: European Spallation Source Eric (W2AG9MPZ43)" SasView5.dmg
- name: Rename artifacts
run: |
mv installers/dist/SasView-Installer-windows-*/setupSasView.exe installers/dist/setupSasView-nightly-Win64.exe
mv installers/dist/SasView-Installer-macos-*/SasView6.dmg installers/dist/SasView-nightly-MacOSX.dmg
Expand Down
3 changes: 1 addition & 2 deletions LICENSE.TXT
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Copyright (c) 2009-2023, SasView Developers

Copyright (c) 2009-2024, SasView Developers

All rights reserved.

Expand Down
4 changes: 2 additions & 2 deletions build_tools/code_sign_osx.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
#pyside_libs = pyside_QtWebEngineCore + pyside_QtWebEngineProcess

sign_command = ['codesign', '--timestamp', '--options=runtime', '--verify', '--verbose=4', '--force',
'--sign', 'Developer ID Application: European Spallation Source Eric (W2AG9MPZ43)']
'--sign', 'Developer ID Application: The International Scattering Alliance (8CX8K63BQM)']

sign_deep_command = ['codesign', '--timestamp', '--deep', '--options=runtime', '--verify', '--verbose=4', '--force',
'--sign', 'Developer ID Application: European Spallation Source Eric (W2AG9MPZ43)']
'--sign', 'Developer ID Application: The International Scattering Alliance (8CX8K63BQM)']

#Signing QtWebEngineProcess.app first as it is a helper app
for sfile in itertools.chain(pyside_QtWebEngineProcessApp):
Expand Down
52 changes: 52 additions & 0 deletions build_tools/get_external_dependencies.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import requests
from enum import Enum

class OS(Enum):
WIN = 0
LINUX = 1
MAC = 2
UNKNOWN = 3

def get_os():
"""
Get the operating system of the current machine.
"""
import platform
if platform.system() == "Windows":
return OS.WIN
elif platform.system() == "Linux":
return OS.LINUX
elif platform.system() == "Darwin":
return OS.MAC
return OS.UNKNOWN

def get_ausaxs():
_os = get_os()
url = "https://github.com/SasView/AUSAXS/releases/latest/download/"
libs = None
if _os == OS.WIN:
libs = ["libausaxs.dll"]
elif _os == OS.LINUX:
libs = ["libausaxs.so"]
elif _os == OS.MAC:
libs = ["libausaxs.dylib"]
if libs is not None:
# we have to use a relative path since the package is not installed yet
base_loc = "src/sas/sascalc/calculator/ausaxs/lib/"
for lib in libs:
response = requests.get(url+lib)

# disable macos for now by renaming the local file
if _os is OS.MAC:
lib = "libausaxs.dylib"

with open(base_loc+lib, "wb") as f:
f.write(response.content)

def fetch_external_dependencies():
#surround with try/except to avoid breaking the build if the download fails
try:
get_ausaxs()
except Exception as e:
print("Download of external dependencies failed.", e)
return
Loading

0 comments on commit cd857c0

Please sign in to comment.