Skip to content

Commit

Permalink
Update version and streamline release script
Browse files Browse the repository at this point in the history
This commit updates the version of the DetectiveSpecs project in the .csproj file. It also simplifies the UploadRelease.ps1 script by removing unnecessary comments and streamlining the code. In addition, it modifies the solution file to reference this updated script.
  • Loading branch information
EivindAntonsen committed Mar 8, 2024
1 parent 248ea80 commit 5fcf1ae
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
7 changes: 0 additions & 7 deletions .github/scripts/UploadRelease.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,24 @@ param(
[String]$version
)

# Define paths
$exeFilePath = "${workspace}\Staging\Build\DetectiveSpecs-v${version}.exe"
$zipFilePath = "${workspace}\Staging\Build\DetectiveSpecs-v${version}.zip"

# Remove any existing zip file at the destination path
if (Test-Path $zipFilePath) {
Remove-Item -Path $zipFilePath
}

# Create new compressed zip file
Compress-Archive -Path $exeFilePath -DestinationPath $zipFilePath

# Define GitHub API url
$assetFileName = [System.IO.Path]::GetFileName($zipFilePath)
$uri = "https://uploads.github.com/repos/EivindAntonsen/DetectiveSpecs/releases/${releaseId}/assets?name=${assetFileName}"

# Define headers for API request
$headers = @{
"Accept" = "application/vnd.github+json"
"Authorization" = "Bearer $accessToken"
"Content-Type" = "application/octet-stream"
}

# Read file data as bytes
$fileContent = [System.IO.File]::ReadAllBytes($zipFilePath)

# Make API request to upload file
Invoke-RestMethod -Method 'POST' -Uri $uri -Headers $headers -Body $fileContent
2 changes: 1 addition & 1 deletion DetectiveSpecs.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionIt
ProjectSection(SolutionItems) = preProject
.github\workflows\CI.yaml = .github\workflows\CI.yaml
.github\scripts\CreateRelease.ps1 = .github\scripts\CreateRelease.ps1
.github\scripts\UploadRelease2.ps1 = .github\scripts\UploadRelease2.ps1
.github\scripts\CheckVersion.ps1 = .github\scripts\CheckVersion.ps1
.github\scripts\Publish.ps1 = .github\scripts\Publish.ps1
.github\scripts\UploadRelease.ps1 = .github\scripts\UploadRelease.ps1
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "UnitTests\UnitTests.csproj", "{F73FB88E-6BDB-47AE-B7D5-10AEDF308627}"
Expand Down
2 changes: 1 addition & 1 deletion DetectiveSpecs/DetectiveSpecs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<TargetFramework>net8.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>1.0.10</Version>
<Version>1.0.11</Version>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 5fcf1ae

Please sign in to comment.