Skip to content

Build binaries and Upload to Release #24

Build binaries and Upload to Release

Build binaries and Upload to Release #24

name: Build binaries and Upload to Release
on:
push:
branches: [main]
paths:
- "version"
workflow_dispatch: {}
jobs:
build_windows:
name: Build and Release for Windows
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.poetry
key: windows-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
windows-poetry-
- name: Check if Poetry is installed
run: |
if (-Not (Test-Path $env:USERPROFILE\.poetry\bin\poetry)) {
Write-Output "Poetry not installed"
choco install poetry
} else {
Write-Output "Poetry already installed"
}
- name: Install Dependencies
run: |
poetry config virtualenvs.create true
poetry install --no-root
- name: Build
run: poetry run pyinstaller -F main.py -n ToolDelta.exe -i logo.png
- 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/*
build_linux:
name: Build and Release for Linux
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.poetry
key: linux-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
linux-poetry-
- name: Check if Poetry is installed
run: |
if [ ! -f ~/.poetry/bin/poetry ]; then
echo "Poetry not installed"
curl -sSL https://install.python-poetry.org | python3 -
else
echo "Poetry already installed"
fi
- name: Install Dependencies
run: |
poetry config virtualenvs.create true
poetry install --no-root
- name: Build
run: poetry run pyinstaller -F main.py -n ToolDelta -i logo.png
- 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/*