Skip to content

Commit

Permalink
Fixed #48!
Browse files Browse the repository at this point in the history
  • Loading branch information
ShafiqSadat authored Sep 18, 2024
1 parent bc87953 commit 05ad431
Showing 1 changed file with 28 additions and 20 deletions.
48 changes: 28 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -30,51 +30,59 @@ jobs:
pyinstaller --onefile main.py
- name: Rename executable
run: |
Rename-Item -Path dist/main.exe -NewName HamsterKeyGen-v1.0.${{ github.run_number }}.exe
Rename-Item -Path dist/main.exe -NewName HamsterKeyGen-v1.0.${{ github.run_number }}-windows.exe
shell: pwsh
- name: Zip the exe
run: |
Compress-Archive -Path "dist/HamsterKeyGen-v1.0.${{ github.run_number }}-windows.exe" -DestinationPath "dist/HamsterKeyGen-v1.0.${{ github.run_number }}-windows.zip"
shell: pwsh
- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: windows-build
path: dist/HamsterKeyGen-v1.0.${{ github.run_number }}.exe
path: dist/HamsterKeyGen-v1.0.${{ github.run_number }}-windows.zip

build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
python3 -m pip install --upgrade pip
pip3 install -r requirements.txt
pip3 install pyinstaller
- name: Build executable
run: |
pyinstaller --onefile main.py
- name: Rename executable
pyinstaller --windowed --onefile main.py
- name: Rename app
run: |
mv dist/main dist/HamsterKeyGen-v1.0.${{ github.run_number }}.app
mv dist/main.app "HamsterKeyGen-v1.0.${{ github.run_number }}-macARM.app"
- name: Zip the app
run: |
zip -r "HamsterKeyGen-v1.0.${{ github.run_number }}-macARM.zip" "HamsterKeyGen-v1.0.${{ github.run_number }}-macARM.app"
- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: macos-build
path: dist/HamsterKeyGen-v1.0.${{ github.run_number }}.app
path: "HamsterKeyGen-v1.0.${{ github.run_number }}-macARM.zip"


create-release:
needs: [build-windows, build-macos]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Download Windows build
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: windows-build
path: ./build
- name: Download macOS build
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: macos-build
path: ./build
Expand Down

0 comments on commit 05ad431

Please sign in to comment.