Skip to content

Build binaries and Upload to Release #20

Build binaries and Upload to Release

Build binaries and Upload to Release #20

name: Build binaries and Upload to Release
on:
push:
branches: [main]
paths:
- "version"
workflow_dispatch: {}
jobs:
build:
name: Build and Release
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
python-version: ["3.11"]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.poetry/cache
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install Dependencies
run: |
pip install poetry
poetry add pyinstaller
poetry config virtualenvs.create true
poetry install --no-root
- name: Build
run: |
if [ "${{ runner.os }}" == 'Windows' ]; then
poetry run pyinstaller -F main.py -n ToolDelta.exe -i logo.png
else
poetry run pyinstaller -F main.py -n ToolDelta -i logo.png
fi
- name: Get version
run: echo "VERSION=$(<version)" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.VERSION }}
name: ${{ env.VERSION }}
files: dist/*