Fix workflow run for windows build (#7)
Some checks failed
Unit Testing / test (3.9) (push) Has been cancelled
Unit Testing / test (3.12) (push) Has been cancelled
Unit Testing / test (3.10) (push) Has been cancelled
Unit Testing / test (3.8) (push) Has been cancelled
Unit Testing / test (3.11) (push) Has been cancelled

Reviewed-on: #7
Co-authored-by: Artur Glavic <artur.glavic@psi.ch>
Co-committed-by: Artur Glavic <artur.glavic@psi.ch>
This commit was merged in pull request #7.
This commit is contained in:
2026-03-13 13:36:49 +01:00
committed by glavic_a
parent 334e29d0d6
commit 59eac87bcd
3 changed files with 134 additions and 44 deletions

View File

@@ -23,7 +23,6 @@ on:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
@@ -118,12 +117,42 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install dependencies
- name: Ensure build environment
shell: powershell
run: |
C:\Miniconda\condabin\conda.bat env update --file conda_windows.yml --name base
C:\Miniconda\condabin\conda.bat init powershell
$envName="eos_build"
$envFile="conda_windows.yml"
$hashFile="$env:TEMP\$envName.hash"
$newHash = (Get-FileHash $envFile).Hash
if (!(Test-Path $hashFile)) {
$rebuild = $true
} else {
$oldHash = Get-Content $hashFile
$rebuild = $oldHash -ne $newHash
}
if ($rebuild) {
Write-Host "Environment changed → rebuilding"
if (micromamba env list | Select-String $envName) {
micromamba env remove -n $envName -y 2>$null
}
micromamba create -n $envName -f $envFile -y
$newHash | Out-File $hashFile
} else {
Write-Host "Environment unchanged → using cached env"
}
- name: Determine release tag
shell: powershell
run: |
$tag = micromamba run -n eos_build python -c "import eos; print('v'+eos.__version__)"
$tag = $tag.Trim()
"RELEASE_TAG=$tag" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Build with pyinstaller
shell: powershell
run: |
micromamba activate eos_build
pyinstaller windows_build.spec
cd dist\eos
Compress-Archive -Path .\* -Destination ..\..\eos.zip