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 c3faac0 commit 116211a
Showing 1 changed file with 69 additions and 47 deletions.
116 changes: 69 additions & 47 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ on:
push:
tags:
- 'v*.*.*' # Triggert auf Tags wie v1.0.0, v1.0.1, etc.

permissions:
contents: write

jobs:
build-macos:
runs-on: macos-latest

outputs:
release_url: ${{ steps.create_release.outputs.upload_url }}

steps:
- name: Checkout Repository
uses: actions/checkout@v2
Expand All @@ -20,7 +24,7 @@ jobs:
with:
python-version: '3.11'

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

- name: Run Build Script for macOS
Expand All @@ -31,7 +35,7 @@ jobs:
cd dist
zip -r Mastermind-mac.zip Mastermind.app
- name: Create Release
- name: Create Release (macOS)
id: create_release
uses: actions/create-release@v1
env:
Expand All @@ -56,48 +60,66 @@ jobs:
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: List Files in dist
run: |
cd dist
dir # Auf Windows verwendet, um den Inhalt des Verzeichnisses aufzulisten
- 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
- name: Checkout Repository
uses: actions/checkout@v2

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

- name: Install Dependencies
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: List Files in dist
run: |
cd dist
dir # Auf Windows verwendet, um den Inhalt des Verzeichnisses aufzulisten
- name: Zip the .exe file
run: |
cd dist
powershell Compress-Archive -Path Mastermind -DestinationPath Mastermind-win.zip
create-release:
runs-on: ubuntu-latest
needs: [build-macos, build-windows]

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

- 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 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

- 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 116211a

Please sign in to comment.