使用Packagist要求GitHub存储库的构件(而不是提交)。

huangapple go评论65阅读模式
英文:

Make packagist require github artifact (instead of commit)

问题

I'm using packagist.org to publish some custom php packages in order to be installable (or rather required) via composer, but I have this some packages that require some build steps (for compiling CSS/JS).

The build process is done via github actions, on every tag release, and it spits a zip file. Like it is here: https://github.com/iamntz/carbon-fields-urlpicker/releases/latest

The goal here would be to have users to run composer require iamntz/carbon-fields-urlpicker and use the carbon-fields-urlpicker.zip within the release, not the git tag of that release.

Note that I'm aware of using composer by requiring the full URL of a zip. That's not what I'm looking, as it makes the installation process more cumbersome than it should.

I know that CSS/JS shouldn't sit into a php package, but it is what it is. If this changes anything, let's say we need to replace something on the PHP code before release.

英文:

I'm using packagist.org to publish some custom php packages in order to be installable (or rather required) via composer, but I have this some packages that require some build steps (for compiling CSS/JS).

The build process is done via github actions, on every tag release, and it spits a zip file. Like it is here: https://github.com/iamntz/carbon-fields-urlpicker/releases/latest

The goal here would be to have users to run composer require iamntz/carbon-fields-urlpicker and use the carbon-fields-urlpicker.zip within the release, not the git tag of that release.

Note that I'm aware of using composer by requiring the full URL of a zip. That's not what I'm looking, as it makes the installation process more cumbersome than it should.

I know that CSS/JS shouldn't sit into a php package, but it is what it is. If this changes anything, let's say we need to replace something on the PHP code before release.

答案1

得分: 0

你可以在你的composer文件中实际指定dist键,packagist将直接选择它!
你可以在这里看到它是如何工作的:

https://github.com/iamntz/carbon-fields-urlpicker/blob/0d5014d078dc797af33829c9ad1aee2ae4074fd4/composer.json#L9

英文:

It seems that you can actually specify the ... dist key into your composer file and packagist will just pick up that instead!

You can see it here how it works:

https://github.com/iamntz/carbon-fields-urlpicker/blob/0d5014d078dc797af33829c9ad1aee2ae4074fd4/composer.json#L9

huangapple
  • 本文由 发表于 2023年3月9日 21:50:51
  • 转载请务必保留本文链接:https://go.coder-hub.com/75685520.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定