Socket
Socket
Sign inDemoInstall

ea-semantic-release-pub

Package Overview
Dependencies
5
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ea-semantic-release-pub

semantic-release plugin to publish a Dart or Flutter package


Version published
Weekly downloads
6
decreased by-14.29%
Maintainers
1
Install size
3.85 MB
Created
Weekly downloads
 

Changelog

Source

1.1.0 (2024-05-15)

Features

  • add MSIX version replacement (e4e8513)

Readme

Source

semantic-release-pub

npm License GitHub Actions codecov Codacy Badge Code Style

Github-sponsors BuyMeACoffee Ko-Fi LiberaPay Patreon PayPal

semantic-release plugin to publish a Dart or Flutter package.

StepDescription
verifyConditionsVerify the presence of the GOOGLE_SERVICE_ACCOUNT_KEY environment variable, the ability to exchange an identity from the service account, and the dart or flutter executable.
prepareUpdate the pubspec.yaml version.
publishPublish the Dart or Flutter package to the registry.

Installation

Install via npm:

npm install --save-dev semantic-release-pub

Or via yarn:

yarn add --dev semantic-release-pub

Usage

The plugin can be configured in the semantic-release configuration file:

{
  "plugins": [
    "@semantic-release/commit-analyzer", 
    "@semantic-release/release-notes-generator", 
    "semantic-release-pub"
  ]
}

Configuration

pub.dev authentication

The following instructions are referenced from the documentation of Dart. Below are the key steps to allow authentication to pub.dev.

  1. Create a Google Cloud project, if you don’t have an existing project.

  2. Create a service account either through the Google Cloud Console under IAM and admin > Service accounts or as follow:

    gcloud iam service-accounts create pub-dev \
        --description='Service account to be impersonated when publishing to pub.dev' \
        --display-name='pub-dev'
    
  3. Grant the service account permission to publish your package.

    To complete this step, you must have uploader permission on the package or be an admin of the publisher that owns the package.

    1. Navigate to the Admin tab (pub.dev/packages//admin).
    2. Click Enable publishing with Google Cloud Service account.
    3. Type the email of the service account into the Service account email field.

      You created this account in the previous step: pub-dev@$PROJECT_ID.iam.gserviceaccount.com

  4. Create exported service account keys for the service account either through the Google Cloud Console under Service account actions > Manage keys > Add key > Create new key > JSON > Create or as follow:

    gcloud iam service-accounts keys create key-file.json \
        PROJECT_ID.iam.gserviceaccount.com
    
  5. Copy the content of the JSON key file and set it as an environment variable under GOOGLE_SERVICE_ACCOUNT_KEY.

Environment variables

VariableDescription
GOOGLE_SERVICE_ACCOUNT_KEYThe google service account key created from the above steps.

Options

OptionDescriptionDefault
cliThe dart or flutter CLI to use to publish the package to the registry.dart
publishPubWhether to publish the package to the registry. If set to false, the pubspec.yaml version will still be updated.true
updateBuildNumberWhether to write build number for every newly bumped version in pubspec.yaml. Note that the build number will always be increased by one. Learn more on Flutter docs.false

Examples

Publishing a Flutter package
{
  "plugins": [
    "@semantic-release/commit-analyzer", 
    "@semantic-release/release-notes-generator", 
    [
      "semantic-release-pub",
      {
        "cli": "flutter"
      }
    ]
  ]
}

See here for a sample pull request utilising this plugin and semantic-release to publish a Flutter package.

Keywords

FAQs

Last updated on 15 May 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc