Dioptas/.github/workflows/build_mac.yml

86 lines
2.3 KiB
YAML

# This is a basic workflow to help you get started with Actions
name: CD_MACOS
on: [push]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build_macos:
# The type of runner that the job will run on
runs-on: macos-latest
env:
folder_name: 'DioptasMac'
PYINSTALLER_COMPILE_BOOTLOADER: 1
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- run: git fetch --prune --unshallow
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Setup Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'poetry'
- name: Install poetry dependencies
run: poetry install
- name: Install PyInstaller
run: poetry run pip install git+https://github.com/pyinstaller/pyinstaller.git@develop
- name: Add Dynamic Versioning Plugin
run: poetry self add poetry-dynamic-versioning[plugin]
- name: Update the Version
run: poetry dynamic-versioning
- name: Run Dioptas from source to test
run: poetry run python run.py test
- name: Run PyInstaller
run: poetry run bash create_executable.sh
# - name: Clean Up Executable Folder
# run: |
# cd dist/Dioptas*.app
# cd Contents/Resources
# rm libopenblas.0.dylib
- name: Run Dioptas Executable
run: |
cd dist/Dioptas*
cd Contents/MacOS
./run_dioptas test
- name: Upload Compressed App as Artifact to GitHub
uses: actions/upload-artifact@v4
with:
name: DioptasMac
path: dist/Dioptas*.app
# DROPBOX UPLOAD
# disabled for now, since we can use the GitHub artifacts
# - name: Compress App
# run: |
# cd dist
# export DIOPTAS_FOLDER=$(ls | grep Dioptas*.app)
# echo $DIOPTAS_FOLDER
# zip -r $DIOPTAS_FOLDER.zip $DIOPTAS_FOLDER
# du -sh $DIOPTAS_FOLDER.zip
# - name: Upload Compressed App to Dropbox
# env:
# DROPBOX_TOKEN: ${{ secrets.DROPBOX_TOKEN }}
# run: |
# pip install dropbox
# cd dist
# export compressedFile=$(ls | grep .zip)
# export targetFile='/develop/macos/'$compressedFile
# python ../scripts/dropbox_upload.py $compressedFile $targetFile