Skip to content

Build and Upload TOsk Binary #18

Build and Upload TOsk Binary

Build and Upload TOsk Binary #18

Workflow file for this run

name: "Build and Upload TOsk Binary"
on:
workflow_dispatch:
inputs:
version:
description: "Version tag (e.g., v1.0.6)"
required: true
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write # Explicitly grant write permissions
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Set up Python"
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: "Install system dependencies"
run: |
sudo apt-get update
sudo apt-get install -y python3-venv
- name: "Set up virtual environment and install dependencies"
run: |
python3 -m venv venv
./venv/bin/pip install --upgrade pip
./venv/bin/pip install -r requirements.txt
- name: "Debug: List venv/bin contents"
run: ls -l venv/bin
- name: "Build binary with PyInstaller"
run: |
./venv/bin/python -m PyInstaller --onefile \
--add-data "bin/viu:bin" \
--add-data "tosk.jpg:." \
main.py
mv dist/main dist/tosk-linux-x86_64
- name: "Create Git tag"
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git tag -a ${{ github.event.inputs.version }} -m "Release ${{ github.event.inputs.version }}"
git push origin ${{ github.event.inputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Upload TOsk Binary to Release"
uses: ncipollo/release-action@v1
with:
artifacts: "dist/tosk-linux-x86_64"
tag: ${{ github.event.inputs.version }}
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
generateReleaseNotes: true