Adding xorg dep #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Release DotA2-Autoacecpter | |
on: | |
push: | |
tags: | |
- 'v*' | |
env: | |
TAG_NAME: ${{ github.ref_name }} | |
permissions: | |
id-token: write | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Set environment variables | |
run: | | |
echo "EXPORT_NAME=dota2_autoaccepter_${TAG_NAME#'v'}" >> $GITHUB_ENV | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.8' | |
cache: 'pip' | |
- name: Install Xorg and Wayland libraries | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libx11-dev libxext-dev libxtst-dev libxkbfile-dev libx11-xcb-dev libwayland-client0 libwayland-cursor0 libwayland-egl1-mesa | |
- name: Install Dependencies | |
run: | | |
python -m venv Env | |
source Env/bin/activate | |
pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install pyinstaller | |
- name: Build with PyInstaller | |
run: | | |
source Env/bin/activate | |
pyinstaller --onefile \ | |
--add-data "templates:templates" \ | |
--hidden-import=argparse \ | |
--hidden-import=pynput.keyboard \ | |
--hidden-import=pynput.keyboard._xorg \ | |
--hidden-import=pynput.mouse \ | |
--hidden-import=pynput.mouse._xorg \ | |
--name=$EXPORT_NAME autoaccepter/main.py | |
- name: Create Executable | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.EXPORT_NAME }} | |
path: dist/${{ env.EXPORT_NAME }} | |
retention-days: 1 | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: dist/${{ env.EXPORT_NAME }} | |
body: | | |
${{ github.event.head_commit.message }} | |
- name: Make Executable (Linux) | |
run: chmod +x dist/${{ env.EXPORT_NAME }} | |
if: runner.os == 'Linux' |