{"id":13808010,"url":"https://github.com/mavimo/drone-chromewebstore","last_synced_at":"2025-09-09T11:17:05.944Z","repository":{"id":57586866,"uuid":"119202465","full_name":"mavimo/drone-chromewebstore","owner":"mavimo","description":null,"archived":false,"fork":false,"pushed_at":"2018-01-28T13:47:17.000Z","size":9923,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T07:54:59.888Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/mavimo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-27T21:04:51.000Z","updated_at":"2020-03-24T03:50:08.000Z","dependencies_parsed_at":"2022-09-13T12:42:34.614Z","dependency_job_id":null,"html_url":"https://github.com/mavimo/drone-chromewebstore","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mavimo%2Fdrone-chromewebstore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mavimo%2Fdrone-chromewebstore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mavimo%2Fdrone-chromewebstore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mavimo%2Fdrone-chromewebstore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mavimo","download_url":"https://codeload.github.com/mavimo/drone-chromewebstore/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245868327,"owners_count":20685609,"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":[],"created_at":"2024-08-04T01:01:33.675Z","updated_at":"2025-03-27T15:20:34.224Z","avatar_url":"https://github.com/mavimo.png","language":"Go","funding_links":[],"categories":["Plugins"],"sub_categories":["Tutorials"],"readme":"# drone-chromewebstore\n\n[![GoDoc](https://godoc.org/github.com/mavimo/drone-chromewebstore?status.svg)](https://godoc.org/github.com/mavimo/drone-chromewebstore)\n[![Build Status](https://ci.mavimo.tech/api/badges/mavimo/drone-chromewebstore/status.svg)](https://ci.mavimo.tech/mavimo/drone-chromewebstore)\n[![codecov](https://codecov.io/gh/mavimo/drone-chromewebstore/branch/master/graph/badge.svg)](https://codecov.io/gh/mavimo/drone-chromewebstore)\n[![Go Report Card](https://goreportcard.com/badge/github.com/mavimo/drone-chromewebstore)](https://goreportcard.com/report/github.com/mavimo/drone-chromewebstore)\n[![Docker Pulls](https://img.shields.io/docker/pulls/mavimo/drone-chromewebstore.svg)](https://hub.docker.com/r/mavimo/drone-chromewebstore/)\n[![](https://images.microbadger.com/badges/image/mavimo/drone-chromewebstore.svg)](https://microbadger.com/images/mavimo/drone-chromewebstore \"Get your own image badge on microbadger.com\")\n[![Release](https://github-release-version.herokuapp.com/github/mavimo/drone-chromewebstore/release.svg?style=flat)](https://github.com/mavimo/drone-chromewebstore/releases/latest)\n[![Build status](https://ci.appveyor.com/api/projects/status/cuioqombam9yufdy/branch/master?svg=true)](https://ci.appveyor.com/project/mavimo/drone-chromewebstore/branch/master)\n\n\nDeploying application on Chrome Webstore with drone CI to an existing function\n\n## Build or Download a binary\n\nThe pre-compiled binaries can be downloaded from [release page](https://github.com/mavimo/drone-chromewebstore/releases). Support the following OS type.\n\n* Windows amd64/386\n* Linux amd64/386\n* Darwin amd64/386\n\nWith `Go` installed\n\n```\n$ go get -u -v github.com/mavimo/drone-chromewebstore\n``` \n\nor build the binary with the following command:\n\n```\n$ make build\n```\n\n## Docker\n\nBuild the docker image with the following commands:\n\n```\n$ make docker\n```\n\nPlease note incorrectly building the image for the correct x64 linux and with\nCGO disabled will result in an error when running the Docker image:\n\n```\ndocker: Error response from daemon: Container command\n'/drone-chromewebstore' not found or does not exist..\n```\n\n## How to get required parameters\n\nIn order to use Chrome Webstore API you should create an account that is autorized, the process is a bit tricky, let see step by step what we need to do.\n\n1. Create a new application on Chorme Webstore\n    - Go to (webstore developer dashboard](https://chrome.google.com/webstore/developer/dashboard) (need you're registered as developer in order to publish application to all users)\n    - Create a new application (button *Add new item*) and fill form with required information, the first time shoul should upload the first version of your application.\n    - Save an copy the application ID (you can see it on URL, eg: on URL `https://chrome.google.com/webstore/developer/edit/hcolchlidglfiofiefppcdnkpbgphkgb?authuser=0` the `hcolchlidglfiofiefppcdnkpbgphkgb` part is the Application ID\n2. Create a new authorization, you should follow steps reported in [Using the Chrome Web Store Publish API\n](https://developer.chrome.com/webstore/using_webstore_api) guide, o summarize:\n    - Visit [https://console.developers.google.com/](https://console.developers.google.com/)\n    - Create a new project\n    - Enable *Chrome Webstore API* for this project\n    - Create auhentication credentials\n    - Save your *Client ID* and *Client Secret*\n    - Generate your *Refresh Token* and save it\n\n## Usage\n\n### Options available\n\n - flag `--env-file`: `.env` file to load (useful for debugging)\n - env variable `$PLUGIN_APPLICATION` or flag `--application`: the application ID \n - env variable `$PLUGIN_CLIENT_ID` or flag `--client-id`: Client ID\n - env variable `$PLUGIN_CLIENT_SECRET` or flag `--client-secret`: Client secret\n - env variable `$PLUGIN_REFRESH_TOKEN` or flag `--refresh-token`: Refresh token\n - env variable `$PLUGIN_SOURCE` or flag `--source`: Application source folder \n - env variable `$PLUGIN_UPLOAD` or flag `--upload`: indicate if we should upload application to webstore (`true` by default)\n - env variable `$PLUGIN_PUBLISH` or flag `--publish`: indicate if we should publish application in webstore (`true` by default)\n - env variable `$PLUGIN_PUBLISH_TARGET` or flag `--publish-target`: Publish target, should be `default` or `trustedTesters` (`default` by default)\n\n### Configure drone\n\nConfigure your drone instance to automatically upload / deploy your application. The configuration need some env variables that tipically are set in secrets section.\n\nYour configuration should looks like:\n\n```yaml\npipeline:\n  # Previous steps\n\n  upload-extension:\n    image: mavimo/drone-chromewebstore\n    secrets: [plugin_application, plugin_client_id, plugin_client_secret, plugin_refresh_token]\n    source: ./src\n    upload: true\n    publish: false\n    when:\n      event: [push]\n      branch: [master]\n\n  deploy-extension:\n    image: mavimo/drone-chromewebstore\n    secrets: [plugin_application, plugin_client_id, plugin_client_secret, plugin_refresh_token]\n    upload: false\n    publish: true\n    publish_target: trustedTesters\n    when:\n      event: deployment\n      environment: staging\n\n  deploy-extension:\n    image: mavimo/drone-chromewebstore\n    secrets: [plugin_application, plugin_client_id, plugin_client_secret, plugin_refresh_token]\n    upload: false\n    publish: true\n    publish_target: default\n    when:\n      event: deployment\n      environment: production\n\n  # Next steps\n```\n\nWhere the `upload-extension` step publish the application using the information configured on drone secrets:\n\n - `plugin_application`: contains the application ID\n - `plugin_client_id`: contains the client ID\n - `plugin_client_secret`: contains the client secret\n - `plugin_refresh_token`: contains the refresh token generated before\n\nThe `source` parameter indicate the root folder of your application (should contains the `manifest.json` file)\n\nThe `upload` parameter indicate that we are going to zip and upload a new application version. NB: `manifest.json` should contains a version number bigger than already published version.\n\nThe `publish` parameter indicate that we are going to publish uploaded application. By default it publish to `default` group, but you should publish also to `trustedTesters`, for example when deploy on staging env.\n\n## Tips\n\nSince is not possible publish the same version on webstore we should increase it each time, we should use the drone build ID. \nEdit `manifest.json` file\n\n```json\n{\n    // ...\n    \"version\": \"1.0.3.BUILD_NUMBER\",\n    // ...\n}\n```\nand add to `.drone.yml` as step before upload (tune manifest path and `when` conditions):\n```yaml\npipeline:\n  prepare:\n    image: alpine\n    commands:\n      - sed -i \"s/BUILD_NUMBER/$DRONE_BUILD_NUMBER/g\" src/manifest.json\n    when:\n      event: push\n```\n\n## Special Thanks\n - [Bo-Yi Wu](https://github.com/appleboy) for create the drone plugin scaffolding I used for this project (see: [`drone-lambda`](https://github.com/appleboy/drone-lambda))\n - [Brad Rydzewski](https://github.com/bradrydzewski) for create (and open source) the [`drone`](https://github.com/drone/drone) project\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmavimo%2Fdrone-chromewebstore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmavimo%2Fdrone-chromewebstore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmavimo%2Fdrone-chromewebstore/lists"}