diff --git a/.github/workflows/build-exe-manual.yml b/.github/workflows/build-exe-manual.yml new file mode 100644 index 0000000..2193abf --- /dev/null +++ b/.github/workflows/build-exe-manual.yml @@ -0,0 +1,52 @@ +name: Build and Release Windows Executable + +on: + workflow_dispatch: # Allows manual trigger from GitHub Actions + +jobs: + build-and-release: + runs-on: windows-latest + + steps: + # Step 1: Check out the repository + - name: Checkout repository + uses: actions/checkout@v3 + + # Step 2: Set up Python + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' # Specify your Python version + + # Step 3: Install dependencies + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pyinstaller requests pycryptodomex pywin32 + + # Step 4: Build the Python script into an .exe using PyInstaller + - name: Build executable + run: | + pyinstaller --onefile --icon icon.ico -w WindowsNt.py + + # Step 5: Create GitHub Release and Upload the .exe + - name: Create GitHub Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: 'manual-release-${{ github.run_id }}' # Unique tag for each manual release + release_name: Manual Release ${{ github.run_id }} + draft: false + prerelease: false + + - name: Upload .exe to release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: dist/WindowsNt.exe + asset_name: WindowsNt.exe + asset_content_type: application/octet-stream