-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
579515d
commit a00b640
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |