-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (64 loc) · 2.29 KB
/
build_win.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Build Windows
on:
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- name: Restore .NET dependencies
run: |
cd ModManagerCore
dotnet restore
- name: Build .NET project
run: |
cd ModManagerCore
dotnet build --configuration Release
- name: Publish .NET project
run: |
cd ModManagerCore
dotnet publish --configuration Release --output ${{ github.workspace }}/publish/Core --self-contained -r win-x64
- name: List published files
run: |
dir ${{ github.workspace }}/publish/Core
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies for Python
run: |
python -m pip install --upgrade pip
pip install PySide6 pyinstaller
- name: Build ModManagerGUI with PyInstaller
run: |
cd ModManagerGUI
pyinstaller --add-data "${{ github.workspace }}/publish/Core;Core" --name ModManagerGUI --windowed main.py
- name: Zip ModManagerGUI directory
run: |
cd ${{ github.workspace }}/ModManagerGUI/dist
powershell -Command "Compress-Archive -Path ModManagerGUI -DestinationPath ModManagerGUI_win.zip"
- name: Create a new release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: win_${{ github.run_number }}
release_name: "Windows Release ${{ github.run_number }}" # Optional, you can change the name
draft: false # Set to true if you want to create a draft release
prerelease: false # Set to true if it's a prerelease
body: "Release for Windows"
- name: Upload ModManagerGUI artifact to release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/ModManagerGUI/dist/ModManagerGUI_win.zip
asset_name: ModManagerGUI_win.zip
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}