我想发布我的项目的一个版本,其中包含子目录中选定的文件。
举个例子,这是我的 GitHub 存储库
SolarSystem
.
├── mercury
│ ├── object1.txt
│ └── object2.txt
├── venus
│ ├── partical1.txt
│ └── particle2.txt
├── earth
│ ├── computer.txt
│ ├── tree.txt
│ └── human.txt
├── mars
│ └── water.txt
├── .gitattributes
└── .git
并且,
gitattributes
文件用于忽略要发布的文件。
/.gitattributes export-ignore
/mercury export-ignore
/venus export-ignore
/mercury export-ignore
/mars export-ignore
/earth/computer.txt export-ignore
有了这个,当我发布版本时 -
SolarSystem.zip
.
├── earth
│ ├── tree.txt
│ └── human.txt
但是我想选择几个没有子目录的文件,
SolarSystem.zip
.
├── tree.txt
└── human.txt
我怎样才能达到这个结果?是否可以使用
gitattributes
配置或我必须使用 GitHub Actions 来实现此目的?这可能吗?或者我缺少更好/更简单的解决方案吗?
我尝试了
export-subst
和delta
选项,但没有达到结果。