statapp/.github/workflows/release.yml

95 lines
3.1 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-20.04, windows-latest]
spec: [statapp-onefile, statapp]
2023-09-28 10:14:26 +03:00
arch: [x86, x64]
include:
- os: ubuntu-20.04
target: linux
- os: windows-latest
target: windows
exclude:
- os: ubuntu-20.04
arch: x86
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.8
architecture: ${{ matrix.arch }}
- 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
key: venv-${{ runner.os }}-${{ runner.arch }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Setup MSYS2 (32-bit)
if: ${{ matrix.arch == 'x86' && matrix.os == 'windows-latest' }}
uses: msys2/setup-msys2@v2
with:
msystem: mingw32
path-type: inherit
install: >-
mingw-w64-i686-gcc-fortran
- 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' || '' }}
- name: Архивация
uses: thedoctor0/zip-release@0.7.1
with:
type: 'zip'
directory: 'dist'
filename: "../${{ matrix.target }}-${{ matrix.arch }}-${{ matrix.spec }}.zip"
- name: Загрузка артефактов
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target }}-${{ matrix.arch }}-${{ matrix.spec }}
path: '${{ matrix.target }}-${{ 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