From e8930f75503a619859661d7421389da3e84fa0bd Mon Sep 17 00:00:00 2001 From: benya Date: Sun, 15 Feb 2026 17:28:29 +0300 Subject: [PATCH] ci(release): switch windows release steps from bash to powershell --- .gitea/workflows/release.yml | 52 +++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 9250457..8b53f4c 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -33,66 +33,70 @@ jobs: } - name: Install dependencies - shell: bash + shell: powershell run: | python -m pip install --upgrade pip pip install -r requirements.txt pyinstaller - name: Extract app version id: extract_version - shell: bash + shell: powershell run: | - VERSION=$(python -c "from app_version import APP_VERSION; print(APP_VERSION)") - echo "version=$VERSION" >> "$GITHUB_OUTPUT" - echo "Detected version: $VERSION" + $version = python -c "from app_version import APP_VERSION; print(APP_VERSION)" + "version=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append + Write-Host "Detected version: $version" - name: Stop if version already released id: stop - shell: bash + shell: powershell run: | - VERSION="${{ steps.extract_version.outputs.version }}" - if git show-ref --tags --quiet --verify "refs/tags/$VERSION"; then - echo "Version $VERSION already released, stopping job." - echo "CONTINUE=false" >> "$GITHUB_ENV" - else - echo "Version $VERSION not released yet, continuing workflow..." - echo "CONTINUE=true" >> "$GITHUB_ENV" - fi + $version = "${{ steps.extract_version.outputs.version }}" + git show-ref --tags --quiet --verify "refs/tags/$version" + if ($LASTEXITCODE -eq 0) { + Write-Host "Version $version already released, stopping job." + "CONTINUE=false" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + } else { + Write-Host "Version $version not released yet, continuing workflow..." + "CONTINUE=true" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + } - name: Run tests if: env.CONTINUE == 'true' - shell: bash + shell: powershell run: | python -m py_compile app_version.py main.py build.py tests/test_auth_relogin_smoke.py python -m unittest tests/test_auth_relogin_smoke.py - name: Build release zip if: env.CONTINUE == 'true' - shell: bash + shell: powershell run: | python build.py - name: Ensure archive exists if: env.CONTINUE == 'true' - shell: bash + shell: powershell run: | - VERSION="${{ steps.extract_version.outputs.version }}" - test -f "dist/AnabasisManager-$VERSION.zip" + $version = "${{ steps.extract_version.outputs.version }}" + $archivePath = "dist/AnabasisManager-$version.zip" + if (-not (Test-Path $archivePath)) { + throw "Archive not found: $archivePath" + } - name: Configure git identity if: env.CONTINUE == 'true' - shell: bash + shell: powershell run: | git config user.name "gitea-actions" git config user.email "gitea-actions@daemonlord.ru" - name: Create git tag if: env.CONTINUE == 'true' - shell: bash + shell: powershell run: | - VERSION="${{ steps.extract_version.outputs.version }}" - git tag "$VERSION" - git push origin "$VERSION" + $version = "${{ steps.extract_version.outputs.version }}" + git tag "$version" + git push origin "$version" - name: Create Gitea Release if: env.CONTINUE == 'true'