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 b081a61 commit 5e77df4
Showing 1 changed file with 53 additions and 24 deletions.
77 changes: 53 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,8 @@ permissions:
contents: write

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

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

runs-on: ${{ matrix.os }}
build-macos:
runs-on: macos-latest

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

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

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

- name: Upload Build Artifact
- 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: ${{ 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_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
powershell Compress-Archive -Path Mastermind -DestinationPath Mastermind-win.zip
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload Windows 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_content_type: application/zip

0 comments on commit 5e77df4

Please sign in to comment.