What is the best practice in these scenarios?
Is it to use a version manager like asdf to set the local Elixir version to match 1.12 like what’s in mix.exs?
Or is it to change the 1.12 in mix.exs to match the 1.14 global Elixir version?
When creating a library, you should put the minimum Elixir version that your library is tested with for compatibility. There are techniques for conditionally compiling additional library features based on the presence of certain features, so you may have a library that requires ~> 1.12 but has some features that require a later version of Elixir (or OTP) — those features may just be unusable on 1.12.
If are working on a team, however, you will want to use something like the asdf version manager and a .tool_versions file checked into the repository specifying the same Elixir and OTP versions that your app will use in production.