Adding Windows support #30
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Release | |
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: | |
mac_zip: ${{ steps.upload_macos.outputs.artifact_path }} | |
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 | |
run: python -m pip install -r requirements.txt | |
- name: Run Build Script for macOS | |
run: | | |
python build_script_macos.py | |
cd dist | |
zip -r Mastermind-mac.zip Mastermind.app | |
echo "::set-output name=artifact_path::$(pwd)/dist/Mastermind-mac.zip" | |
id: upload_macos | |
build-windows: | |
runs-on: windows-latest | |
outputs: | |
win_zip: ${{ steps.upload_windows.outputs.artifact_path }} | |
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 | |
run: python -m pip install -r requirements.txt | |
- name: Run Build Script for Windows | |
run: | | |
python build_script_windows.py | |
cd dist | |
powershell Compress-Archive -Path Mastermind -DestinationPath Mastermind-win.zip | |
echo "::set-output name=artifact_path::$(pwd)/dist/Mastermind-win.zip" | |
id: upload_windows | |
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: ${{ needs.build-macos.outputs.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: ${{ needs.build-windows.outputs.win_zip }} | |
asset_name: Mastermind-win.zip | |
asset_content_type: application/zip |