Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 401d717adf | |||
| cfac39a838 | |||
| a408b0fd27 | |||
| 4aba0049f5 | |||
| 7ad87a1398 | |||
| db9930f3b6 |
@@ -23,12 +23,37 @@ jobs:
|
||||
- name: Build Release
|
||||
run: dotnet build --configuration Release --no-restore
|
||||
|
||||
- name: Publish
|
||||
run: dotnet publish DellMonitorControl/DellMonitorControl.csproj -c Release -o ./publish --self-contained false
|
||||
|
||||
- name: Create ZIP archive
|
||||
run: Compress-Archive -Path ./publish/* -DestinationPath ./MonitorControl-${{ gitea.ref_name }}.zip
|
||||
- name: Update version in ISS
|
||||
shell: powershell
|
||||
run: |
|
||||
$version = "${{ gitea.ref_name }}".TrimStart("v")
|
||||
$issPath = "DellMonitorControl/MonitorControl.iss"
|
||||
(Get-Content $issPath) -replace '#define MyAppVersion ".*"', "#define MyAppVersion `"$version`"" | Set-Content $issPath
|
||||
|
||||
- name: List build output
|
||||
shell: cmd
|
||||
run: |
|
||||
echo "Current directory:"
|
||||
cd
|
||||
echo "DellMonitorControl contents:"
|
||||
dir DellMonitorControl
|
||||
echo "DellMonitorControl\bin contents:"
|
||||
dir DellMonitorControl\bin
|
||||
echo "DellMonitorControl\bin\Release contents:"
|
||||
dir DellMonitorControl\bin\Release
|
||||
echo "DellMonitorControl\bin\Release\net9.0-windows contents:"
|
||||
dir DellMonitorControl\bin\Release\net9.0-windows
|
||||
|
||||
- name: Build Installer
|
||||
shell: powershell
|
||||
run: |
|
||||
Write-Host "Current directory: $(Get-Location)"
|
||||
Write-Host "Creating installer output directory..."
|
||||
New-Item -ItemType Directory -Force -Path "DellMonitorControl\installer"
|
||||
Write-Host "Running Inno Setup..."
|
||||
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /O"DellMonitorControl\installer" "DellMonitorControl\MonitorControl.iss"
|
||||
Write-Host "Listing installer directory:"
|
||||
Get-ChildItem "DellMonitorControl\installer"
|
||||
|
||||
- name: Create Release
|
||||
shell: powershell
|
||||
@@ -36,6 +61,7 @@ jobs:
|
||||
GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
run: |
|
||||
$tag = "${{ gitea.ref_name }}"
|
||||
$version = $tag.TrimStart("v")
|
||||
$repo = "misc/ControlMyMonitorManagement"
|
||||
$baseUrl = "https://git.marketally.com/api/v1"
|
||||
|
||||
@@ -51,7 +77,7 @@ jobs:
|
||||
$body = @{
|
||||
tag_name = $tag
|
||||
name = "Monitor Control $tag"
|
||||
body = "## Monitor Control $tag`n`n### Installation`n1. Download the ZIP file`n2. Extract to a folder`n3. Run DellMonitorControl.exe`n`n### Requirements`n- Windows 10/11`n- .NET 9.0 Runtime"
|
||||
body = "## Monitor Control $tag`n`n### Installation`nDownload and run the installer.`n`n### Features`n- System tray monitor control`n- Brightness/Contrast adjustment`n- Input source switching`n- Quick-switch toolbar`n`n### Requirements`n- Windows 10/11`n- .NET 9.0 Runtime"
|
||||
} | ConvertTo-Json
|
||||
|
||||
$release = Invoke-RestMethod -Uri "$baseUrl/repos/$repo/releases" -Method Post -Headers @{"Authorization"="token $env:GITEA_TOKEN"; "Content-Type"="application/json"} -Body $body
|
||||
@@ -59,11 +85,11 @@ jobs:
|
||||
Write-Host "Release created with ID: $releaseId"
|
||||
}
|
||||
|
||||
# Upload asset using curl (more reliable for file uploads)
|
||||
$filePath = "./MonitorControl-$tag.zip"
|
||||
$fileName = "MonitorControl-$tag.zip"
|
||||
# Upload installer
|
||||
$filePath = "DellMonitorControl/installer/MonitorControl-Setup-$version.exe"
|
||||
$fileName = "MonitorControl-Setup-$version.exe"
|
||||
Write-Host "Uploading $fileName..."
|
||||
|
||||
curl.exe -X POST -H "Authorization: token $env:GITEA_TOKEN" -F "attachment=@$filePath" "$baseUrl/repos/$repo/releases/$releaseId/assets?name=$fileName"
|
||||
|
||||
Write-Host "Asset uploaded successfully"
|
||||
Write-Host "Installer uploaded successfully"
|
||||
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -365,5 +365,5 @@ FodyWeavers.xsd
|
||||
# Claude Code
|
||||
.claude/
|
||||
|
||||
# Windows special files
|
||||
nul
|
||||
# Inno Setup output
|
||||
DellMonitorControl/installer/
|
||||
|
||||
39
DellMonitorControl/MonitorControl.iss
Normal file
39
DellMonitorControl/MonitorControl.iss
Normal file
@@ -0,0 +1,39 @@
|
||||
#define MyAppName "Monitor Control"
|
||||
#define MyAppVersion "1.0.0"
|
||||
#define MyAppPublisher "Dang"
|
||||
#define MyAppExeName "DellMonitorControl.exe"
|
||||
|
||||
[Setup]
|
||||
AppId={{8F3E4A2B-1C5D-4E6F-9A8B-7C2D1E3F4A5B}
|
||||
AppName={#MyAppName}
|
||||
AppVersion={#MyAppVersion}
|
||||
AppPublisher={#MyAppPublisher}
|
||||
DefaultDirName={autopf}\{#MyAppName}
|
||||
DefaultGroupName={#MyAppName}
|
||||
AllowNoIcons=yes
|
||||
OutputDir=installer
|
||||
OutputBaseFilename=MonitorControl-Setup-{#MyAppVersion}
|
||||
Compression=lzma
|
||||
SolidCompression=yes
|
||||
WizardStyle=modern
|
||||
PrivilegesRequired=admin
|
||||
UninstallDisplayIcon={app}\{#MyAppExeName}
|
||||
|
||||
[Languages]
|
||||
Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||
|
||||
[Tasks]
|
||||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
||||
Name: "startupicon"; Description: "Start with Windows"; GroupDescription: "Startup:"
|
||||
|
||||
[Files]
|
||||
Source: "bin\Release\net9.0-windows\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||
|
||||
[Icons]
|
||||
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
|
||||
Name: "{group}\Uninstall {#MyAppName}"; Filename: "{uninstallexe}"
|
||||
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
|
||||
Name: "{userstartup}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: startupicon
|
||||
|
||||
[Run]
|
||||
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
|
||||
Reference in New Issue
Block a user