From 8420823342d1b37b6b53778edae7c0da7e666a62 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Fri, 22 Nov 2024 12:18:40 +0100 Subject: [PATCH] Only package exes for one entry in matrix --- .github/workflows/build_win.yml | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build_win.yml b/.github/workflows/build_win.yml index d4d4497cc7..e76a8c97c3 100644 --- a/.github/workflows/build_win.yml +++ b/.github/workflows/build_win.yml @@ -88,24 +88,28 @@ jobs: run: | $VERSION = 'v' + ((Get-Content VERSION).Trim()) $SHA = ${env:GITHUB_SHA}.Substring(0, 7) - cd _installed-vs2019-x64/bin - Get-ChildItem -Path . | ForEach-Object { - echo $_ - $exe = $_.Name - $baseName = $exe.Substring(0, $exe.Length - 4) - $zipName = "${baseName}-$VERSION-$SHA-win64.zip" - 7z a $zipName $exe - } $OUTPUT_DIR = "$env:USERPROFILE\output" New-Item -ItemType Directory -Force -Path $OUTPUT_DIR - mv *.zip $OUTPUT_DIR - $version = "${{ matrix.python }}" - $pyVersionMajor = ($version -split '\.')[0..1] -join '.' + if (${{ matrix.python }} -eq '3.9.11') { + # only for the first python version the executables are assembled for upload + cd _installed-vs2019-x64/bin + Get-ChildItem -Path . | ForEach-Object { + echo $_ + $exe = $_.Name + $baseName = $exe.Substring(0, $exe.Length - 4) + $zipName = "${baseName}-$VERSION-$SHA-win64.zip" + 7z a $zipName $exe + } + mv *.zip $OUTPUT_DIR + } + + $pyVersion = "${{ matrix.python }}" + $pyVersionMajor = ($pyVersion -split '\.')[0..1] -join '' cd C:\Python\${{ matrix.python }}\Lib\site-packages Remove-Item -Recurse -Force ifcopenshell\__pycache__ -ErrorAction SilentlyContinue Get-ChildItem -Path ifcopenshell -Filter "*.pyc" -Recurse | Remove-Item -Force - $zipName = "ifcopenshell-$pyVersionMajor-$VERSION-$SHA-win64.zip" + $zipName = "ifcopenshell-python-$pyVersionMajor-$VERSION-$SHA-win64.zip" 7z a $zipName ifcopenshell mv $zipName $OUTPUT_DIR