Using task configuration avoidance with MavenPublication#artifact

I’m trying to use task configuration avoidance APIs as much as possible. I’m trying to create a maven publication from an archive task someArchiveTask:

publishing {
    publications {
        create<MavenPublication>("publicationName") {
            artifact(tasks.named("someArchiveTask"))
        }
    }
}

But I only get an error:

* What went wrong:
Cannot convert the provided notation to an object of type MavenArtifact: task ':someArchiveTask'.
The following types/formats are supported:
  - Instances of MavenArtifact.
  - Instances of AbstractArchiveTask, for example jar.
  - Instances of PublishArtifact
  - Maps containing a 'source' entry, for example [source: '/path/to/file', extension: 'zip'].
  - Anything that can be converted to a file, as per Project.file()

The following seems to work:

publishing {
    publications {
        create<MavenPublication>("publicationName") {
            artifact(tasks["someArchiveTask"])
        }
    }
}

but this configures someArchiveTask immediately, thus defeating the purpose of task configuration avoidance. Is there a reason I can’t pass a TaskProvider to artifact?

Ah, I found an open ticket about that: https://github.com/gradle/gradle/issues/7958