2023-09-24 12:06:13 +03:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2023-09-26 13:29:01 +03:00
|
|
|
name: release-please
|
2023-09-24 12:06:13 +03:00
|
|
|
|
2023-09-26 10:39:06 +03:00
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
pull-requests: write
|
|
|
|
|
2023-09-24 12:06:13 +03:00
|
|
|
jobs:
|
2023-09-26 21:17:23 +03:00
|
|
|
build:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, windows-latest]
|
2023-09-27 09:09:42 +03:00
|
|
|
spec: [statapp-onefile, statapp]
|
2023-09-28 10:14:26 +03:00
|
|
|
arch: [x86, x64]
|
|
|
|
exclude:
|
|
|
|
- os: ubuntu-latest
|
2023-09-28 10:09:49 +03:00
|
|
|
arch: x86
|
2023-09-26 21:36:34 +03:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
2023-09-26 21:17:23 +03:00
|
|
|
steps:
|
2023-09-26 21:36:34 +03:00
|
|
|
- uses: actions/checkout@v4
|
2023-09-26 21:17:23 +03:00
|
|
|
- name: Установка python
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
2023-09-27 10:20:56 +03:00
|
|
|
python-version: 3.8
|
2023-09-28 09:58:15 +03:00
|
|
|
architecture: ${{ matrix.arch }}
|
2023-09-26 21:17:23 +03:00
|
|
|
- name: Установка poetry
|
2023-09-26 21:36:34 +03:00
|
|
|
uses: snok/install-poetry@v1
|
2023-09-26 21:17:23 +03:00
|
|
|
with:
|
2023-09-26 21:36:34 +03:00
|
|
|
version: 1.6.1
|
|
|
|
virtualenvs-create: true
|
|
|
|
virtualenvs-in-project: true
|
2023-09-26 21:17:23 +03:00
|
|
|
- uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: ./.venv
|
2023-09-28 09:58:15 +03:00
|
|
|
key: venv-${{ runner.os }}-${{ runner.arch }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
|
2023-09-26 21:17:23 +03:00
|
|
|
- name: Установка зависимостей
|
|
|
|
run: poetry install
|
|
|
|
- name: Сборка
|
2023-09-27 09:09:42 +03:00
|
|
|
run: poetry run pyinstaller ${{ matrix.spec }}.spec
|
2023-09-26 21:17:23 +03:00
|
|
|
- name: Загрузка артефактов
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2023-09-28 09:58:15 +03:00
|
|
|
name: ${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.spec }}
|
2023-09-26 21:17:23 +03:00
|
|
|
path: ./dist/statapp*
|
|
|
|
|
2023-09-26 13:29:01 +03:00
|
|
|
release-please:
|
2023-09-24 12:06:13 +03:00
|
|
|
runs-on: ubuntu-latest
|
2023-09-26 21:17:23 +03:00
|
|
|
needs: [build]
|
2023-09-24 12:06:13 +03:00
|
|
|
steps:
|
2023-09-26 13:29:01 +03:00
|
|
|
- uses: google-github-actions/release-please-action@v3
|
2023-09-28 10:42:27 +03:00
|
|
|
id: release
|
2023-09-24 12:06:13 +03:00
|
|
|
with:
|
2023-09-26 13:29:01 +03:00
|
|
|
release-type: python
|
|
|
|
package-name: statapp
|
|
|
|
changelog-types: '[{"type":"feat","section":"Новые функции","hidden":false},{"type":"fix","section":"Исправления","hidden":false},{"type":"chore", "hidden":true}]'
|
2023-09-26 21:17:23 +03:00
|
|
|
- name: Скачивание артефактов
|
|
|
|
if: ${{ steps.release.outputs.release_created }}
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
path: dist
|
|
|
|
- name: Загрузка в релиз
|
|
|
|
if: ${{ steps.release.outputs.release_created }}
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
run:
|
|
|
|
gh release upload ${{ steps.release.outputs.tag_name }} ./dist/*
|