mirror of
https://github.com/shizand/statapp.git
synced 2024-12-23 12:12:59 +03:00
81 lines
2.6 KiB
YAML
81 lines
2.6 KiB
YAML
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
name: release-please
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest]
|
|
spec: [statapp-onefile, statapp]
|
|
arch: [x86, x64]
|
|
exclude:
|
|
- os: ubuntu-latest
|
|
arch: x86
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Установка python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: 3.8
|
|
architecture: ${{ matrix.arch }}
|
|
- name: Установка poetry
|
|
uses: snok/install-poetry@v1
|
|
with:
|
|
version: 1.6.1
|
|
virtualenvs-create: true
|
|
virtualenvs-in-project: true
|
|
- uses: actions/cache@v3
|
|
with:
|
|
path: ./.venv
|
|
key: venv-${{ runner.os }}-${{ runner.arch }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
|
|
- name: Установка зависимостей
|
|
run: poetry install
|
|
- name: Сборка
|
|
run: poetry run pyinstaller ${{ matrix.spec }}.spec\
|
|
- name: Архивация
|
|
uses: thedoctor0/zip-release@0.7.1
|
|
with:
|
|
type: 'zip'
|
|
directory: 'dist'
|
|
filename: "../${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.spec }}.zip"
|
|
- name: Загрузка артефактов
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: ${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.spec }}
|
|
path: '${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.spec }}.zip'
|
|
|
|
release-please:
|
|
runs-on: ubuntu-latest
|
|
needs: [build]
|
|
steps:
|
|
- uses: google-github-actions/release-please-action@v3
|
|
id: release
|
|
with:
|
|
release-type: python
|
|
package-name: statapp
|
|
changelog-types: '[{"type":"feat","section":"Новые функции","hidden":false},{"type":"fix","section":"Исправления","hidden":false},{"type":"chore", "hidden":true}]'
|
|
- uses: actions/checkout@v4
|
|
if: ${{ steps.release.outputs.release_created }}
|
|
- 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/**/*.zip
|