Repository navigation
50 lines (40 loc) · 1.71 KB
/
Copy pathrelease.yml
File metadata and controls
50 lines (40 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Build on Release
on:
release:
types:
- published
jobs:
build-and-release:
runs-on: windows-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Install pyenv-win
run: Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/pyenv-win/pyenv-win/master/pyenv-win/install-pyenv-win.ps1" -OutFile "./install-pyenv-win.ps1"; &"./install-pyenv-win.ps1"
- name: Setup pyenv and Python environment
run: |
$env:PATH = "$env:USERPROFILE\.pyenv\pyenv-win\bin;$env:USERPROFILE\.pyenv\pyenv-win\shims;$env:PATH"
pyenv install $(Get-Content .python-version)
pyenv local $(Get-Content .python-version)
pyenv exec python -m venv venv
- name: Install dependencies
run: |
.\venv\Scripts\activate.ps1
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Replace version placeholder with release version
run: |
$filePath = "AutoAFK2.py"
$version = "${{ github.event.release.tag_name }}"
(Get-Content $filePath) -replace '<DEVELOPMENT_VERSION>', $version | Set-Content $filePath
- name: Create the executable
run: |
.\venv\Scripts\activate.ps1
pyinstaller --clean --onedir --icon="img/auto.ico" --add-data "adbutils;adbutils" --add-data "img;img" --add-data "venv/Lib/site-packages/scrcpy/scrcpy-server.jar;scrcpy" AutoAFK2.py
cp .\settings.ini .\dist\AutoAFK2\
- name: Zip the dist directory
run: Compress-Archive -Path .\dist\AutoAFK2\* -DestinationPath AutoAFK2.zip
- name: Upload the ZIP to the release
uses: softprops/action-gh-release@v2
with:
files: AutoAFK2.zip