added none check to avoid blowup #465 #111
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: create apps | |
on: | |
push: | |
tags: | |
- '*' | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
create_release: | |
name: Create Release | |
runs-on: ubuntu-latest | |
outputs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Generate changelog | |
id: changelog | |
uses: metcalfc/[email protected] | |
with: | |
myToken: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
body: ${{ steps.changelog.outputs.changelog }} | |
draft: false | |
prerelease: true | |
build: | |
name: Create Binaries | |
needs: create_release | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, macos-13, windows-2022 ] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install build dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pipenv | |
pipenv install -d | |
pip list | |
pipenv run pip list | |
- name: pytest | |
run: | | |
PYTHONPATH=./src/main/python pipenv run pytest --cov=./src/main/python | |
- name: Install packaging dependencies | |
run: | | |
if [[ "$RUNNER_OS" == "Linux" ]] | |
then | |
sudo apt install -y libblas-dev liblapack-dev libsndfile1 graphviz | |
sudo apt-get install -y xvfb libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0 libxcb-util1 libxcb-xkb1 libxcb-shape0 | |
elif [[ "$RUNNER_OS" == "Windows" ]] | |
then | |
choco install openssl.light graphviz | |
elif [[ "$RUNNER_OS" == "macOS" ]] | |
then | |
brew install graphviz | |
brew ls -v graphviz | |
fi | |
pipenv run pip install pyinstaller | |
- name: Get latest release version number | |
id: get_version | |
uses: battila7/get-version-action@v2 | |
- name: Set version | |
run: | | |
echo ${{ steps.get_version.outputs.version-without-v }} > src/main/python/VERSION | |
- name: Create distribution | |
id: create_dist | |
run: | | |
export QT_DEBUG_PLUGINS=1 | |
export DISPLAY=:0 | |
sudo /usr/bin/Xvfb $DISPLAY -screen 0 1280x1024x24 & | |
pipenv run pyinstaller --clean --log-level=INFO beqdesigner.spec | |
if [[ "$RUNNER_OS" == "macOS" ]] | |
then | |
pushd dist | |
rm beqdesigner | |
zip -r beqdesigner.app.zip_$(sw_vers -productVersion) beqdesigner.app | |
rm -Rf beqdesigner.app | |
popd | |
MATCHES=( dist/beqdesigner.app.zip_* ) | |
echo "binary_path=${MATCHES[0]}" >> $GITHUB_OUTPUT | |
echo "binary_name=${MATCHES[0]:5}" >> $GITHUB_OUTPUT | |
echo "binary_content_type=application/zip" >> $GITHUB_OUTPUT | |
elif [[ "$RUNNER_OS" == "Windows" ]] | |
then | |
MATCHES=( dist/beqdesigner_* ) | |
echo "binary_path=${MATCHES[0]}" >> $GITHUB_OUTPUT | |
echo "binary_name=${MATCHES[0]:5}" >> $GITHUB_OUTPUT | |
echo "binary_content_type=application/vnd.microsoft.portable-executable" >> $GITHUB_OUTPUT | |
else | |
MATCHES=( dist/beqdesigner_* ) | |
echo "binary_path=${MATCHES[0]}" >> $GITHUB_OUTPUT | |
echo "binary_name=${MATCHES[0]:5}" >> $GITHUB_OUTPUT | |
echo "binary_content_type=application/octet-stream" >> $GITHUB_OUTPUT | |
fi | |
- name: Upload beqdesigner | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.create_release.outputs.upload_url }} | |
asset_name: ${{ steps.create_dist.outputs.binary_name }} | |
asset_path: ${{ steps.create_dist.outputs.binary_path }} | |
asset_content_type: ${{ steps.create_dist.outputs.binary_content_type }} |