Commit Graph

97 Commits

Author SHA1 Message Date
Marc Gravell 8becae8d0e Publish to nuget.org via Trusted Publishing (OIDC), and retire MyGet/AppVeyor (#2230)
* Fix the release-tag pattern in version.json

publicReleaseRefSpec requires `^refs/tags/v\d+\.\d+`, but every tag this repo has
ever cut is unprefixed - 2.1.79, 2.1.72, 2.1.66 and so on - so the regex cannot
match any of them. Checking out the real 2.1.79 tag and asking nbgv gives
`2.1.79-g72a54c475f`, PublicRelease False: a tag-triggered build has always
produced a -g suffixed version, which is fine while releases are pushed by hand
and fatal once a workflow does it. Relaxed to `v?` so both spellings work.

Same fix, same reason, as DapperAOT b5194b4 and StackExchange.Redis 611e478.
Also adds the `$schema` line the file was missing.

* CI: report the computed version, build on SDK 11, and test net481

**Report the computed version.** A step writes NuGetPackageVersion to the job
summary and the log, before the build so it stays legible when a later step
fails. Cutting a release now means reading that line off a green main run and
tagging with exactly it - so the number has to be visible. A PR run builds
refs/pull/N/merge, whose height includes the branch commits and the merge, so its
number is *not* the one that will ship; the summary says so on anything that is
not main, rather than inviting a mis-tag. This needs full history, so checkout
gains fetch-depth: 0 (and moves v1 -> v4).

**Build on SDK 11.** global.json already says rollForward:latestMajor, so simply
installing the SDK 11 preview alongside 10 makes it the one that builds. Breakage
from a new major toolchain then surfaces on an ordinary PR instead of when a
release is being cut. Target frameworks are untouched - this changes what compiles
the code, not what the code runs on - and global.json stays the single lever if we
ever want to pin back to 10.

**Test net481.** tests/Directory.Build.targets sets IsTestProject=false for net4x
outside Windows, so the Ubuntu job has never run net481 - and net481 is the only
TFM that compiles the ENTITY_FRAMEWORK, LINQ2SQL and OLEDB code paths. AppVeyor
was quietly the only thing covering them, so retiring it (next commit) without
this would drop that cover silently. New windows-job runs exactly that leg.

GitHub's Windows images ship no SQL Server engine - only the OLEDB drivers -
hence the install step; AppVeyor's image had an MSSQL$SQL2019 instance built in.
MySQL and PostgreSQL are deliberately not provisioned there: FactMySqlAttribute
and FactPostgresqlAttribute probe the server in a static constructor and skip the
tests when it is unreachable, and the Ubuntu job already covers both providers
against real servers.

Also fixes `.NET Lib Pack`, which passed a cmd-style `%CD%\.nupkgs` to a job that
has run on Ubuntu for years, and so has been writing to a directory named
literally that.

* Add release.yml: verify the tag, then publish to nuget.org over OIDC

There has never been a workflow that publishes to nuget.org - AppVeyor pushed to
two MyGet feeds on every main build, and the actual nuget.org releases were pushed
by hand. That is also why the broken tag pattern went unnoticed for years.

Triggered by a published GitHub Release, with workflow_dispatch as a dry run that
does everything except the tag check and the push, so the pipeline can be proven
(and the packages inspected, via the run artifact) without cutting a release.

The guard is the point: nbgv computes the version from version.json plus commit
height, so the tag name does not set it and a mistyped tag would otherwise ship a
package that disagrees with its release. The step compares the two and fails
loudly instead. A leading "v" is stripped, matching the `v?` pattern.

Auth is Trusted Publishing (OIDC) - no long-lived key anywhere, which is the whole
reason for the move. Setup lives outside this file and is recorded in the header
comment: a GitHub environment named "release", a NUGET_USER secret, and a
trusted-publishing policy on nuget.org for each of the six published packages. A
package with no matching policy fails its push, so all six need one up front.

Runs on Ubuntu, matching main.yml: that is the configuration CI actually proves,
and it means bash expands the push glob (DapperAOT 13f9f0d had to unpick exactly
that on Windows). Packages are uploaded as a run artifact before the push, so a
failed push does not cost the build, and --skip-duplicate makes a partial push
safely re-runnable. Output goes to `nupkgs`, not `.nupkgs`: upload-artifact skips
hidden files by default and a dot-directory uploads as an empty artifact.

No tests here - the commit being released already passed CI, and this job's only
job is to reproduce that build and push it.

* Retire AppVeyor, and drop MyGet from the badges

release.yml now publishes to nuget.org on a tagged release, so AppVeyor's two
MyGet deploy providers are both redundant and a second, unversioned place for
packages to appear. The rest of AppVeyor went with them: its Windows build and
test run is now main.yml's windows-job, which is the part worth keeping.

That also retires the two encrypted MyGet API keys the file carried.

Badges and package tables follow: the AppVeyor build badge becomes the GitHub
Actions one, and the MyGet pre-release column and feed link come out of both
readmes, since that feed is no longer fed by anything.

build.ps1 / build.cmd are left in place - AppVeyor was their only caller, but they
still work as a local build-test-pack entry point.

* Stop packing Dapper.ProviderTools

`dotnet pack Build.csproj` produces it, so a release workflow would push it - but
it was last released as 2.0.90 in April 2021 and has had no work since. Shipping
it now means a dormant package jumping to 2.1.x on the next release, and a
nuget.org trusted-publishing policy that has to be kept alive for something nobody
is maintaining.

IsPackable=false instead, which drops the push set to the six packages the readme
actually lists. The project still builds and is still referenced; un-set the
property to resume shipping it.

* Bump Microsoft.SourceLink.GitHub to clear the NU1902 build break

Microsoft.Build.Tasks.Git 10.0.300, pulled in transitively by SourceLink, has
picked up GHSA-23fw-v26w-5fgq. TreatWarningsAsErrors turns the NU1902 audit
warning into an error, so Dapper and Dapper.StrongName fail to build - tests and
benchmarks only warn, since they set TreatWarningsAsErrors=false.

This is not caused by anything else in this PR: it reproduces on main, under SDK
10 and SDK 11 alike. It is bundled here only because it blocks the checks, and
with them the first real run of the new net481 job.

There is no fixed 10.x - the only versions above 10.0.300 are 11.0.100 previews -
so this takes the rc. That is tolerable for this particular dependency: SourceLink
is PrivateAssets=all, a build-time-only asset that never becomes a dependency of
the packages we publish, and it already tracks the SDK we now build with.

Verified locally: NU1902 is gone and the build exits 0, leaving the pre-existing
NU1903 warnings in tests/benchmarks (SQLitePCLRaw, System.Security.Cryptography.Xml)
which are warnings only and are a separate matter.

* Windows: reach SQL Server over shared memory, not TCP

First real run of this job: 735 of 825 net481 tests failed, every one of them
"TCP Provider, error: 0 - The remote computer refused the network connection."

The install itself was fine - ankane/setup-sqlserver puts in a default MSSQLSERVER
instance with SQL auth - but a Windows SQL Server install leaves the TCP/IP
protocol disabled, so nothing is listening on 1433 and every connection to
tcp:localhost,1433 is refused. AppVeyor never hit this because it connected to
`(local)\SQL2019`, not over TCP. Dropping the `tcp:`/port from both connection
strings uses shared memory against the local default instance, which needs no
protocol configuration.

Also pins the engine to 2019: that is what the Ubuntu job's service container
runs and what AppVeyor ran these tests against, and the action otherwise installs
SQL Server 2025. This job exists to preserve cover that already existed - moving
the engine version underneath it at the same time is a separate decision, and the
OLEDB tests in particular use the legacy SQLOLEDB provider.

Adds a reachability check before the tests, so the next time something is wrong
with the server the job says so in one line instead of several hundred identical
connection failures.

* Windows: stop pinning SQL Server 2019, it hangs the install

The pin added in the previous commit hung "Install SQL Server" for 28 minutes
before the run was cancelled; the same step with the action's default took 2m48s
on the same image a run earlier. SQL Server 2019 predates the Windows Server 2025
runner image, and its setup stalls rather than failing outright.

Reverting to the action's default. The conservatism was not worth its cost: it
was meant to keep this job as close as possible to what AppVeyor proved, but it
cannot install at all. The net481 leg therefore runs against a newer engine than
AppVeyor used - worth knowing, and called out in the comment, because the OLEDB
tests reach SQL Server through the legacy SQLOLEDB provider and that combination
has not been exercised before.

The shared-memory connection strings and the reachability check stay: those were
the actual fix for the 735 connection failures, and are independent of version.
2026-09-12 13:18:00 +01:00
Marc Gravell 752507c619 Point docs links at dapperlib.dev (#2222)
The docs site now has its own domain. The old dapperlib.github.io URLs still work via a redirect, but there's no reason to keep going the long way round, and PackageReleaseNotes in particular is baked into every package we publish.

Also switches PackageProjectUrl to the docs site, matching DapperAOT; RepositoryUrl still points at the source.
2026-08-18 09:41:01 +01:00
Robert Silén e0479ba16d add mention of MariaDB to Readme.md (#2116) 2024-10-08 13:23:18 +01:00
Marc Gravell 52160dc446 missed one 2024-04-30 20:28:19 +01:00
Marc Gravell b51cc77596 Update Readme.md
(actually just to bump build)
2024-04-12 12:12:02 +01:00
Marc Gravell ad16263ac4 tyop 2024-04-12 09:43:31 +01:00
Marc Gravell a11879c6dc more context 2024-04-12 09:41:32 +01:00
Marc Gravell d40f9f0ca9 image size 2024-04-12 09:17:59 +01:00
Marc Gravell 803e3510ea Dapper Plus (#2069)
add Dapper Plus as sponsor
2024-04-12 09:13:24 +01:00
Ion Dormenco 8d2cb0cf35 Update Readme.md (#2047)
Fix path to Dapper.Rainbow readme
2024-02-18 15:14:08 +00:00
Kasper B. Graversen 7d811c4665 dapper.rainbow guide (#2043) 2024-02-17 00:16:42 +00:00
Andrii Kurdiumov 4160c9f344 Update benchmarks with latest results. (#2016)
* Update benchmarks with latest results.

* Address PR feedback
2023-12-18 12:21:48 +00:00
0nly1ken0bi 0cd331b044 Fixed documentation to read better (#2008) 2023-12-03 09:40:54 +00:00
Bill Robertson 0272d82b7d chore: Update Readme.md (#2002)
Updates url to point to new release notes publication.  The .io one said it wasn't in use anymore and to use the github.com releases information.
2023-11-21 06:50:02 +00:00
Thomas Ingham bd649f0e58 Update Readme.md (#1994)
Ironic change of opportunity.
2023-11-09 14:16:55 +00:00
Marc Gravell b446241da3 cite AWS 2023-10-18 20:38:33 +01:00
William Cole Boren 22adf2488a Missing curly brace from code example (#1830)
* Update Readme.md

* Added additional braces

* Update Readme.md
2023-08-24 12:56:23 +01:00
Alla Hoffman ca00feeb5f Adding notes on the sub-packages' purpose to the readme (#1718)
I just paraphrased the summaries from the sub-packages' Nuget Readmes and added them to the grid of packages in the Readme. Is that a good spot for them, and are those summaries sufficient? PR would close #1488
2022-03-02 20:04:43 -05:00
GitHubPang 62a526b411 Fix grammar and formatting in readme (#1696)
Co-authored-by: Nick Craver <nrcraver@gmail.com>
2022-01-04 09:24:35 -05:00
Raphael Schweizer 60fc296b73 Fix NETSDK1174 (#1699)
As per https://docs.microsoft.com/en-us/dotnet/core/tools/sdk-errors/netsdk1174 `-p` is deprecated in favor of `--project`
This PR fixes the deprecation warning when running the benchmarks as currently described in the README.
2022-01-04 08:57:07 -05:00
Jon Roberts 17256754c3 Document usage of IDynamicParameters in more detail (#1707)
Considering all of the inquiries on StackOverflow about DynamicParameters, there should probably be a simple overview in the documentation.
Examples:

- https://stackoverflow.com/questions/12723922/dapper-adddynamicparams-for-in-statement-with-dynamic-parameter-name
- https://stackoverflow.com/questions/43412455/dapper-with-sql-query-dynamic-parameters
- https://stackoverflow.com/questions/38443739/passing-dynamically-created-sql-parameters-into-dapper-as-an-anonymous-type
- https://stackoverflow.com/questions/62448900/how-do-i-loop-through-dapper-dynamic-query-results-using-strings-as-parameters
- https://stackoverflow.com/questions/36735189/dapper-dynamicparameters-returning-error
2022-01-04 08:56:32 -05:00
Pure Krome 1235a38e1b Another example: Execute a command Multiple Times (#1690)
Another example for "Execute a command Multiple Times" when we have an existing collection. The existing example (which still remains) I found to be a little bit confusing when I had an existing collection. So hopefully this 2nd example will help a tiny bit.
2021-07-27 09:11:38 +01:00
Sviataslau Hankovich c62611a4f2 Fix signatures in readme (#1683) 2021-07-27 09:11:04 +01:00
Nick Craver 11931f9e6c Dapper.Contrib: removal (repo split)
Dapper.Contrib is now located at https://github.com/DapperLib/Dapper.Contrib
2021-05-08 20:36:15 -04:00
mgravell e26aa7b2d6 fix #1656 (git reorg) 2021-04-29 11:04:12 +01:00
Sam Royal 264eefa476 Update Readme.md
Fix path to Dapper.Tests.Performance
2020-12-17 14:14:14 +00:00
wswind 9c862af743 Update Readme.md
remove a right parenthesis in literal replacements demo code.
2020-10-19 10:43:13 +08:00
Paul.42 a6f99ced92 update tests link in readme 2020-10-16 15:07:42 -07:00
Nick Craver 78ed4b2077 Tests: move into folders
One of several moves to make this something we can dev on all platforms and build on Actions for v3 onwards.
2020-10-11 14:56:35 -04:00
Nick Craver d2877e0400 Update Readme.md 2020-07-31 16:41:35 -04:00
谭九鼎 cea7a012b0 Fix Syntax error 2020-07-27 13:57:20 +08:00
Nick Craver e723ceed16 master -> main changes 2020-06-20 09:40:54 -04:00
Nick Craver f486848e88 Update benchmarks (#1451)
This fixes things for `netcoreapp3.1` and fixes the outstanding #1205.
2020-05-02 11:12:58 -04:00
Nick Craver 663588f90b AppVeyor: Build tweaks & misc fixes (#1450)
Simplifying and improve build speed.

- Decreases builds from 8-13 minutes down to ~2 minutes (while running more tests)
- Moves to SQL Server 2019 on AppVeyor
- Moves the 2 longest running tests with params to `[FactLongRunning]`
- Bumps tests up to `netcoreapp3.1`
- Also fixes .Contrib tests
- Moves to `Build.csproj`
- Simplifies `build.ps1`
- Removed defunct `build.sh`
- Nukes `IsAppveyor` (moves to environmental variable overloads)
- Builds now work in Linux/macOS
2020-05-02 07:52:40 -04:00
Yves Mancera 5927c66776 Mention how to use user defined variables (#1149)
Fixes #620

Added a section to indicate Dapper works well with User Defined Variables.
2019-01-27 08:50:08 -05:00
James Kitamirike b4c6d5eff4 Fix typo (#1155) 2019-01-27 08:45:27 -05:00
Nick Craver 48f6754ad6 Updte literal example to be a bit better 2018-09-11 22:28:11 -04:00
Nick Craver d702fb82eb Update benchmarks to latest run 2018-09-11 21:54:40 -04:00
Nick Craver 0b867bbfa2 Add EF compiled query to benchmarks 2018-09-10 20:37:19 -04:00
Nick Craver 0b168789fd Benchmarks: updating libs and overall runner (#1123)
This is prepping a run we can drop into the README easily. And more info on allocations and such along with it. It's finishing off the benchmark port getting it into a good output state (something we can copy/paste). It removes Simple.Data because the package was debug and causes a lot of issues.

This doesn't output 100% like we want yet (fastest to slowest). BenchmarkDotNet joins summary results after ordering...we need to post-order that. I'm asking the maintainers how to do so.

Also note Belgrade was not parameterizing before, giving it a huge unfair advantage. This has been fixed to be apples:apples.
2018-09-10 20:22:10 -04:00
Tom Pažourek 10bfd02f15 Typo in readme (#1067) 2018-08-14 06:48:24 -04:00
pug-pelle-p 45460f3e5d Fixed indentation in Readme.md (#1098)
Fixed incorrect indentation in Readme.md
2018-08-14 06:47:16 -04:00
Nick Craver 3c7cde28b5 Fix #451 2018-05-20 08:07:59 -04:00
Nick Craver d3873cdffa Fix #397 2018-05-20 08:02:31 -04:00
Nick Craver 8f13e220f2 Add packages to README 2018-05-20 07:30:09 -04:00
Ben McCallum f29981a77b Readme.md misc tidying 2018-04-10 13:17:25 -04:00
Charles-Isaac Côté bf8fdb9c9a Fixed dead link in Readme.md
Replaced a dead link in Readme.md by a link to the WaybackMachine
2018-04-09 16:37:31 -04:00
Alexey Zimarev bff5e75086 Code formatting fix (tabs to spaces) (#896) 2018-03-06 23:13:12 -08:00
Marc Gravell 9c8e27779a words are hard 2017-11-01 09:22:36 +00:00
Marc Gravell dc725a3f33 Additional notes on literal replacements 2017-11-01 09:21:13 +00:00