我在向packagist添加新的软件包版本时遇到问题。
https://github.com/skydriver/stripe-request https://packagist.org/packages/skydriver/stripe-request
我的项目在Git Hub上(带有webhooks),Dev版本和第一个发布版本已成功添加到packagist,但是当我尝试创建新版本时,它没有显示在packagist上......这是我的git日志:
damjan@damjan-dev:~/www/projects/stripe/new-release$ git clone https://github.com/skydriver/stripe-request.git
Cloning into 'stripe-request'...
remote: Counting objects: 38, done.
remote: Compressing objects: 100% (29/29), done.
remote: Total 38 (delta 15), reused 21 (delta 5), pack-reused 0
Unpacking objects: 100% (38/38), done.
Checking connectivity... done.
...
damjan@damjan-dev:~/www/projects/stripe$ cd new-release/stripe-request/
damjan@damjan-dev:~/www/projects/stripe/new-release/stripe-request$ git add .
damjan@damjan-dev:~/www/projects/stripe/new-release/stripe-request$ git commit -m "New release"
[master fc9a023] New release
1 file changed, 349 insertions(+)
create mode 100644 StripeRequest.php
damjan@damjan-dev:~/www/projects/stripe/new-release/stripe-request$ git push origin master
Username for 'https://github.com': SkyDriver
Password for 'https://SkyDriver@github.com':
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 2.42 KiB | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
To https://github.com/skydriver/stripe-request.git
4ea2a02..fc9a023 master -> master
damjan@damjan-dev:~/www/projects/stripe/new-release/stripe-request$ git tag -a 1.0.2
damjan@damjan-dev:~/www/projects/stripe/new-release/stripe-request$ git push --tags
Username for 'https://github.com': SkyDriver
Password for 'https://SkyDriver@github.com':
Counting objects: 1, done.
Writing objects: 100% (1/1), 175 bytes | 0 bytes/s, done.
Total 1 (delta 0), reused 0 (delta 0)
To https://github.com/skydriver/stripe-request.git
* [new tag] 1.0.2 -> 1.0.2
damjan@damjan-dev:~/www/projects/stripe/new-release/stripe-request$
有人可以帮助我吗?
感谢。
答案 0 :(得分:5)
一切正常! (的几乎强>)
您的最新提交(撰写此答案时)为fc9a023dcd03cf37f8a15b978d92eb40aa8b0de8
。当我在Packagist上查看dev-master
版本时,我看到了相同的提交哈希。一切都很好。
除了一件事之外!
您已在version
中指定了composer.json
字段。去掉它!这就是你被1.0.0
困住的原因。
Packagist上的1.0.0
等版本与Github上的标签相对应。只需标记提交并将其推送(git push --tags
)。很快这个版本就在Packagist中出名了。
dev-master
的提交哈希对应于Github上的最新事实证明了钩子正在工作。
PPS:运行composer.phar validate
并修复它抱怨的所有内容。
PPPS:您还没有将composer.lock
文件添加到git。这可以(在这种情况下)被视为一件好事!由于它是一个库,当您启用CI时,CI将使用最新版本的依赖项,这可以警告您将来的不兼容性。但是,只要项目不意味着作为其他内容的依赖项,总是添加te锁文件。