Skip to content

Commit

Permalink
support qt versions in the release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
th3w1zard1 committed Apr 11, 2024
1 parent 88db07a commit d64fd37
Showing 1 changed file with 24 additions and 17 deletions.
41 changes: 24 additions & 17 deletions .github/workflows/release_toolset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ env:
PYTHON_VERSIONS_JSON: '["3.8"]'
ARCHITECTURES_JSON: '["x86", "x64"]'
INTERPRETERS_JSON: '["python"]'
QT_VERSIONS_JSON: '["pyqt5", "pyside2", "pyqt6", "pyside6"]'
UPX_VERSION: '4.2.2'

on:
Expand All @@ -29,7 +30,7 @@ jobs:
python-version: ${{ steps.set_env.outputs.python-version }}
architecture: ${{ steps.set_env.outputs.architecture }}
python-pypy: ${{ steps.set_env.outputs.python-pypy }}
#qt_version: ${#{ steps.set_env.outputs.qt_version }}
qt_version: ${{ steps.set_env.outputs.qt_version }}

steps:
- name: Set environment variables
Expand All @@ -54,6 +55,11 @@ jobs:
echo "python-pypy<<EOF" >> $env:GITHUB_OUTPUT
echo $singleLineJson >> $env:GITHUB_OUTPUT
echo "EOF" >> $env:GITHUB_OUTPUT
$singleLineJson = '${{ env.QT_VERSIONS_JSON }}' -replace "`r", "" -replace "`n", ""
echo "qt_version<<EOF" >> $env:GITHUB_OUTPUT
echo $singleLineJson >> $env:GITHUB_OUTPUT
echo "EOF" >> $env:GITHUB_OUTPUT
shell: pwsh

build:
Expand All @@ -66,7 +72,7 @@ jobs:
python-version: ${{ fromJson(needs.setup.outputs.python-version) }}
architecture: ${{ fromJson(needs.setup.outputs.architecture) }}
python_pypy: ${{ fromJson(needs.setup.outputs.python-pypy) }}
#qt_version: ['pyqt5', 'pyqt6', 'pyside2', 'pyside6']
qt_version: ${{ fromJson(needs.setup.outputs.qt_version) }}
include:
- arch: x86
vc_redist2015: "https://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x86.exe"
Expand All @@ -88,15 +94,15 @@ jobs:
- python_pypy: 'pypy'
python-version: '3.12'
# PyQt5 doesn't seem to be compatible with PyPy
#- python_pypy: "pypy"
# qt_version: 'pyqt5'
#- python_pypy: "pypy"
# qt_version: 'pyside2'
#- python_pypy: "pypy"
# qt_version: 'pyqt6'
#- python_pypy: "pypy"
# python-version: '3.10'
# os: 'windows-2019'
- python_pypy: "pypy"
qt_version: 'pyqt5'
- python_pypy: "pypy"
qt_version: 'pyside2'
- python_pypy: "pypy"
qt_version: 'pyqt6'
- python_pypy: "pypy"
python-version: '3.10'
os: 'windows-2019'

outputs:
matrix-os: ${{ toJson(matrix.os) }}
Expand Down Expand Up @@ -265,7 +271,7 @@ jobs:
} else {
pip install pyinstaller -U --prefer-binary
}
#$env:QT_API = if (-not [string]::IsNullOrEmpty($env:QT_API)) { $env:QT_API } else { "{{ matrix.qt_version }}" }
$env:QT_API = if (-not [string]::IsNullOrEmpty($env:QT_API)) { $env:QT_API } else { "{{ matrix.qt_version }}" }
$output = ""
$errorLines = @()
. ./compile/deps_toolset.ps1 -noprompt -venv_name .venv_toolset_${{ matrix.os }}_${{ matrix.python_pypy }}_${{ matrix.python-version }}_${{ matrix.architecture }} 2>&1 | ForEach-Object {
Expand Down Expand Up @@ -342,6 +348,7 @@ jobs:
Write-Host "Using UPX directory at '$upxDir'"
$output = ""
$env:PYTHONOPTIMIZE = "1"
$env:QT_API = if (-not [string]::IsNullOrEmpty($env:QT_API)) { $env:QT_API } else { "{{ matrix.qt_version }}" }
. ./compile/compile_toolset.ps1 -noprompt -venv_name .venv_toolset_${{ matrix.os }}_${{ matrix.python_pypy }}_${{ matrix.python-version }}_${{ matrix.architecture }} -upx_dir $upxDir 2>&1 | ForEach-Object {
Write-Output $_.ToString()
$output += $_.ToString() + "`n"
Expand Down Expand Up @@ -388,7 +395,7 @@ jobs:
id: upload_attempt_1
uses: actions/upload-artifact@v4
with:
name: HolocronToolset_${{ runner.os }}_${{ matrix.architecture }}
name: HolocronToolset_${{ runner.os }}_${{ matrix.qt_version}}_${{ matrix.architecture }}
path: ./dist/**
retention-days: 90
continue-on-error: true
Expand All @@ -398,7 +405,7 @@ jobs:
if: ${{ (success() || failure()) && steps.upload_attempt_1.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: HolocronToolset_${{ runner.os }}_${{ matrix.architecture }}
name: HolocronToolset_${{ runner.os }}_${{ matrix.qt_version}}_${{ matrix.architecture }}
path: ./dist/**
retention-days: 90
continue-on-error: true
Expand All @@ -408,7 +415,7 @@ jobs:
if: ${{ (success() || failure()) && steps.upload_attempt_2.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: HolocronToolset_${{ runner.os }}_${{ matrix.architecture }}
name: HolocronToolset_${{ runner.os }}_${{ matrix.qt_version}}_${{ matrix.architecture }}
path: ./dist/**
retention-days: 90
continue-on-error: true
Expand All @@ -418,7 +425,7 @@ jobs:
if: ${{ (success() || failure()) && steps.upload_attempt_3.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: HolocronToolset_${{ runner.os }}_${{ matrix.architecture }}
name: HolocronToolset_${{ runner.os }}_${{ matrix.qt_version}}_${{ matrix.architecture }}
path: ./dist/**
retention-days: 90
continue-on-error: true
Expand All @@ -428,7 +435,7 @@ jobs:
if: ${{ (success() || failure()) && steps.upload_attempt_4.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: HolocronToolset_${{ runner.os }}_${{ matrix.architecture }}
name: HolocronToolset_${{ runner.os }}_${{ matrix.qt_version}}_${{ matrix.architecture }}
path: ./dist/**
retention-days: 90

Expand Down

0 comments on commit d64fd37

Please sign in to comment.