|
| 1 | +name: Compile the project |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + version: |
| 7 | + description: 'File version (e.g. 1.1.0.0)' |
| 8 | + required: true |
| 9 | + tagname: |
| 10 | + description: 'Tag name (e.g. 1.1.0.0-test)' |
| 11 | + required: true |
| 12 | + release_name: |
| 13 | + description: 'Release name' |
| 14 | + required: true |
| 15 | + |
| 16 | +jobs: |
| 17 | + macOS: |
| 18 | + runs-on: macos-latest |
| 19 | + outputs: |
| 20 | + artifact_mac: ${{ steps.upload.outputs.artifact_mac }} |
| 21 | + steps: |
| 22 | + - name: Checkout Repo |
| 23 | + uses: actions/checkout@v4 |
| 24 | + |
| 25 | + - name: Set up Python |
| 26 | + uses: actions/setup-python@v5 |
| 27 | + with: |
| 28 | + python-version: '3.11' |
| 29 | + |
| 30 | + - name: Compile |
| 31 | + run: | |
| 32 | + python -m pip install --upgrade pip |
| 33 | + python -m pip install charset_normalizer pyinstaller -r requirements.txt |
| 34 | + pyinstaller --onefile --clean --target-arch universal2 main.py |
| 35 | + chmod a+x ./dist/main |
| 36 | + mv ./dist/main "./ESET-KeyGen_v${{ github.event.inputs.version }}_macos" |
| 37 | +
|
| 38 | + - name: Upload macOS artifact |
| 39 | + uses: actions/upload-artifact@v4 |
| 40 | + with: |
| 41 | + name: macos-artifact |
| 42 | + path: ./ESET-KeyGen_v${{ github.event.inputs.version }}_macos |
| 43 | + |
| 44 | + windows: |
| 45 | + runs-on: windows-latest |
| 46 | + steps: |
| 47 | + - name: Checkout Repo |
| 48 | + uses: actions/checkout@v4 |
| 49 | + |
| 50 | + - name: Download DLL patch |
| 51 | + run: | |
| 52 | + Invoke-WebRequest -Uri "https://github.com/nalexandru/api-ms-win-core-path-HACK/releases/download/0.3.1/api-ms-win-core-path-blender-0.3.1.zip" -OutFile dlls.zip |
| 53 | + Expand-Archive -Path dlls.zip -DestinationPath dll_patch |
| 54 | +
|
| 55 | + - name: Compile win32 |
| 56 | + run: | |
| 57 | + mkdir legacy |
| 58 | + cd legacy |
| 59 | + Invoke-WebRequest -Uri "https://github.com/shadowcopyrz/etkg/releases/download/python380-portable-win32/python-v3.8.0-portable_win32.zip" -OutFile "python-portable.zip" |
| 60 | + Expand-Archive -Path "python-portable.zip" -DestinationPath . |
| 61 | + .\python.exe -m pip install --upgrade pip --no-warn-script-location |
| 62 | + .\python.exe -m pip install pyinstaller -r ../requirements.txt --no-warn-script-location |
| 63 | + Scripts\pyinstaller.exe --onefile --collect-data selenium_stealth --add-data ..\dll_patch\api-ms-win-core-path-blender\x86\api-ms-win-core-path-l1-1-0.dll:. ../main.py |
| 64 | + Move-Item -Path .\dist\main.exe -Destination "../ESET-KeyGen_v${{ github.event.inputs.version }}_win32.exe" |
| 65 | +
|
| 66 | + - name: Compile win64 |
| 67 | + run: | |
| 68 | + pip install --upgrade pip |
| 69 | + pip install pyinstaller -r requirements.txt |
| 70 | + pyinstaller --onefile --collect-data selenium_stealth --add-data dll_patch\api-ms-win-core-path-blender\x64\api-ms-win-core-path-l1-1-0.dll:. main.py |
| 71 | + Move-Item -Path .\dist\main.exe -Destination "ESET-KeyGen_v${{ github.event.inputs.version }}_win64.exe" |
| 72 | +
|
| 73 | + - name: Upload Windows artifacts |
| 74 | + uses: actions/upload-artifact@v4 |
| 75 | + with: |
| 76 | + name: windows-artifacts |
| 77 | + path: | |
| 78 | + ESET-KeyGen_v${{ github.event.inputs.version }}_win32.exe |
| 79 | + ESET-KeyGen_v${{ github.event.inputs.version }}_win64.exe |
| 80 | +
|
| 81 | + release: |
| 82 | + needs: [macOS, windows] |
| 83 | + runs-on: ubuntu-latest |
| 84 | + steps: |
| 85 | + - name: Download macOS artifact |
| 86 | + uses: actions/download-artifact@v5 |
| 87 | + with: |
| 88 | + name: macos-artifact |
| 89 | + |
| 90 | + - name: Download Windows artifacts |
| 91 | + uses: actions/download-artifact@v5 |
| 92 | + with: |
| 93 | + name: windows-artifacts |
| 94 | + |
| 95 | + - name: Create Release and Upload Assets |
| 96 | + uses: softprops/action-gh-release@v2 |
| 97 | + with: |
| 98 | + name: ${{ github.event.inputs.release_name }} |
| 99 | + tag_name: v${{ github.event.inputs.tagname }} |
| 100 | + draft: false |
| 101 | + generate_release_notes: true |
| 102 | + files: | |
| 103 | + ESET-KeyGen_v${{ github.event.inputs.version }}_macos |
| 104 | + ESET-KeyGen_v${{ github.event.inputs.version }}_win32.exe |
| 105 | + ESET-KeyGen_v${{ github.event.inputs.version }}_win64.exe |
| 106 | + env: |
| 107 | + GITHUB_TOKEN: ${{ secrets.PAT }} |
0 commit comments