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 0525111 commit 465e021
Showing 1 changed file with 43 additions and 10 deletions.
53 changes: 43 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,22 @@ jobs:

- name: Run Build Script for macOS
run: |
echo "Starting macOS build script..."
python build_script_macos.py
echo "Building macOS ZIP file..."
cd dist
zip -r Mastermind-mac.zip Mastermind.app
echo "::set-output name=artifact_path::$(pwd)/Mastermind-mac.zip"
echo "macOS ZIP file created at $(pwd)/Mastermind-mac.zip"
echo "artifact_path=$(pwd)/Mastermind-mac.zip" >> $GITHUB_ENV
id: upload_macos

- name: List Files in dist (macOS)
run: |
echo "Listing files in dist directory..."
cd dist
ls -al
echo "macOS build completed."
build-windows:
runs-on: windows-latest
outputs:
Expand All @@ -53,12 +63,22 @@ jobs:

- name: Run Build Script for Windows
run: |
echo "Starting Windows build script..."
python build_script_windows.py
echo "Building Windows ZIP file..."
cd dist
powershell Compress-Archive -Path Mastermind -DestinationPath Mastermind-win.zip
echo "::set-output name=artifact_path::$(pwd)/Mastermind-win.zip"
echo "Windows ZIP file created at $(pwd)/Mastermind-win.zip"
echo "artifact_path=$(pwd)/Mastermind-win.zip" >> $GITHUB_ENV
id: upload_windows

- name: List Files in dist (Windows)
run: |
echo "Listing files in dist directory..."
cd dist
dir
echo "Windows build completed."
create-release:
runs-on: ubuntu-latest
needs: [build-macos, build-windows]
Expand All @@ -68,16 +88,24 @@ jobs:

- 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
run: |
echo "Creating release..."
echo "Tag: ${{ github.ref }}"
echo "Release name: Release ${{ github.ref }}"
echo "Creating GitHub release..."
curl -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
-d '{"tag_name": "${{ github.ref }}", "name": "Release ${{ github.ref }}", "draft": false, "prerelease": false}' \
https://api.github.com/repos/${{ github.repository }}/releases
echo "Release created."
- name: Upload macOS Build Artifact
run: |
echo "Uploading macOS artifact..."
echo "Upload URL: ${{ steps.create_release.outputs.upload_url }}"
echo "Asset path: ${{ needs.build-macos.outputs.mac_zip }}"
echo "Asset name: Mastermind-mac.zip"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -88,6 +116,11 @@ jobs:
asset_content_type: application/zip

- name: Upload Windows Build Artifact
run: |
echo "Uploading Windows artifact..."
echo "Upload URL: ${{ steps.create_release.outputs.upload_url }}"
echo "Asset path: ${{ needs.build-windows.outputs.win_zip }}"
echo "Asset name: Mastermind-win.zip"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 465e021

Please sign in to comment.