0

I would like to remove some files from my package the highlighted ones: Could I configure composer.json when the it will exclude them or do I need to set up github action to do somework before publishing it to packagist? enter image description here

112Legion
  • 1,129
  • 12
  • 25
  • 2
    Does this answer your question? [How to ignore some files in release with GIT](https://stackoverflow.com/questions/50059612/how-to-ignore-some-files-in-release-with-git) – rob006 Nov 30 '22 at 23:38
  • 1
    Packagist itself does not host the packages, so there's nothing to hide on that side – Nico Haase Dec 01 '22 at 13:48
  • 2
    Maybe https://stackoverflow.com/questions/32795241/remove-unwanted-files-from-php-composer-dependencies helps? – Nico Haase Dec 01 '22 at 13:50

1 Answers1

1

Could I configure composer.json when the it will exclude them or do I need to set up github action to do somework before publishing it to packagist?

Yes, this depends on your concrete build, but you never publish files to packagist, therefore its not the place where you exclude something.

The options that are straight forwardly available:

  • git push command to create the package (revision) to publish, you handle all inclusions/exclusions by controlling what is in the commit (revision) you push. compare "Everyday Git".
  • composer archive command to create the package to publish, you can handle exclusions in composer.json then.
  • git archive command to create the package to publish, you can handle exclusions in .gitattributes then.

But better use a build manager and let it care about the details.

And you're asking about a remote service:

  • Microsoft Github as service to publish
    • Composer (not Packagist) support the archives Microsoft hosts for the source code automatically. Compare with git archive command.
    • There are more options the service offers for releases to publish. Packaging then depends on those.
    • The packaging then is perhaps done within a Microsoft Github Action on some of the servers Microsoft runs for their offering to publish. Compare with composer archive command, as it can be run to do the packaging as well (next to dependency resolution).
    • Let the same build manager handle it in the remote service, that does it already locally. Everything else is wasting your time.
hakre
  • 193,403
  • 52
  • 435
  • 836