Skip to content

Scheduled PyInstaller Bundle #34

Scheduled PyInstaller Bundle

Scheduled PyInstaller Bundle #34

Workflow file for this run

name: PyInstaller Bundle
on:
schedule:
- cron: "15 9 * * 2"
jobs:
bundle:
name: Bundle
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Run tests
run: |
python -m unittest discover --verbose
- name: Install PyInstaller
run: |
python -m pip install PyInstaller
- name: Download embeddable Python
run: |
mkdir embedded-python
cd embedded-python
curl -o python.zip https://www.python.org/ftp/python/3.11.9/python-3.11.9-embed-amd64.zip
tar xf python.zip
del python.zip
- name: Build bundle
run: |
python -m PyInstaller spinetoolbox.spec -- --embedded-python=embedded-python
- name: Get Toolbox version
id: toolbox-version
shell: bash
run: |
python -c "from importlib.metadata import version; print('version=' + version('spinetoolbox'))" >> $GITHUB_OUTPUT
- name: Upload archive
uses: actions/upload-artifact@v4
with:
name: Spine Toolbox ${{ steps.toolbox-version.outputs.version }}
path: dist
if-no-files-found: error
overwrite: true
update-downloads-page:
name: Trigger Downloads page generation
needs: bundle
runs-on: ubuntu-latest
steps:
- name: Trigger workflow
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.DOWNLOADS_TRIGGER_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/spine-tools/Downloads/actions/workflows/generate_readme.yml/dispatches \
-d '{"ref":"main"}'