仓库地址:https://github.com/153622362/ngyhd
Packagist地址:https://packagist.org/packages/ngyhd/ngyhd#dev-master
1. github创建仓库
git init
2. clone仓库到本地
git clone https://github.com/153622362/ngyhd
3. 创建src文件夹并在目录下添加代码
4. 添加json文件
{
"name": "ngyhd/ngyhd",
"type": "yii2-extension",
"description": "The Async mailer for the Yii framework",
"keywords": ["yii2", "redis", "async", "mailer"],
"license": "MIT",
"support": {
"issues": "https://github.com/BestJason/imooc_yii2_mailerqueue/issues",
"forum": "http://www.mr-jason.com",
"source": "https://github.com/BestJason/imooc_yii2_mailerqueue"
},
"authors": [
{
"name": "ngyhd",
"email": "[email protected]"
}
],
"require": {
"yiisoft/yii2": "*",
"yiisoft/yii2-redis": "~2.0.0"
},
"autoload": {
"psr-4": {
"ngyhd\\ngyhd\\": "src/"
}
}
}
5. 提交到仓库
7. 把github仓库地址submit check 到 Packagist
8. 设置自动更新packgist
https://packagist.org/about#how-to-update-packages
在本地执行命令
curl -XPOST -H’content-type:application/json’ ‘https://packagist.org/api/update-package?username=ngyhd&apiToken=API_TOKEN’ -d’{“repository”:{“url”:”PACKAGIST_PACKAGE_URL“}}’
API_TOKEN = https://packagist.org/profile/
PACKAGIST_PACKAGE_URL = GITHUB地址 https://github.com/153622362/ngyhd.git
- 打包成版本
git tag –a v0.1.0 –m ‘init code’
git push origin –tags