Skip to content

rc2 updates in version files #218

rc2 updates in version files

rc2 updates in version files #218

Workflow file for this run

name: Create release
on:
pull_request:
branches:
- release*
defaults:
run:
shell: bash
jobs:
installer:
timeout-minutes: 40
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
python-version: [3.8]
steps:
- name: Obtain SasView source from git
uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
### Caching of pip downloads and local wheel builds
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Obtain pip cache (macOS)
uses: actions/cache@v2
if: startsWith(runner.os, 'macOS')
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/test.yml') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-
- name: Obtain pip cache (Windows)
uses: actions/cache@v2
if: startsWith(runner.os, 'Windows')
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/test.yml') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-
### Installation of build-dependencies
- name: Install lxml and MPL (Linux + Win)
if: ${{ matrix.os != 'macos-latest' }}
run: |
python -m pip install matplotlib==2.2.5
python -m pip install lxml
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install wheel setuptools
python -m pip install numpy scipy==1.7.3 docutils "pytest<6" sphinx unittest-xml-reporting
python -m pip install tinycc h5py sphinx pyparsing html5lib reportlab==3.6.6 pybind11 appdirs
python -m pip install six numba mako ipython qtconsole==5.3.0 xhtml2pdf unittest-xml-reporting pylint
python -m pip install qt5reactor periodictable uncertainties debugpy "ipykernel<6"
- name: Install PyQt (Windows + Linux)
if: ${{ matrix.os != 'macos-latest' }}
run: |
python -m pip install PyQt5
- name: Install lxml, matplotlib and PyQt (OSX)
if: ${{ matrix.os == 'macos-latest' }}
run: |
python -m pip install PyQt5==5.13
python -m pip install matplotlib==3.4.3
python -m pip install --no-binary lxml lxml
- name: Install pyopencl (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
python -m pip install pytools mako cffi
choco install opencl-intel-cpu-runtime
choco install innosetup
python -m pip install --only-binary=pyopencl --find-links http://www.silx.org/pub/wheelhouse/ --trusted-host www.silx.org pyopencl
- name: Install pyopencl (Linux + macOS)
if: ${{ matrix.os != 'windows-latest' }}
run: |
python -m pip install pyopencl
- name: Install utilities to build installer
run: |
python -m pip install pyinstaller
### TODO: Bumps and sasmodels branches needs to be setup manually until we find better mechanism
- name: Fetch sources for sibling projects
run: |
git clone --depth=1 --branch=release_1.0.7 https://github.com/SasView/sasmodels.git ../sasmodels
git clone --depth=1 --branch=master https://github.com/bumps/bumps.git ../bumps
- name: Build and install sasmodels
run: |
cd ../sasmodels
rm -rf build
rm -rf dist
python setup.py clean
python setup.py build
python -m pip install .
- name: Build and install bumps
run: |
cd ../bumps
rm -rf build
rm -rf dist
python setup.py clean
python setup.py build
python -m pip install .
### Actual building/testing of sasview
- name: Build sasview
run: |
# SET SASVIEW GITHASH
githash=$( git rev-parse HEAD )
sed -i.bak s/GIT_COMMIT/$githash/g src/sas/sasview/__init__.py
# BUILD SASVIEW
python setup.py clean
python setup.py build
python -m pip install .
- name: Build sasmodels and bumps docs
run: |
make -C ../bumps/doc html || true
mkdir -p ~/.sasmodels/compiled_models
make -j4 -C ../sasmodels/doc html || true
- name: Build sasview docs
run: |
cd docs/sphinx-docs/
python build_sphinx.py || true
### Build the installer
- name: Build sasview with pyinstaller
run: |
cd installers
pyinstaller sasview.spec
- name: Build sasview with INNO setup package (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
iscc installers/installer.iss
- name: Publish installer package (Windows)
if: ${{ matrix.os == 'windows-latest' }}
uses: actions/upload-artifact@v2
with:
name: SasView-Installer-${{ matrix.os }}-${{ matrix.python-version }}-${{ github.sha }}
path: installers/Output/setupSasView.exe
if-no-files-found: error
- name: Create dmg file (OSX)
if: ${{ matrix.os == 'macos-latest' }}
run: |
cd installers/dist
hdiutil create SasView5.dmg -srcfolder SasView5.app -ov -format UDZO
- name: Sign executable and create dmg (OSX)
if: ${{ matrix.os == 'macos-latest' }}
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/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: Notarize Release Build (OSX)
if: ${{ matrix.os == 'macos-latest' }}
uses: GuillaumeFalourd/xcode-notarize@v1
with:
product-path: "installers/dist/SasView5.dmg"
primary-bundle-id: "org.sasview.SasView5"
appstore-connect-username: ${{ secrets.NOTARIZATION_USERNAME }}
appstore-connect-password: ${{ secrets.NOTARIZATION_PASSWORD }}
verbose: True
- name: Staple Release Build (OSX)
if: ${{ matrix.os == 'macos-latest' }}
uses: devbotsxyz/xcode-staple@v1
with:
product-path: "installers/dist/SasView5.dmg"
- name: Publish installer package (OSX)
if: ${{ matrix.os == 'macos-latest' }}
uses: actions/upload-artifact@v2
with:
name: SasView-Installer-${{ matrix.os }}-${{ matrix.python-version }}-${{ github.sha }}
path: installers/dist/SasView5.dmg
if-no-files-found: error