1. Create Extension in yii2.
As for this step, you can refer to Create Extension
In short, you can use gii to create extension after read above article. Just be care to change the output as
change the namespace as
2. Install github in you computer.
I use window. So you can google/baidu to search msysgit. It is a window version github. You should be able right click folder and find "Git Bash", "Git Gui", "Git Init Here" and so on menu after you success install msysgit.
3. Link your widget to github
You can link your github account now.
$ git config --global user.name "Your Name" $ git config --global user.email "email@example.com"
And then add files.
git add <file1> git add <file2> git status git commit -m "your comment"
$ ssh-keygen -t rsa -C "firstname.lastname@example.org"
You will find .ssh dir in you home dir, and find id_rsa和id_rsa.pub You can tell id-rsa.pub to everyone.
Login github with your browser ==> "Account Setting" ==> "SSH keys" ==> "Add SSH key", and paste your id-rsa.pub content in key, as for title, you can type any.
$ git remote add origin email@example.com:youraccount/yourrepository.git $ git push -u origin master it will need input your github account and pass since use -u In future, you only need below $ git push origin master
4. Register your github repository into packagist
Don't forget register your github repository into packagist, end user can install your widget only after you complete register. And packagist will give you hint for how to setup service in github to auto synchronize every commit from github to packagist.
Above is my experiences in past 2 days which I success fully create yii2-google-chart extension.