Dioptas/.github/workflows/build_windows.yml

86 lines
2.5 KiB
YAML

# This is a basic workflow to help you get started with Actions
name: CD_WINDOWS
on: [push]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build_windows:
# The type of runner that the job will run on
runs-on: windows-latest
env:
folder_name: 'DioptasWin'
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow
- name: Install poetry
run: pipx install poetry
- 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 pyinstaller
- 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
shell: cmd
run: poetry run pyinstaller Dioptas.spec
- name: Run Dioptas Executable from Dist Folder
shell: cmd
run: |
cd dist\Dioptas*
Dioptas.exe test
- name: Determine Folder Name
run: |
cd dist\Dioptas*
echo "folder_name=$(pwd | Select-Object | %{$_.ProviderPath.Split("\")[-1]})"
echo "folder_name=$(pwd | Select-Object | %{$_.ProviderPath.Split("\")[-1]})" >> $env:GITHUB_ENV
- name: Upload Compressed App as Artifact to GitHub
uses: actions/upload-artifact@v4
with:
name: ${{ env.folder_name }}
path: dist\Dioptas*
# DROPBOX UPLOAD
# disabled for now, since we can use the GitHub artifacts
# - name: Compress App
# run: |
# cd dist\Dioptas*
# $folderName = pwd | Select-Object | %{$_.ProviderPath.Split("\")[-1]}
# cd ..
# $zipName = $folderName + '.zip'
# Compress-Archive $folderName $zipName
# Write-Host((Get-Item $zipName).length/1MB)
#
# - name: Upload Compressed App to Dropbox
# env:
# DROPBOX_TOKEN: ${{ secrets.DROPBOX_TOKEN }}
# run: |
# pip install dropbox
# cd dist
# $zipFile = Resolve-Path ".\Dioptas*.zip" | Select-Object | %{$_.ProviderPath.Split("\")[-1]}
# $targetFile = '/develop/windows/' + $zipFile
# python ..\scripts\dropbox_upload.py $zipFile $targetFile