taiki-e / upload-rust-binary-action

GitHub Action for building and uploading Rust binary to GitHub Releases.
Apache License 2.0
247 stars 22 forks source link

Question: customize the `bin` folder? #72

Closed linrongbin16 closed 7 months ago

linrongbin16 commented 7 months ago

For example the generated executables binary file is cargo-ci-template.

In the final upload assets, the binary is put in the root folder (e.g. cargo-ci-template-x86_64-unknown-linux-gnu/cargo-ci-template), is there a way to put it in bin/cargo-ci-template?


Update: when there's some config files we want to package into the tar.gz/zip tarball, we usually put the executable binary file into bin folder.

For example we may want to follow the standards of linux structure when installing a package:

./cargo-ci-template-x86_64-unknown-linux-gnu
├── LICENSE.txt
├── README.md
├── bin
│   └── cargo-ci-template
└── share
    ├── icons
    ├── locale
    ├── man
    │   └── man1
    │       └── cargo-ci-template.1
    └── runtime

So if we could customize the folder to put the executable file, it will be a big help.

linrongbin16 commented 7 months ago

BTW, would you please accept the solution/PR that: we add 1 more options to allow user config the leading dir for the bin?

taiki-e commented 7 months ago

Yeah, leading-dir input option currently only supports false (default, no leading dir) and true (leading dir same as archive name), but it seems reasonable to support custom leading dir by specifying a string. (I have no strong opinion on whether it should be an extension of an existing option or a new option.)

linrongbin16 commented 7 months ago

Yeah, leading-dir input option currently only supports false (default, no leading dir) and true (leading dir same as archive name), but it seems reasonable to support custom leading dir by specifying a string. (I have no strong opinion on whether it should be an extension of an existing option or a new option.)

I think maybe my previous comment confused you.

The leading-dir has nothing to do what what I'm asking for.

For example, with leading-dir=false, the final package may looks like this:

example-x86_64-unknown-linux-gnu

.
├── LICENSE.txt
├── README.md
└── example

With leading-dir=true, it looks like this:

example-x86_64-unknown-linux-gnu

.
├── example-x86_64-unknown-linux-gnu
    ├─ LICENSE.txt
    ├── README.md
    └── example

But in my proposal, I want to customize the folder for the example executable file, for example put it into a bin folder, it looks like this (with leading-dir=false):

example-x86_64-unknown-linux-gnu

.
├── LICENSE.txt
├── README.md
└── bin
    └── example

For example put it into hello/world folder, it looks like (with leading-dir=false):

example-x86_64-unknown-linux-gnu

.
├── LICENSE.txt
├── README.md
└── hello
    └── world
        └── example