Improve auto discover (#433)

* Add new field `gh_crate_meta::Context::archive_suffix`
* Support `archive_suffix = ""` for unix
* Use `archive-suffix` in `FULL_FILENAMES` & `NOVERSION_FILENAMES` to support `PkgFmt::Bin`
* Simplify `PkgFmt::extensions`
* Fix `default_bin_dir_template` in `infer_bin_dir_template`: Fix typo `archive_suffix`
* Test `default_bin_dir_template` in CI
* Fix installation of `PkgFmt::Bin`: `chmod +x $bin` on unix if fmt == Bin
* Add miniserve to `.github/scripts/tests.sh`
* Update `SUPPORT.md`
* Add github-test-Cargo2.toml to test Github pkg-url with bin-dir provided
* Avoid allocation on processing `path_normalized` in `BinFile::from_product`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-09-28 12:52:14 +10:00 committed by GitHub
parent c15903684f
commit 4ba1e221ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 94 additions and 51 deletions

View file

@ -14,15 +14,15 @@ pub enum RepositoryHost {
/// Make sure to update possible_dirs in `bins::infer_bin_dir_template`
/// if you modified FULL_FILENAMES or NOVERSION_FILENAMES.
pub const FULL_FILENAMES: &[&str] = &[
"{ name }-{ target }-v{ version }.{ archive-format }",
"{ name }-{ target }-{ version }.{ archive-format }",
"{ name }-{ version }-{ target }.{ archive-format }",
"{ name }-v{ version }-{ target }.{ archive-format }",
"{ name }-{ target }-v{ version }{ archive-suffix }",
"{ name }-{ target }-{ version }{ archive-suffix }",
"{ name }-{ version }-{ target }{ archive-suffix }",
"{ name }-v{ version }-{ target }{ archive-suffix }",
];
pub const NOVERSION_FILENAMES: &[&str] = &[
"{ name }-{ target }.{ archive-format }",
"{ name }.{ archive-format }",
"{ name }-{ target }{ archive-suffix }",
"{ name }{ archive-suffix }",
];
impl RepositoryHost {