mirror of
https://github.com/BubbaGumpShrump/AutoTrackR2.git
synced 2025-05-16 22:25:30 +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:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Extract version
|
- name: Get build number
|
||||||
id: version
|
id: buildnumber
|
||||||
run: |
|
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
|
echo "version=$version" >> $env:GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Setup .NET
|
- name: Setup .NET
|
||||||
|
@ -28,44 +29,48 @@ jobs:
|
||||||
run: dotnet restore AutoTrackR2.sln
|
run: dotnet restore AutoTrackR2.sln
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: dotnet build AutoTrackR2.sln --configuration Release --no-restore
|
|
||||||
|
|
||||||
- name: List build output directories
|
|
||||||
run: |
|
run: |
|
||||||
Write-Host "Listing build output directories:"
|
dotnet build AutoTrackR2.sln --configuration Release --no-restore -p:Version=${{ steps.buildnumber.outputs.version }}
|
||||||
Get-ChildItem -Recurse -Directory -Filter "Release" | ForEach-Object { Write-Host $_.FullName }
|
|
||||||
|
|
||||||
- name: Create artifacts directory
|
- name: Create release directory
|
||||||
run: mkdir artifacts
|
|
||||||
|
|
||||||
- name: Copy build output
|
|
||||||
run: |
|
run: |
|
||||||
|
mkdir release
|
||||||
$releaseDir = Get-ChildItem -Recurse -Directory -Filter "Release" | Select-Object -First 1
|
$releaseDir = Get-ChildItem -Recurse -Directory -Filter "Release" | Select-Object -First 1
|
||||||
if ($releaseDir) {
|
if ($releaseDir) {
|
||||||
Write-Host "Copying from: $($releaseDir.FullName)"
|
# Copy main application files (excluding .pdb)
|
||||||
Copy-Item "$($releaseDir.FullName)\*" "artifacts\" -Recurse
|
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 {
|
} else {
|
||||||
Write-Host "No Release directory found"
|
Write-Host "No Release directory found"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
- name: Upload application artifact
|
- name: Create zip file
|
||||||
uses: actions/upload-artifact@v4
|
run: |
|
||||||
with:
|
Compress-Archive -Path "release\*" -DestinationPath "AutoTrackR2-${{ steps.buildnumber.outputs.version }}.zip" -Force
|
||||||
name: AutoTrackR2-${{ steps.version.outputs.version }}
|
|
||||||
path: artifacts/
|
|
||||||
retention-days: 5
|
|
||||||
|
|
||||||
- name: Upload visorwipe script
|
- name: Upload release artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: visorwipe.ahk
|
name: AutoTrackR2-${{ steps.buildnumber.outputs.version }}
|
||||||
path: AutoTrackR2/scripts/visorwipe.ahk
|
path: AutoTrackR2-${{ steps.buildnumber.outputs.version }}.zip
|
||||||
retention-days: 5
|
|
||||||
|
|
||||||
- name: Upload videorecord script
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: videorecord.ahk
|
|
||||||
path: AutoTrackR2/scripts/videorecord.ahk
|
|
||||||
retention-days: 5
|
retention-days: 5
|
||||||
|
|
|
@ -10,6 +10,10 @@
|
||||||
<Configurations>Debug;Release;Test</Configurations>
|
<Configurations>Debug;Release;Test</Configurations>
|
||||||
<Platforms>AnyCPU;x64</Platforms>
|
<Platforms>AnyCPU;x64</Platforms>
|
||||||
<ApplicationIcon>AutoTrackR2.ico</ApplicationIcon>
|
<ApplicationIcon>AutoTrackR2.ico</ApplicationIcon>
|
||||||
|
<Version>2.0</Version>
|
||||||
|
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
|
||||||
|
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -2,5 +2,5 @@ namespace AutoTrackR2.Constants;
|
||||||
|
|
||||||
public static class AppConstants
|
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