mirror of
https://github.com/BubbaGumpShrump/AutoTrackR2.git
synced 2025-05-05 01:55:31 +00:00
Git building version.
This commit is contained in:
parent
b6508593db
commit
f9ce907f40
3 changed files with 40 additions and 31 deletions
65
.github/workflows/build.yml
vendored
65
.github/workflows/build.yml
vendored
|
@ -13,10 +13,11 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Extract version
|
||||
id: version
|
||||
- name: Get build number
|
||||
id: buildnumber
|
||||
run: |
|
||||
$version = (Select-String -Path "AutoTrackR2/UpdatePage.xaml.cs" -Pattern 'currentVersion = "(.+?)"' | Select-Object -First 1).Matches.Groups[1].Value
|
||||
$runNumber = $env:GITHUB_RUN_NUMBER
|
||||
$version = "2.$runNumber"
|
||||
echo "version=$version" >> $env:GITHUB_OUTPUT
|
||||
|
||||
- name: Setup .NET
|
||||
|
@ -28,44 +29,48 @@ jobs:
|
|||
run: dotnet restore AutoTrackR2.sln
|
||||
|
||||
- name: Build
|
||||
run: dotnet build AutoTrackR2.sln --configuration Release --no-restore
|
||||
|
||||
- name: List build output directories
|
||||
run: |
|
||||
Write-Host "Listing build output directories:"
|
||||
Get-ChildItem -Recurse -Directory -Filter "Release" | ForEach-Object { Write-Host $_.FullName }
|
||||
dotnet build AutoTrackR2.sln --configuration Release --no-restore -p:Version=${{ steps.buildnumber.outputs.version }}
|
||||
|
||||
- name: Create artifacts directory
|
||||
run: mkdir artifacts
|
||||
|
||||
- name: Copy build output
|
||||
- name: Create release directory
|
||||
run: |
|
||||
mkdir release
|
||||
$releaseDir = Get-ChildItem -Recurse -Directory -Filter "Release" | Select-Object -First 1
|
||||
if ($releaseDir) {
|
||||
Write-Host "Copying from: $($releaseDir.FullName)"
|
||||
Copy-Item "$($releaseDir.FullName)\*" "artifacts\" -Recurse
|
||||
# Copy main application files (excluding .pdb)
|
||||
Copy-Item "$($releaseDir.FullName)\AutoTrackR2.exe" "release\"
|
||||
Copy-Item "$($releaseDir.FullName)\AutoTrackR2.dll" "release\"
|
||||
Copy-Item "$($releaseDir.FullName)\AutoTrackR2.runtimeconfig.json" "release\"
|
||||
Copy-Item "$($releaseDir.FullName)\AutoTrackR2.deps.json" "release\"
|
||||
|
||||
# Copy resources
|
||||
Copy-Item "$($releaseDir.FullName)\config.ini" "release\"
|
||||
Copy-Item "$($releaseDir.FullName)\themes.json" "release\"
|
||||
Copy-Item "$($releaseDir.FullName)\AutoTrackR2.ico" "release\"
|
||||
|
||||
# Copy fonts
|
||||
Copy-Item "$($releaseDir.FullName)\Fonts\*" "release\Fonts\" -Recurse
|
||||
|
||||
# Copy assets
|
||||
Copy-Item "$($releaseDir.FullName)\Assets\*" "release\Assets\" -Recurse
|
||||
|
||||
# Copy sounds
|
||||
Copy-Item "$($releaseDir.FullName)\sounds\*" "release\sounds\" -Recurse
|
||||
|
||||
# Copy scripts
|
||||
Copy-Item "AutoTrackR2\scripts\*" "release\scripts\" -Recurse
|
||||
} else {
|
||||
Write-Host "No Release directory found"
|
||||
exit 1
|
||||
}
|
||||
|
||||
- name: Upload application artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: AutoTrackR2-${{ steps.version.outputs.version }}
|
||||
path: artifacts/
|
||||
retention-days: 5
|
||||
- name: Create zip file
|
||||
run: |
|
||||
Compress-Archive -Path "release\*" -DestinationPath "AutoTrackR2-${{ steps.buildnumber.outputs.version }}.zip" -Force
|
||||
|
||||
- name: Upload visorwipe script
|
||||
- name: Upload release artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: visorwipe.ahk
|
||||
path: AutoTrackR2/scripts/visorwipe.ahk
|
||||
retention-days: 5
|
||||
|
||||
- name: Upload videorecord script
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: videorecord.ahk
|
||||
path: AutoTrackR2/scripts/videorecord.ahk
|
||||
name: AutoTrackR2-${{ steps.buildnumber.outputs.version }}
|
||||
path: AutoTrackR2-${{ steps.buildnumber.outputs.version }}.zip
|
||||
retention-days: 5
|
||||
|
|
|
@ -10,6 +10,10 @@
|
|||
<Configurations>Debug;Release;Test</Configurations>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<ApplicationIcon>AutoTrackR2.ico</ApplicationIcon>
|
||||
<Version>2.0</Version>
|
||||
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
|
||||
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -2,5 +2,5 @@ namespace AutoTrackR2.Constants;
|
|||
|
||||
public static class AppConstants
|
||||
{
|
||||
public const string Version = "2.11";
|
||||
public static string Version => System.Reflection.Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? "2.0";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue