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
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:
37
.github/workflows/release.yml
vendored
37
.github/workflows/release.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user