Try reactivating cached environment
This commit is contained in:
@@ -122,36 +122,40 @@ jobs:
|
||||
run: |
|
||||
$envName="eos_build"
|
||||
$envFile="conda_windows.yml"
|
||||
#$hashFile="$env:TEMP\$envName.hash"
|
||||
$hashFile="$env:TEMP\$envName.hash"
|
||||
|
||||
#$newHash = (Get-FileHash $envFile).Hash
|
||||
$newHash = (Get-FileHash $envFile).Hash
|
||||
|
||||
#if (!(Test-Path $hashFile)) {
|
||||
# $rebuild = $true
|
||||
#} else {
|
||||
# $oldHash = Get-Content $hashFile
|
||||
# $rebuild = $oldHash -ne $newHash
|
||||
#}
|
||||
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
|
||||
# }
|
||||
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"
|
||||
#}
|
||||
$newHash | Out-File $hashFile
|
||||
} else {
|
||||
Write-Host "Environment unchanged → using cached env"
|
||||
}
|
||||
- name: Build with pyinstaller
|
||||
run: |
|
||||
micromamba activate eos_build
|
||||
$env:RELEASE_TAG = (python -c "import eos;print('v'+eos.__version__)")
|
||||
echo "RELEASE_TAG=$env:RELEASE_TAG" >> $env:GITHUB_ENV
|
||||
|
||||
pyinstaller windows_build.spec
|
||||
cd dist\eos
|
||||
Compress-Archive -Path .\* -Destination ..\..\eos.zip
|
||||
echo "Set tag to $env:RELEASE_TAG"
|
||||
#pyinstaller windows_build.spec
|
||||
#cd dist\eos
|
||||
#Compress-Archive -Path .\* -Destination ..\..\eos.zip
|
||||
- name: Test global env
|
||||
run: |
|
||||
echo "Received tag as $env:RELEASE_TAG"
|
||||
- name: Update Release
|
||||
if: ${{ (github.event_name != 'workflow_dispatch') || (contains(fromJson('["all_incl_release"]'), github.event.inputs.build-items)) }}
|
||||
uses: actions/gitea-release-action@v1
|
||||
|
||||
Reference in New Issue
Block a user