I want to publish a Dart package to pub.dev from a yaml-based Azure Pipeline. I looked at the following documentation about automated publishing of Dart packages, but it doesn't mention Azure Pipelines. https://dart.dev/tools/pub/automated-publishing
Also, I'm guessing my Azure DevOps project would need a service connection for pub.dev (just like we currently have a service connection for NuGet.org for our NuGet packages), but I'm not seeing anything related to pub.dev in the list of available service connections.
How can I setup an automated dart package deployment pipeline from Azure DevOps to pub.dev?
As of now,
dartSDK is not installed on Microsoft-hosted agents and there is no pipeline task out-of-the-box for us to authenticate access to Google Cloud and publish package pub.dev.Based on your requirement and the document on Publishing from anywhere using Exported Service Account Keys, I have tested the workflow below, which works for me.
sa-devopsin my case) in Google Cloud; then create and download the key json file; (Keep the keys SAFE as they are long-lived secrets; they might be easier to use in some environments, but also pose a larger risk if accidentally leaked)Admintab of your package and type-in the service account email;GCloudKey.jsonin my sample) into theSecure Filelibrary of Azure Pipelines;dartonubuntu-latestMicrosoft-hosted agent -> Download the secure key file -> Authenticate access to Google Cloud against the key file -> Publish new version of the test package to pub.dev;