100 lines
3.0 KiB
YAML
100 lines
3.0 KiB
YAML
name: Desktop Release
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: https://git.daemonlord.ru/actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
tags: true
|
|
|
|
- name: Set up Python
|
|
uses: https://git.daemonlord.ru/actions/setup-python@v5
|
|
with:
|
|
python-version: "3.13"
|
|
|
|
- name: Install dependencies
|
|
shell: bash
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt pyinstaller
|
|
|
|
- name: Extract app version
|
|
id: extract_version
|
|
shell: bash
|
|
run: |
|
|
VERSION=$(python -c "from app_version import APP_VERSION; print(APP_VERSION)")
|
|
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
|
echo "Detected version: $VERSION"
|
|
|
|
- name: Stop if version already released
|
|
id: stop
|
|
shell: bash
|
|
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
|
|
|
|
- name: Run tests
|
|
if: env.CONTINUE == 'true'
|
|
shell: bash
|
|
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
|
|
run: |
|
|
python build.py
|
|
|
|
- name: Ensure archive exists
|
|
if: env.CONTINUE == 'true'
|
|
shell: bash
|
|
run: |
|
|
VERSION="${{ steps.extract_version.outputs.version }}"
|
|
test -f "dist/AnabasisManager-$VERSION.zip"
|
|
|
|
- name: Configure git identity
|
|
if: env.CONTINUE == 'true'
|
|
shell: bash
|
|
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
|
|
run: |
|
|
VERSION="${{ steps.extract_version.outputs.version }}"
|
|
git tag "$VERSION"
|
|
git push origin "$VERSION"
|
|
|
|
- name: Create Gitea Release
|
|
if: env.CONTINUE == 'true'
|
|
uses: https://git.daemonlord.ru/actions/gitea-release-action@v1
|
|
with:
|
|
server_url: https://git.daemonlord.ru
|
|
repository: ${{ gitea.repository }}
|
|
token: ${{ secrets.API_TOKEN }}
|
|
tag_name: ${{ steps.extract_version.outputs.version }}
|
|
name: Release ${{ steps.extract_version.outputs.version }}
|
|
body: |
|
|
Desktop release ${{ steps.extract_version.outputs.version }}
|
|
files: |
|
|
dist/AnabasisManager-${{ steps.extract_version.outputs.version }}.zip
|