From 519ca8cf48ccedd5acd50e3686559a18f2b31b71 Mon Sep 17 00:00:00 2001 From: Mark Lambert Date: Tue, 31 Dec 2024 17:45:41 +0000 Subject: [PATCH 1/2] Create a github build with updated tools. Add public and private package publishing. Releases require a vX.Y.Z git tag on the master branch, for the version stamping. --- .config/dotnet-tools.json | 10 ++--- .github/workflows/build.yml | 45 +++++++++++++++++++ .github/workflows/private-publish.yml | 36 +++++++++++++++ .github/workflows/publish.yml | 36 +++++++++++++++ .paket/Paket.Restore.targets | 9 +++- .travis.yml | 19 -------- FSharp.Control.Reactive.sln | 2 - README.md | 3 +- appveyor.yml | 20 --------- build.ps1 | 22 +-------- global.json | 2 +- paket.dependencies | 2 + paket.lock | 12 +++-- src/Directory.Build.props | 8 ++-- .../paket.references | 3 +- src/FSharp.Control.Reactive/paket.references | 2 + 16 files changed, 152 insertions(+), 79 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/private-publish.yml create mode 100644 .github/workflows/publish.yml delete mode 100644 .travis.yml delete mode 100644 appveyor.yml diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 5278bbd..aeb9256 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,18 +3,16 @@ "isRoot": true, "tools": { "paket": { - "version": "8.0.3", + "version": "9.0.2", "commands": [ "paket" - ], - "rollForward": false + ] }, "fake-cli": { - "version": "6.1.1", + "version": "6.1.3", "commands": [ "fake" - ], - "rollForward": false + ] } } } \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..5bf7586 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,45 @@ +name: CI Build + +env: + # Stop wasting time caching packages + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + # Disable sending usage data to Microsoft + DOTNET_CLI_TELEMETRY_OPTOUT: true + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: windows-latest + permissions: + packages: write + contents: read + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup .NET Core + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 8.0.x + - name: Restore + run: dotnet tool restore + - name: Build + run: dotnet build -c Release + - name: Test + run: dotnet test --no-build -c Release tests + - name: Pack + run: dotnet pack --no-restore -c Release --include-symbols -o bin + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: nupkg-${{ matrix.runs-on }} + path: ./bin/*nupkg diff --git a/.github/workflows/private-publish.yml b/.github/workflows/private-publish.yml new file mode 100644 index 0000000..9e49279 --- /dev/null +++ b/.github/workflows/private-publish.yml @@ -0,0 +1,36 @@ +name: Private Publish + +env: + # Stop wasting time caching packages + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + # Disable sending usage data to Microsoft + DOTNET_CLI_TELEMETRY_OPTOUT: true + +on: + workflow_dispatch: + +jobs: + build: + + runs-on: windows-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup .NET Core + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 8.0.x + - name: Restore + run: dotnet tool restore + - name: Build + run: dotnet build -c Release + - name: Test + run: dotnet test --no-build -c Release tests + - name: Pack + run: dotnet pack -c Release --include-symbols -o bin + - name: Push Package to Local Feed + run: dotnet nuget push bin\*.nupkg -s https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json -k ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..3c5de2d --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,36 @@ +name: NuGet Publish + +env: + # Stop wasting time caching packages + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + # Disable sending usage data to Microsoft + DOTNET_CLI_TELEMETRY_OPTOUT: true + +on: + workflow_dispatch: + +jobs: + build: + + runs-on: windows-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup .NET Core + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 8.0.x + - name: Restore + run: dotnet tool restore + - name: Build + run: dotnet build -c Release + - name: Test + run: dotnet test --no-build -c Release tests + - name: Pack + run: dotnet pack --no-build -c Release --include-symbols -o bin + - name: Push Package to NuGet.org + run: dotnet nuget push bin\*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_KEY }} diff --git a/.paket/Paket.Restore.targets b/.paket/Paket.Restore.targets index bbeec15..17aeb63 100644 --- a/.paket/Paket.Restore.targets +++ b/.paket/Paket.Restore.targets @@ -235,14 +235,15 @@ $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',').Length) $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0]) $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1]) + $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[2]) $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[4]) $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5]) $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[6]) $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[7]) $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[8]) - - %(PaketReferencesFileLinesInfo.PackageVersion) + + %(PaketReferencesFileLinesInfo.PackageVersion) All runtime $(ExcludeAssets);contentFiles @@ -252,6 +253,10 @@ true + + + %(PaketReferencesFileLinesInfo.PackageVersion) + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ed8e4f5..0000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: csharp - -dotnet : 6.0.200 - -matrix: - include: - - os: linux - sudo: required - -script: - - dotnet --info - - dotnet tool restore - - dotnet build -c Release - - dotnet test --no-restore --no-build -c Release tests/FSharp.Control.Reactive.Tests.fsproj - - dotnet pack --no-restore -c Release --include-symbols - -branches: - except: - - gh-pages diff --git a/FSharp.Control.Reactive.sln b/FSharp.Control.Reactive.sln index e6a0bf2..313bb30 100644 --- a/FSharp.Control.Reactive.sln +++ b/FSharp.Control.Reactive.sln @@ -7,8 +7,6 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "project", "project", "{8961FBE9-1BE3-4A44-9610-5B4386DC5848}" ProjectSection(SolutionItems) = preProject .gitignore = .gitignore - .travis.yml = .travis.yml - appveyor.yml = appveyor.yml build.cmd = build.cmd build.fsx = build.fsx build.sh = build.sh diff --git a/README.md b/README.md index 46b716f..3a49697 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,7 @@ F# wrappers for the [Reactive Extensions (Rx)](http://msdn.microsoft.com/en-us/data/gg577609.aspx) [![NuGet Status](http://img.shields.io/nuget/v/FSharp.Control.Reactive.svg?style=flat)](https://www.nuget.org/packages/FSharp.Control.Reactive/) -[![Build status](https://ci.appveyor.com/api/projects/status/12euia5l32c7prk7/branch/master)](https://ci.appveyor.com/project/panesofglass/fsharp-control-reactive/branch/master) -[![Build Status](https://travis-ci.org/fsprojects/FSharp.Control.Reactive.svg?branch=master)](https://travis-ci.org/fsprojects/FSharp.Control.Reactive) +[[![CI Build](https://github.com/fsprojects/FSharp.Control.Reactive/actions/workflows/build.yml/badge.svg)](https://github.com/fsprojects/FSharp.Control.Reactive/actions/workflows/build.yml) ## Maintainer(s) diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index de09e0f..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,20 +0,0 @@ -image: Visual Studio 2022 -version: '{build}' -clone_depth: 10 -environment: - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - DOTNET_CLI_TELEMETRY_OPTOUT: 1 -init: - - git config --global core.autocrlf input -build_script: - - ps: | - .\build.ps1 - if ($lastexitcode -ne 0){ exit $lastexitcode } -test: false -artifacts: - - path: bin\*.nupkg -deploy: -- provider: Environment - name: FSharp.Control.Reactive - on: - APPVEYOR_REPO_TAG: true diff --git a/build.ps1 b/build.ps1 index fa813de..95f3955 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,22 +1,4 @@ -[xml]$doc = Get-Content .\src\Directory.Build.props -$version = $doc.Project.PropertyGroup.VersionPrefix # the version under development, update after a release -$versionSuffix = '-build.0' # manually incremented for local builds - -function isVersionTag($tag){ - $v = New-Object Version - [Version]::TryParse($tag, [ref]$v) -} - -if ($env:appveyor){ - $versionSuffix = '-build.' + $env:appveyor_build_number - if ($env:appveyor_repo_tag -eq 'true' -and (isVersionTag($env:appveyor_repo_tag_name))){ - $version = $env:appveyor_repo_tag_name - $versionSuffix = '' - } - Update-AppveyorBuild -Version "$version$versionSuffix" -} - dotnet tool restore -dotnet build -c Release /p:Version=$version$versionSuffix +dotnet build -c Release dotnet test --no-build -c Release tests -dotnet pack --no-restore -c Release /p:Version=$version$versionSuffix -o $psscriptroot/bin \ No newline at end of file +dotnet pack --no-restore -c Release --include-symbols -o $psscriptroot/bin \ No newline at end of file diff --git a/global.json b/global.json index a3bb3f5..2134ed9 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.200", + "version": "8.0.400", "rollForward": "latestFeature" } } \ No newline at end of file diff --git a/paket.dependencies b/paket.dependencies index 0284510..5b0efc0 100644 --- a/paket.dependencies +++ b/paket.dependencies @@ -14,6 +14,8 @@ nuget NUnit.Runners nuget NUnit3TestAdapter nuget FsCheck nuget Unquote +nuget GitVersion.MsBuild copy_local:true +nuget Microsoft.SourceLink.GitHub copy_local: true // [ FAKE GROUP ] group Build diff --git a/paket.lock b/paket.lock index cb259a4..b49382f 100644 --- a/paket.lock +++ b/paket.lock @@ -8,7 +8,9 @@ NUGET System.ValueTuple (>= 4.4) - restriction: || (== net472) (&& (== net6.0) (>= net45)) (&& (== netstandard2.0) (>= net45)) FsCheck (2.16.6) FSharp.Core (>= 4.2.3) - FSharp.Core (8.0.400) + FSharp.Core (6.0.7) + GitVersion.MsBuild (6.1) - copy_local: true + Microsoft.Build.Tasks.Git (8.0) - copy_local: true Microsoft.CodeCoverage (17.11.1) - restriction: || (== net472) (== net6.0) (&& (== netstandard2.0) (>= net462)) (&& (== netstandard2.0) (>= netcoreapp3.1)) Microsoft.NET.Test.Sdk (17.11.1) Microsoft.CodeCoverage (>= 17.11.1) - restriction: || (== net472) (== net6.0) (&& (== netstandard2.0) (>= net462)) (&& (== netstandard2.0) (>= netcoreapp3.1)) @@ -17,6 +19,10 @@ NUGET Microsoft.Reactive.Testing (6.0.1) System.Reactive (>= 6.0.1) System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (== net472) (&& (== net6.0) (>= net472)) (&& (== net6.0) (>= uap10.1)) (== netstandard2.0) + Microsoft.SourceLink.Common (8.0) - copy_local: true + Microsoft.SourceLink.GitHub (8.0) - copy_local: true + Microsoft.Build.Tasks.Git (>= 8.0) + Microsoft.SourceLink.Common (>= 8.0) Microsoft.TestPlatform.ObjectModel (17.11.1) - restriction: || (&& (== net472) (>= netcoreapp3.1)) (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) System.Reflection.Metadata (>= 1.6) Microsoft.TestPlatform.TestHost (17.11.1) - restriction: || (&& (== net472) (>= netcoreapp3.1)) (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) @@ -53,8 +59,8 @@ NUGET System.Threading.Tasks.Extensions (4.5.4) - restriction: || (== net472) (&& (== net6.0) (>= net472)) (&& (== net6.0) (>= uap10.1)) (== netstandard2.0) System.Runtime.CompilerServices.Unsafe (>= 4.5.3) - restriction: || (== net472) (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp2.1)) (&& (== net6.0) (< netstandard1.0)) (&& (== net6.0) (< netstandard2.0)) (&& (== net6.0) (>= wp8)) (== netstandard2.0) System.ValueTuple (4.5) - restriction: || (== net472) (&& (== net6.0) (>= net45)) (&& (== netstandard2.0) (>= net45)) - Unquote (7.0) - FSharp.Core (>= 8.0.100) + Unquote (7.0.1) + FSharp.Core (>= 6.0) GROUP Build NUGET diff --git a/src/Directory.Build.props b/src/Directory.Build.props index a71451d..a20f123 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,7 +1,6 @@ - 6.0.0 Ryan Riley;Steffen Forkmann;Jared Hester A F#-friendly wrapper for the Reactive Extensions. A F#-friendly wrapper for the Reactive Extensions. @@ -12,6 +11,8 @@ https://github.com/fsprojects/FSharp.Control.Reactive true + true + true @@ -19,11 +20,12 @@ true + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb true - symbols.nupkg + snupkg + - diff --git a/src/FSharp.Control.Reactive.Testing/paket.references b/src/FSharp.Control.Reactive.Testing/paket.references index d7d00ea..66b4e17 100644 --- a/src/FSharp.Control.Reactive.Testing/paket.references +++ b/src/FSharp.Control.Reactive.Testing/paket.references @@ -3,4 +3,5 @@ System.Reactive Microsoft.Reactive.Testing FsCheck fparsec -Unquote \ No newline at end of file +Unquote +Microsoft.SourceLink.GitHub \ No newline at end of file diff --git a/src/FSharp.Control.Reactive/paket.references b/src/FSharp.Control.Reactive/paket.references index 355c615..d9a9a73 100644 --- a/src/FSharp.Control.Reactive/paket.references +++ b/src/FSharp.Control.Reactive/paket.references @@ -1,2 +1,4 @@ FSharp.Core System.Reactive +GitVersion.MSBuild +Microsoft.SourceLink.GitHub \ No newline at end of file From 28dc9fdb1b154dc49dfd58bb9f4404baaf21439e Mon Sep 17 00:00:00 2001 From: Mark Lambert Date: Tue, 31 Dec 2024 21:14:19 +0000 Subject: [PATCH 2/2] Missing package reference --- src/FSharp.Control.Reactive.Testing/paket.references | 1 + 1 file changed, 1 insertion(+) diff --git a/src/FSharp.Control.Reactive.Testing/paket.references b/src/FSharp.Control.Reactive.Testing/paket.references index 66b4e17..0ab2123 100644 --- a/src/FSharp.Control.Reactive.Testing/paket.references +++ b/src/FSharp.Control.Reactive.Testing/paket.references @@ -4,4 +4,5 @@ Microsoft.Reactive.Testing FsCheck fparsec Unquote +GitVersion.MSBuild Microsoft.SourceLink.GitHub \ No newline at end of file