-
-
Notifications
You must be signed in to change notification settings - Fork 8
105 lines (88 loc) · 3.28 KB
/
Copy pathbuild.yml
File metadata and controls
105 lines (88 loc) · 3.28 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Build and Release
on:
pull_request:
types: [opened, reopened, synchronize, closed]
branches:
- main
workflow_dispatch:
inputs:
prerelease:
description: "Is this a pre-release?"
required: true
type: boolean
default: false
# Add permissions needed for creating releases
permissions:
contents: write
pull-requests: write
jobs:
install:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for proper commit counting
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install gdown
run: pip install gdown
- name: Download Visual Studio 2010 Ultimate
env:
FILE_ID: ${{ secrets.GDRIVE_VS2010_ULTIMATE_ISO_FILE_ID }}
run: |
gdown "https://drive.google.com/uc?id=$env:FILE_ID" --output vs2010_ultimate.iso
shell: pwsh
- name: Mount ISO and Install Visual Studio 2010 Ultimate
run: |
# Mount the ISO
$mountResult = Mount-DiskImage -ImagePath "$env:GITHUB_WORKSPACE\vs2010_ultimate.iso" -PassThru
$driveLetter = ($mountResult | Get-Volume).DriveLetter
# Install VCExpress
Write-Host "Installing VCExpress from ${driveLetter}:\Setup\setup.exe"
$process = Start-Process -FilePath "${driveLetter}:\Setup\setup.exe" -ArgumentList "/q /norestart" -Wait -PassThru
# Check installation result
if ($process.ExitCode -eq 3010) {
Write-Host "Installation completed but requires a reboot. Continuing without reboot."
} elseif ($process.ExitCode -ne 0) {
Write-Host "Installation failed with exit code: $($process.ExitCode)"
exit $process.ExitCode
}
# Unmount the ISO
Dismount-DiskImage -ImagePath "$env:GITHUB_WORKSPACE\vs2010_ultimate.iso"
shell: pwsh
- name: Download Xbox 360 SDK
env:
FILE_ID: ${{ secrets.GDRIVE_XBOX360_SDK_FILE_ID }}
run: |
gdown "https://drive.google.com/uc?id=$env:FILE_ID" --output xbox360_sdk.exe
shell: pwsh
- name: Install Xbox 360 SDK
run: |
Start-Process -FilePath "xbox360_sdk.exe" -ArgumentList "/U", "/T full" -Wait
- name: Build Plugin
id: build
run: |
# Get commit count
$commitCount = git rev-list --count HEAD
echo "BUILD_NUMBER=$commitCount" >> $env:GITHUB_OUTPUT
# Build using build.py which will use the same commit count
python build.py
echo "ZIP_FILE=iw3xe-r${commitCount}.zip" >> $env:GITHUB_OUTPUT
shell: pwsh
- name: Create Release
if: github.event_name == 'workflow_dispatch'
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: r${{ steps.build.outputs.BUILD_NUMBER }}
name: r${{ steps.build.outputs.BUILD_NUMBER }}
draft: false
prerelease: ${{ github.event.inputs.prerelease }}
generate_release_notes: true
files: |
build/${{ steps.build.outputs.ZIP_FILE }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}