forked from rzc0d3r/ESET-KeyGen
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (74 loc) · 2.89 KB
/
compile.yml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Compile the project
on:
workflow_dispatch:
inputs:
version:
description: 'File version (Without spaces and brackets) (Eg: 1.1.0.0, 1.1.0.0-pre)'
required: true
tagname:
description: 'TagName release (Without spaces and brackets) (Eg: 1.1.0.0-test)'
required: true
release_name:
description: 'Release name'
required: true
jobs:
macOS:
runs-on: macos-latest
steps:
- name: 'Checkout Repo'
uses: actions/checkout@v3
- name: Compile
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
pyinstaller --onefile --clean main.py
chmod a+x ./dist/main
mv ./dist/main "./ESET-KeyGen_v${{ github.event.inputs.version }}_macos"
- name: Release
if: github.ref == 'refs/heads/main'
uses: softprops/action-gh-release@v1
with:
files: |
ESET-KeyGen_v${{ github.event.inputs.version }}_macos
name: ${{ github.event.inputs.release_name }}
tag_name: v${{ github.event.inputs.tagname }}
draft: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
Windows:
runs-on: windows-latest
steps:
- name: 'Checkout Repo'
uses: actions/checkout@v3
- name: Compile (based on Python 3.8.0 x32)
run: |
mkdir legacy
cd legacy
Invoke-WebRequest -Uri "https://github.com/rzc0d3r/ESET-KeyGen/releases/download/python380-portable-win32/python-v3.8.0-portable_win32.zip" -OutFile "python-v3.8.0-portable_win32.zip"
Expand-Archive -Path "python-v3.8.0-portable_win32.zip" -DestinationPath .
.\python.exe -m pip install pyinstaller --no-warn-script-location
.\python.exe -m pip install -r ../requirements.txt --no-warn-script-location
Scripts/pyinstaller.exe --onefile --clean ../main.py
Move-Item -Path .\dist\main.exe -Destination ".\ESET-KeyGen_v${{ github.event.inputs.version }}_win32.exe"
cd ..
- name: Compile (based on Python x64)
run: |
pip install -r requirements.txt
pip install pyinstaller
pyinstaller --onefile --clean main.py
Move-Item -Path .\dist\main.exe -Destination ".\ESET-KeyGen_v${{ github.event.inputs.version }}_win64.exe"
- name: Release
if: github.ref == 'refs/heads/main'
uses: softprops/action-gh-release@v1
with:
files: |
legacy/ESET-KeyGen_v${{ github.event.inputs.version }}_win32.exe
ESET-KeyGen_v${{ github.event.inputs.version }}_win64.exe
name: ${{ github.event.inputs.release_name }}
tag_name: v${{ github.event.inputs.tagname }}
draft: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.PAT }}