|
|
|
|
@@ -53,9 +53,8 @@ jobs:
|
|
|
|
|
run: |
|
|
|
|
|
$version = "${{ steps.extract_version.outputs.version }}"
|
|
|
|
|
$tag = "v$version"
|
|
|
|
|
git show-ref --tags --quiet --verify "refs/tags/$tag"
|
|
|
|
|
$tagExists = ($LASTEXITCODE -eq 0)
|
|
|
|
|
$global:LASTEXITCODE = 0
|
|
|
|
|
$tagLine = (git ls-remote --tags origin "refs/tags/$tag" | Select-Object -First 1)
|
|
|
|
|
$tagExists = -not [string]::IsNullOrWhiteSpace($tagLine)
|
|
|
|
|
$utf8NoBom = New-Object System.Text.UTF8Encoding($false)
|
|
|
|
|
if ($tagExists) {
|
|
|
|
|
Write-Host "Version $tag already released, stopping job."
|
|
|
|
|
@@ -66,12 +65,31 @@ jobs:
|
|
|
|
|
}
|
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
|
|
- name: Stop if release already exists
|
|
|
|
|
if: env.CONTINUE == 'true'
|
|
|
|
|
shell: powershell
|
|
|
|
|
run: |
|
|
|
|
|
$version = "${{ steps.extract_version.outputs.version }}"
|
|
|
|
|
$tag = "v$version"
|
|
|
|
|
$apiUrl = "https://git.daemonlord.ru/api/v1/repos/${{ gitea.repository }}/releases/tags/$tag"
|
|
|
|
|
$headers = @{ Authorization = "token ${{ secrets.API_TOKEN }}" }
|
|
|
|
|
$utf8NoBom = New-Object System.Text.UTF8Encoding($false)
|
|
|
|
|
try {
|
|
|
|
|
$response = Invoke-WebRequest -Uri $apiUrl -Headers $headers -Method Get -UseBasicParsing
|
|
|
|
|
if ($response.StatusCode -eq 200) {
|
|
|
|
|
Write-Host "Release $tag already exists, stopping job."
|
|
|
|
|
[System.IO.File]::AppendAllText($env:GITHUB_ENV, "CONTINUE=false`n", $utf8NoBom)
|
|
|
|
|
}
|
|
|
|
|
} catch {
|
|
|
|
|
Write-Host "Release $tag not found, continuing workflow..."
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
|
if: env.CONTINUE == 'true'
|
|
|
|
|
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
|
|
|
|
|
python -m py_compile app_version.py main.py build.py tests/test_auth_relogin_smoke.py tests/test_auto_update_service.py tests/test_chat_actions.py tests/test_token_store.py
|
|
|
|
|
python -m unittest discover -s tests -p "test_*.py" -v
|
|
|
|
|
|
|
|
|
|
- name: Build release zip
|
|
|
|
|
if: env.CONTINUE == 'true'
|
|
|
|
|
|