Skip to content

Commit da8985a

Browse files
dotnet-botvzarytovskiiKevinRansom
authored
Merge release/dev17.5 to main (#14634)
Co-authored-by: Vlad Zarytovskii <[email protected]> Co-authored-by: Kevin Ransom (msft) <[email protected]>
1 parent 1c1ee2a commit da8985a

File tree

5 files changed

+66
-0
lines changed

5 files changed

+66
-0
lines changed

azure-pipelines.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,38 @@ stages:
273273
DOTNET_ROLL_FORWARD_TO_PRERELEASE: 1
274274
displayName: Check code formatting (run 'dotnet fantomas src -r' to fix)
275275

276+
# Check whether package with current version has been published to nuget.org
277+
# We will try to restore both FSharp.Core and FCS and if restore is _successful_, package version needs to be bumped.
278+
# NOTE: This CI check should only run on the release branches.
279+
- job: Check_Published_Package_Versions
280+
condition: or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), or(startsWith(variables['System.PullRequest.SourceBranch'], 'release/dev'), startsWith(variables['System.PullRequest.TargetBranch'], 'release/dev')))
281+
pool:
282+
vmImage: $(UbuntuMachineQueueName)
283+
strategy:
284+
maxParallel: 2
285+
matrix:
286+
FCS:
287+
_project: "FSharp.Compiler.Service_notshipped.fsproj"
288+
FSCore:
289+
_project: "FSharp.Core_notshipped.fsproj"
290+
steps:
291+
- checkout: self
292+
clean: true
293+
- task: UseDotNet@2
294+
displayName: install SDK
295+
inputs:
296+
packageType: sdk
297+
useGlobalJson: true
298+
includePreviewVersions: true
299+
workingDirectory: $(Build.SourcesDirectory)
300+
installationPath: $(Agent.ToolsDirectory)/dotnet
301+
- pwsh: ./check.ps1 -project $(_project)
302+
workingDirectory: $(Build.SourcesDirectory)/buildtools/checkpackages
303+
env:
304+
DOTNET_ROLL_FORWARD_TO_PRERELEASE: 1
305+
displayName: Check published package version
306+
307+
276308
#-------------------------------------------------------------------------------------------------------------------#
277309
# PR builds #
278310
#-------------------------------------------------------------------------------------------------------------------#
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
<Project>
2+
23
</Project>

buildtools/checkpackages/FSharp.Compiler.Service_notshipped.fsproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,12 @@
2020
<PackageReference Include="FSharp.Compiler.Service" Version="[$(FSharpCompilerServicePackageVersion)]" />
2121
</ItemGroup>
2222

23+
<Target Name="WritePackageVersion" BeforeTargets="Restore">
24+
<WriteLinesToFile
25+
File="Version.txt"
26+
Lines="FSharp.Compiler.Service=$(FSharpCompilerServicePackageVersion)"
27+
Overwrite="true"
28+
Encoding="Unicode"/>
29+
</Target>
30+
2331
</Project>

buildtools/checkpackages/FSharp.Core_notshipped.fsproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,12 @@
1414
<PackageReference Include="FSharp.Core" Version="[$(FSCorePackageVersionValue)]" />
1515
</ItemGroup>
1616

17+
<Target Name="WritePackageVersion" BeforeTargets="Restore">
18+
<WriteLinesToFile
19+
File="Version.txt"
20+
Lines="FSharp.Core=$(FSCorePackageVersionValue)"
21+
Overwrite="true"
22+
Encoding="Unicode"/>
23+
</Target>
24+
1725
</Project>

buildtools/checkpackages/check.ps1

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# ENTRY POINT MAIN()
2+
Param(
3+
[Parameter(Mandatory=$True)]
4+
[String] $project
5+
)
6+
& dotnet restore $project 2>$null
7+
8+
if ($LASTEXITCODE -eq 0)
9+
{
10+
$package = Get-Content -Path .\Version.txt
11+
Write-Error "
12+
Package restore succeded for '${package}', expected to fail.
13+
This usually means that the package has been already published.
14+
Please, bump the version to fix this failure." -ErrorAction Stop
15+
} else {
16+
exit 0
17+
}

0 commit comments

Comments
 (0)