diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6a8c4d5..af5f22f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 @@ -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 \ No newline at end of file