{"id":15901544,"url":"https://github.com/zeshuaro/semantic-release-pub","last_synced_at":"2026-05-03T04:02:27.812Z","repository":{"id":195739933,"uuid":"692281147","full_name":"zeshuaro/semantic-release-pub","owner":"zeshuaro","description":"semantic-release plugin to publish a Dart or Flutter package.","archived":false,"fork":false,"pushed_at":"2024-05-01T13:01:06.000Z","size":1489,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-01T16:10:19.323Z","etag":null,"topics":["dart","flutter","publish","release","semantic-release","version"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/semantic-release-pub","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zeshuaro.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["zeshuaro"],"ko_fi":"zeshuaro","liberapay":"zeshuaro","patreon":"zeshuaro","custom":["https://www.buymeacoffee.com/zeshuaro","https://paypal.me/JoshuaTang"]}},"created_at":"2023-09-16T02:18:12.000Z","updated_at":"2024-05-03T12:24:12.553Z","dependencies_parsed_at":"2024-02-20T08:29:30.354Z","dependency_job_id":"6671f6b3-cdc2-43ee-9b8f-a6d8a5d1ab3f","html_url":"https://github.com/zeshuaro/semantic-release-pub","commit_stats":null,"previous_names":["zeshuaro/semantic-release-pub"],"tags_count":57,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeshuaro%2Fsemantic-release-pub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeshuaro%2Fsemantic-release-pub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeshuaro%2Fsemantic-release-pub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeshuaro%2Fsemantic-release-pub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeshuaro","download_url":"https://codeload.github.com/zeshuaro/semantic-release-pub/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244079601,"owners_count":20394761,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","flutter","publish","release","semantic-release","version"],"created_at":"2024-10-06T11:04:58.881Z","updated_at":"2026-01-04T03:19:22.824Z","avatar_url":"https://github.com/zeshuaro.png","language":"TypeScript","funding_links":["https://github.com/sponsors/zeshuaro","https://ko-fi.com/zeshuaro","https://liberapay.com/zeshuaro","https://patreon.com/zeshuaro","https://www.buymeacoffee.com/zeshuaro","https://paypal.me/JoshuaTang","https://liberapay.com/zeshuaro/"],"categories":[],"sub_categories":[],"readme":"# semantic-release-pub\n\n[![npm](https://img.shields.io/npm/v/semantic-release-pub)](https://www.npmjs.com/package/semantic-release-pub)\n[![License](https://img.shields.io/github/license/zeshuaro/semantic-release-pub)](https://github.com/zeshuaro/semantic-release-pub/blob/main/LICENSE)\n[![GitHub Actions](https://github.com/zeshuaro/semantic-release-pub/actions/workflows/github-actions.yml/badge.svg)](https://github.com/zeshuaro/semantic-release-pub/actions/workflows/github-actions.yml)\n[![codecov](https://codecov.io/github/zeshuaro/semantic-release-pub/graph/badge.svg?token=P40ZNZNXG2)](https://codecov.io/github/zeshuaro/semantic-release-pub)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/2694cc48a8dd416798eaab232948090a)](https://app.codacy.com/gh/zeshuaro/semantic-release-pub/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade)\n[![Checked with Biome](https://img.shields.io/badge/Checked_with-Biome-60a5fa?style=flat\u0026logo=biome)](https://biomejs.dev)\n\n[![Github-sponsors](https://img.shields.io/badge/sponsor-30363D?style=for-the-badge\u0026logo=GitHub-Sponsors\u0026logoColor=#EA4AAA)](https://github.com/sponsors/zeshuaro)\n[![BuyMeACoffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-ffdd00?style=for-the-badge\u0026logo=buy-me-a-coffee\u0026logoColor=black)](https://www.buymeacoffee.com/zeshuaro)\n[![Ko-Fi](https://img.shields.io/badge/Ko--fi-F16061?style=for-the-badge\u0026logo=ko-fi\u0026logoColor=white)](https://ko-fi.com/zeshuaro)\n[![LiberaPay](https://img.shields.io/badge/Liberapay-F6C915?style=for-the-badge\u0026logo=liberapay\u0026logoColor=black)](https://liberapay.com/zeshuaro/)\n[![Patreon](https://img.shields.io/badge/Patreon-F96854?style=for-the-badge\u0026logo=patreon\u0026logoColor=white)](https://patreon.com/zeshuaro)\n[![PayPal](https://img.shields.io/badge/PayPal-00457C?style=for-the-badge\u0026logo=paypal\u0026logoColor=white)](https://paypal.me/JoshuaTang)\n\n[semantic-release](https://github.com/semantic-release/semantic-release) plugin to publish a [Dart](https://dart.dev/guides/libraries/create-packages) or [Flutter](https://docs.flutter.dev/packages-and-plugins/developing-packages) package.\n\n| Step               | Description                                                                                                                                                                         |\n| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `verifyConditions` | Verify 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. |\n| `prepare`          | Update the `pubspec.yaml` version.                                                                                                                                                  |\n| `publish`          | Publish the [Dart](https://dart.dev/tools/pub/publishing) or [Flutter](https://docs.flutter.dev/packages-and-plugins/developing-packages#publish) package to the registry.          |\n\n## Installation\n\nInstall via `npm`:\n\n```bash\nnpm install --save-dev semantic-release-pub\n```\n\nOr via `yarn`:\n\n```bash\nyarn add --dev semantic-release-pub\n```\n\n## Usage\n\nThe plugin can be configured in the [semantic-release configuration file](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration):\n\n```json\n{\n  \"plugins\": [\n    \"@semantic-release/commit-analyzer\", \n    \"@semantic-release/release-notes-generator\", \n    \"semantic-release-pub\"\n  ]\n}\n```\n\n## Configuration\n\n### `pub.dev` authentication\n\nYou can publish to `pub.dev` using either Google Service Account or GitHub Actions OIDC. \n\nNote that when using GitHub Actions OIDC, `pub.dev` only allows authentication when the workflow is triggered by a `tag` event. See [here](https://github.com/dart-lang/pub-dev/issues/8507) for more details.\n\n#### Google Service Account\n\nThe following instructions are referenced from the [documentation](https://dart.dev/tools/pub/automated-publishing#publish-using-exported-service-account-keys) of Dart. Below are the key steps to allow authentication to `pub.dev`.\n\n1. [Create a Google Cloud project](https://cloud.google.com/resource-manager/docs/creating-managing-projects), if you don’t have an existing project.\n\n2. Create a [service account](https://cloud.google.com/iam/docs/service-account-overview) either through the Google Cloud Console under `IAM and admin \u003e Service accounts` or as follow:\n   \n    ```bash\n    gcloud iam service-accounts create pub-dev \\\n        --description='Service account to be impersonated when publishing to pub.dev' \\\n        --display-name='pub-dev'\n    ```\n\n3. Grant the service account permission to publish your package.\n\n    \u003e To complete this step, you must have uploader permission on the package or be an admin of the publisher that owns the package.\n\n    1. Navigate to the package Admin tab (pub.dev/packages/\u003cpackage\u003e/admin).\n    2. Click Enable publishing with Google Cloud Service account. \n    3. Type the email of the service account into the Service account email field.\n        \u003e You created this account in the previous step: `pub-dev@$PROJECT_ID.iam.gserviceaccount.com`\n\n4. Create exported service account keys for the service account either through the Google Cloud Console under `Service account actions \u003e Manage keys \u003e Add key \u003e Create new key \u003e JSON \u003e Create` or as follow:\n\n    ```bash\n    gcloud iam service-accounts keys create key-file.json \\\n        PROJECT_ID.iam.gserviceaccount.com\n    ```\n\n5. Copy the content of the JSON key file and set it as an environment variable under `GOOGLE_SERVICE_ACCOUNT_KEY`.\n\n\n#### GitHub Actions OIDC\n\nThe following instructions are referenced from the [documentation](https://dart.dev/tools/pub/automated-publishing#configuring-automated-publishing-from-github-actions-on-pub-dev) of Dart. Below are the key steps to allow authentication to `pub.dev` via GitHub Actions OIDC.\n\n1. Enable automated publishing.\n\n    \u003e To complete this step, you must have uploader permission on the package or be an admin of the publisher that owns the package.\n\n    1. Navigate to the package Admin tab (pub.dev/packages/\u003cpackage\u003e/admin).\n    2. Click Enable publishing from GitHub Actions.\n    3. Then fill in the necessary information.\n   \n 2. In your workflow, add the `id-token` permission.\n\n    ```yaml\n    jobs:\n      publish:\n        permissions:\n          id-token: write\n    ```\n\n### Environment variables\n\n| Variable                     | Description                                                                                             |\n| ---------------------------- | ------------------------------------------------------------------------------------------------------- |\n| `GOOGLE_SERVICE_ACCOUNT_KEY` | The google service account key created from the above steps. Not required if using GitHub Actions OIDC. |\n\n### Options\n\n| Option              | Description                                                                                                                                                                                                                                             | Default |\n| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |\n| `cli`               | The `dart` or `flutter` CLI to use to publish the package to the registry.                                                                                                                                                                              | `dart`  |\n| `publishPub`        | Whether to publish the package to the registry. If set to `false`, the `pubspec.yaml` version will still be updated.                                                                                                                                    | `true`  |\n| `updateBuildNumber` | Whether 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](https://docs.flutter.dev/deployment/android#updating-the-apps-version-number). | `false` |\n| `useGithubOidc`     | Whether to use GitHub OIDC. If set to `true`, authentication to `pub.dev` will be done using GitHub OIDC. Otherwise, the `GOOGLE_SERVICE_ACCOUNT_KEY` will be used.                                                                                     | `false` |\n\n### Examples\n\n#### Publishing a Flutter package\n\n```json\n{\n  \"plugins\": [\n    \"@semantic-release/commit-analyzer\", \n    \"@semantic-release/release-notes-generator\", \n    [\n      \"semantic-release-pub\",\n      {\n        \"cli\": \"flutter\"\n      }\n    ]\n  ]\n}\n```\n\nSee [here](https://github.com/zeshuaro/firestore_cache/pull/162) for a sample pull request utilising this plugin and `semantic-release` to publish a Flutter package.\n\n#### Using GitHub Actions OIDC\n\n```json\n{\n  \"plugins\": [\n    \"@semantic-release/commit-analyzer\", \n    \"@semantic-release/release-notes-generator\", \n    [\n      \"semantic-release-pub\",\n      {\n        \"useGithubOidc\": true\n      }\n    ]\n  ]\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeshuaro%2Fsemantic-release-pub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeshuaro%2Fsemantic-release-pub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeshuaro%2Fsemantic-release-pub/lists"}