From b081a6157d39a211d5bd2229e2d45871a7ce603b Mon Sep 17 00:00:00 2001 From: frievoe97 Date: Tue, 27 Aug 2024 16:01:37 +0200 Subject: [PATCH] Adding Windows support --- .github/workflows/release.yml | 66 +++++++++++++---------------------- 1 file changed, 24 insertions(+), 42 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ac0789f..6a8c4d5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 @@ -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