Compare commits
11 Commits
f9e0225243
...
v1.6.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 2eb4c52b81 | |||
| 3d73a504d2 | |||
| 1524271be7 | |||
| 561cf43e09 | |||
| e8930f7550 | |||
| c8da0f9191 | |||
| 37ce500fd2 | |||
| 098a84e5bd | |||
| 5aa17c1a84 | |||
| dde14f3714 | |||
| fa5d4c6993 |
@@ -4,11 +4,10 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
runs-on: windows-latest
|
runs-on: windows
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -17,72 +16,94 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
tags: true
|
tags: true
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Ensure Python 3.13
|
||||||
uses: https://git.daemonlord.ru/actions/setup-python@v5
|
shell: powershell
|
||||||
with:
|
run: |
|
||||||
python-version: "3.13"
|
if (Get-Command python -ErrorAction SilentlyContinue) {
|
||||||
|
python --version
|
||||||
|
} elseif (Get-Command py -ErrorAction SilentlyContinue) {
|
||||||
|
$pyExe = py -3.13 -c "import sys; print(sys.executable)"
|
||||||
|
if (-not $pyExe) {
|
||||||
|
throw "Python 3.13 launcher is available, but interpreter was not found."
|
||||||
|
}
|
||||||
|
Split-Path $pyExe | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||||
|
python --version
|
||||||
|
} else {
|
||||||
|
throw "Python is not installed on runner. Install Python 3.13 and restart runner service."
|
||||||
|
}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
shell: bash
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install -r requirements.txt pyinstaller
|
pip install -r requirements.txt pyinstaller
|
||||||
|
|
||||||
- name: Extract app version
|
- name: Extract app version
|
||||||
id: extract_version
|
id: extract_version
|
||||||
shell: bash
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(python -c "from app_version import APP_VERSION; print(APP_VERSION)")
|
$version = (python -c "from app_version import APP_VERSION; print(APP_VERSION)").Trim()
|
||||||
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
$utf8NoBom = New-Object System.Text.UTF8Encoding($false)
|
||||||
echo "Detected version: $VERSION"
|
[System.IO.File]::AppendAllText($env:GITHUB_OUTPUT, "version=$version`n", $utf8NoBom)
|
||||||
|
Write-Host "Detected version: $version"
|
||||||
|
|
||||||
- name: Stop if version already released
|
- name: Stop if version already released
|
||||||
id: stop
|
id: stop
|
||||||
shell: bash
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
VERSION="${{ steps.extract_version.outputs.version }}"
|
$version = "${{ steps.extract_version.outputs.version }}"
|
||||||
if git show-ref --tags --quiet --verify "refs/tags/$VERSION"; then
|
$tag = "v$version"
|
||||||
echo "Version $VERSION already released, stopping job."
|
git show-ref --tags --quiet --verify "refs/tags/$tag"
|
||||||
echo "CONTINUE=false" >> "$GITHUB_ENV"
|
$tagExists = ($LASTEXITCODE -eq 0)
|
||||||
else
|
$global:LASTEXITCODE = 0
|
||||||
echo "Version $VERSION not released yet, continuing workflow..."
|
$utf8NoBom = New-Object System.Text.UTF8Encoding($false)
|
||||||
echo "CONTINUE=true" >> "$GITHUB_ENV"
|
if ($tagExists) {
|
||||||
fi
|
Write-Host "Version $tag already released, stopping job."
|
||||||
|
[System.IO.File]::AppendAllText($env:GITHUB_ENV, "CONTINUE=false`n", $utf8NoBom)
|
||||||
|
} else {
|
||||||
|
Write-Host "Version $tag not released yet, continuing workflow..."
|
||||||
|
[System.IO.File]::AppendAllText($env:GITHUB_ENV, "CONTINUE=true`n", $utf8NoBom)
|
||||||
|
}
|
||||||
|
exit 0
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
if: env.CONTINUE == 'true'
|
if: env.CONTINUE == 'true'
|
||||||
shell: bash
|
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
|
||||||
python -m unittest tests/test_auth_relogin_smoke.py
|
python -m unittest tests/test_auth_relogin_smoke.py
|
||||||
|
|
||||||
- name: Build release zip
|
- name: Build release zip
|
||||||
if: env.CONTINUE == 'true'
|
if: env.CONTINUE == 'true'
|
||||||
shell: bash
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
python build.py
|
python build.py
|
||||||
|
|
||||||
- name: Ensure archive exists
|
- name: Ensure archive exists
|
||||||
if: env.CONTINUE == 'true'
|
if: env.CONTINUE == 'true'
|
||||||
shell: bash
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
VERSION="${{ steps.extract_version.outputs.version }}"
|
$version = "${{ steps.extract_version.outputs.version }}"
|
||||||
test -f "dist/AnabasisManager-$VERSION.zip"
|
$archivePath = "dist/AnabasisManager-$version.zip"
|
||||||
|
if (-not (Test-Path $archivePath)) {
|
||||||
|
throw "Archive not found: $archivePath"
|
||||||
|
}
|
||||||
|
|
||||||
- name: Configure git identity
|
- name: Configure git identity
|
||||||
if: env.CONTINUE == 'true'
|
if: env.CONTINUE == 'true'
|
||||||
shell: bash
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
git config user.name "gitea-actions"
|
git config user.name "gitea-actions"
|
||||||
git config user.email "gitea-actions@daemonlord.ru"
|
git config user.email "gitea-actions@daemonlord.ru"
|
||||||
|
|
||||||
- name: Create git tag
|
- name: Create git tag
|
||||||
if: env.CONTINUE == 'true'
|
if: env.CONTINUE == 'true'
|
||||||
shell: bash
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
VERSION="${{ steps.extract_version.outputs.version }}"
|
$version = "${{ steps.extract_version.outputs.version }}"
|
||||||
git tag "$VERSION"
|
$tag = "v$version"
|
||||||
git push origin "$VERSION"
|
git tag "$tag"
|
||||||
|
git push origin "$tag"
|
||||||
|
|
||||||
- name: Create Gitea Release
|
- name: Create Gitea Release
|
||||||
if: env.CONTINUE == 'true'
|
if: env.CONTINUE == 'true'
|
||||||
@@ -91,9 +112,9 @@ jobs:
|
|||||||
server_url: https://git.daemonlord.ru
|
server_url: https://git.daemonlord.ru
|
||||||
repository: ${{ gitea.repository }}
|
repository: ${{ gitea.repository }}
|
||||||
token: ${{ secrets.API_TOKEN }}
|
token: ${{ secrets.API_TOKEN }}
|
||||||
tag_name: ${{ steps.extract_version.outputs.version }}
|
tag_name: v${{ steps.extract_version.outputs.version }}
|
||||||
name: Release ${{ steps.extract_version.outputs.version }}
|
name: Anabasis Manager ${{ steps.extract_version.outputs.version }}
|
||||||
body: |
|
body: |
|
||||||
Desktop release ${{ steps.extract_version.outputs.version }}
|
Desktop release v${{ steps.extract_version.outputs.version }}
|
||||||
files: |
|
files: |
|
||||||
dist/AnabasisManager-${{ steps.extract_version.outputs.version }}.zip
|
dist/AnabasisManager-${{ steps.extract_version.outputs.version }}.zip
|
||||||
|
|||||||
Reference in New Issue
Block a user