statapp/.github/workflows/release.yml

67 lines
2.0 KiB
YAML
Raw Normal View History

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]
2023-09-26 21:36:34 +03:00
defaults:
run:
shell: bash
steps:
2023-09-26 21:36:34 +03:00
- uses: actions/checkout@v4
- name: Установка python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Установка poetry
2023-09-26 21:36:34 +03:00
uses: snok/install-poetry@v1
with:
2023-09-26 21:36:34 +03:00
version: 1.6.1
virtualenvs-create: true
virtualenvs-in-project: true
- uses: actions/cache@v3
with:
path: ./.venv
2023-09-26 21:36:34 +03:00
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Установка зависимостей
run: poetry install
- name: Сборка
run: poetry run pyinstaller ${{ matrix.spec }}.spec
- name: Загрузка артефактов
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-${{ matrix.spec }}
path: ./dist/statapp*
release-please:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: google-github-actions/release-please-action@v3
with:
release-type: python
package-name: statapp
changelog-types: '[{"type":"feat","section":"Новые функции","hidden":false},{"type":"fix","section":"Исправления","hidden":false},{"type":"chore", "hidden":true}]'
- 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/*