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:
|
2023-09-28 16:08:11 +03:00
|
|
|
os: [ubuntu-20.04, windows-latest]
|
2023-09-27 09:09:42 +03:00
|
|
|
spec: [statapp-onefile, statapp]
|
2024-02-22 20:03:52 +03:00
|
|
|
arch: [x64] # [x86, x64]
|
2023-09-28 16:08:11 +03:00
|
|
|
include:
|
|
|
|
- os: ubuntu-20.04
|
|
|
|
target: linux
|
|
|
|
- os: windows-latest
|
|
|
|
target: windows
|
2023-10-20 14:46:33 +03:00
|
|
|
exclude:
|
|
|
|
- os: ubuntu-20.04
|
|
|
|
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-10-06 09:44:00 +03:00
|
|
|
run: poetry run pyinstaller statapp.spec -- -- ${{ matrix.spec == 'statapp-onefile' && '--one-file' || '' }}
|
2023-09-28 10:53:36 +03:00
|
|
|
- name: Архивация
|
|
|
|
uses: thedoctor0/zip-release@0.7.1
|
|
|
|
with:
|
|
|
|
type: 'zip'
|
2023-09-28 11:05:21 +03:00
|
|
|
directory: 'dist'
|
2023-09-28 16:08:11 +03:00
|
|
|
filename: "../${{ matrix.target }}-${{ matrix.arch }}-${{ matrix.spec }}.zip"
|
2023-09-26 21:17:23 +03:00
|
|
|
- name: Загрузка артефактов
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2023-09-28 16:08:11 +03:00
|
|
|
name: ${{ matrix.target }}-${{ matrix.arch }}-${{ matrix.spec }}
|
|
|
|
path: '${{ matrix.target }}-${{ matrix.arch }}-${{ matrix.spec }}.zip'
|
2023-09-26 21:17:23 +03:00
|
|
|
|
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-28 11:22:21 +03:00
|
|
|
- uses: actions/checkout@v4
|
|
|
|
if: ${{ steps.release.outputs.release_created }}
|
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:
|
2023-09-28 15:41:06 +03:00
|
|
|
gh release upload ${{ steps.release.outputs.tag_name }} ./dist/**/*.zip
|