Skip to content

Commit

Permalink
Adding Windows support
Browse files Browse the repository at this point in the history
  • Loading branch information
frievoe97 committed Aug 27, 2024
1 parent 0d7178e commit b081a61
Showing 1 changed file with 24 additions and 42 deletions.
66 changes: 24 additions & 42 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,16 @@ permissions:
contents: write

jobs:
build-macos:
runs-on: macos-latest
build:
runs:
matrix:
os: [macos-latest, windows-latest]

strategy:
matrix:
os: [macos-latest, windows-latest]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout Repository
Expand All @@ -23,13 +31,20 @@ jobs:
- name: Install Dependencies with Constraint
run: python -m pip install -r requirements.txt

- name: Run Build Script for macOS
run: python build_script_macos.py # Führt das macOS-Build-Skript aus
- name: Run Build Script
run: python build_script.py # Führt dein Build-Skript aus

- name: Zip the Build Artifact
if: matrix.os == 'macos-latest'
run: |
cd dist
zip -r Mastermind.zip Mastermind.app
- name: Zip the .app file
- name: Zip the Build Artifact
if: matrix.os == 'windows-latest'
run: |
cd dist
zip -r Mastermind-mac.zip Mastermind.app
Compress-Archive -Path Mastermind -DestinationPath Mastermind-win.zip
- name: Create Release
id: create_release
Expand All @@ -42,45 +57,12 @@ jobs:
draft: false
prerelease: false

- name: Upload macOS Build Artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/Mastermind-mac.zip
asset_name: Mastermind-mac.zip
asset_content_type: application/zip

build-windows:
runs-on: windows-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11'

- name: Install Dependencies with Constraint
run: python -m pip install -r requirements.txt

- name: Run Build Script for Windows
run: python build_script_windows.py # Führt das Windows-Build-Skript aus

- name: Zip the .exe file
run: |
cd dist
zip -r Mastermind-win.zip Mastermind
- name: Upload Windows Build Artifact
- name: Upload Build Artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/Mastermind-win.zip
asset_name: Mastermind-win.zip
asset_path: ${{ matrix.os == 'macos-latest' && 'dist/Mastermind.zip' || 'dist/Mastermind-win.zip' }} # Pfad zur erstellten .app oder .exe Datei
asset_name: ${{ matrix.os == 'macos-latest' && 'Mastermind.zip' || 'Mastermind-win.zip' }}
asset_content_type: application/zip

0 comments on commit b081a61

Please sign in to comment.