Compare commits
8 Commits
v2.0.0-df3
...
v2.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 147988242f | |||
| cf6d6bcbd0 | |||
| 61948a51c6 | |||
| 97c52c5a51 | |||
| 862c2c8899 | |||
| 1013a1ce38 | |||
| f15e71996b | |||
| 34272d01c8 |
@@ -28,8 +28,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Validate syntax
|
- name: Validate syntax
|
||||||
run: |
|
run: |
|
||||||
python -m py_compile app_version.py main.py build.py 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
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
python -m unittest tests/test_auth_relogin_smoke.py
|
python -m unittest discover -s tests -p "test_*.py" -v
|
||||||
|
|||||||
@@ -47,31 +47,47 @@ jobs:
|
|||||||
[System.IO.File]::AppendAllText($env:GITHUB_OUTPUT, "version=$version`n", $utf8NoBom)
|
[System.IO.File]::AppendAllText($env:GITHUB_OUTPUT, "version=$version`n", $utf8NoBom)
|
||||||
Write-Host "Detected version: $version"
|
Write-Host "Detected version: $version"
|
||||||
|
|
||||||
- name: Stop if version already released
|
- name: Initialize release flow
|
||||||
id: stop
|
id: flow_init
|
||||||
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
$utf8NoBom = New-Object System.Text.UTF8Encoding($false)
|
||||||
|
[System.IO.File]::AppendAllText($env:GITHUB_ENV, "CONTINUE=true`n", $utf8NoBom)
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
- name: Stop if release already exists
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
$version = "${{ steps.extract_version.outputs.version }}"
|
$version = "${{ steps.extract_version.outputs.version }}"
|
||||||
$tag = "v$version"
|
$tag = "v$version"
|
||||||
git show-ref --tags --quiet --verify "refs/tags/$tag"
|
$apiUrl = "https://git.daemonlord.ru/api/v1/repos/${{ gitea.repository }}/releases?page=1&limit=100"
|
||||||
$tagExists = ($LASTEXITCODE -eq 0)
|
$headers = @{ Authorization = "token ${{ secrets.API_TOKEN }}" }
|
||||||
$global:LASTEXITCODE = 0
|
|
||||||
$utf8NoBom = New-Object System.Text.UTF8Encoding($false)
|
$utf8NoBom = New-Object System.Text.UTF8Encoding($false)
|
||||||
if ($tagExists) {
|
try {
|
||||||
Write-Host "Version $tag already released, stopping job."
|
$response = Invoke-RestMethod -Uri $apiUrl -Headers $headers -Method Get
|
||||||
[System.IO.File]::AppendAllText($env:GITHUB_ENV, "CONTINUE=false`n", $utf8NoBom)
|
$found = $false
|
||||||
} else {
|
foreach ($release in $response) {
|
||||||
Write-Host "Version $tag not released yet, continuing workflow..."
|
if ($release.tag_name -eq $tag) {
|
||||||
[System.IO.File]::AppendAllText($env:GITHUB_ENV, "CONTINUE=true`n", $utf8NoBom)
|
$found = $true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($found) {
|
||||||
|
Write-Host "Release $tag already exists, stopping job."
|
||||||
|
[System.IO.File]::AppendAllText($env:GITHUB_ENV, "CONTINUE=false`n", $utf8NoBom)
|
||||||
|
} else {
|
||||||
|
Write-Host "Release $tag not found, continuing workflow..."
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
Write-Host "Failed to query releases list, continuing workflow..."
|
||||||
}
|
}
|
||||||
exit 0
|
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
if: env.CONTINUE == 'true'
|
if: env.CONTINUE == 'true'
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
python -m py_compile app_version.py main.py build.py 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 tests/test_auth_relogin_smoke.py
|
python -m unittest discover -s tests -p "test_*.py" -v
|
||||||
|
|
||||||
- name: Build release zip
|
- name: Build release zip
|
||||||
if: env.CONTINUE == 'true'
|
if: env.CONTINUE == 'true'
|
||||||
@@ -114,8 +130,13 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
$version = "${{ steps.extract_version.outputs.version }}"
|
$version = "${{ steps.extract_version.outputs.version }}"
|
||||||
$tag = "v$version"
|
$tag = "v$version"
|
||||||
git tag "$tag"
|
$tagLine = (git ls-remote --tags origin "refs/tags/$tag" | Select-Object -First 1)
|
||||||
git push origin "$tag"
|
if ([string]::IsNullOrWhiteSpace($tagLine)) {
|
||||||
|
git tag "$tag"
|
||||||
|
git push origin "$tag"
|
||||||
|
} else {
|
||||||
|
Write-Host "Tag $tag already exists on origin, skipping tag push."
|
||||||
|
}
|
||||||
|
|
||||||
- name: Create Gitea Release
|
- name: Create Gitea Release
|
||||||
if: env.CONTINUE == 'true'
|
if: env.CONTINUE == 'true'
|
||||||
|
|||||||
Reference in New Issue
Block a user