crate-ci / cargo-release

Cargo subcommand `release`: everything about releasing a rust crate.
Apache License 2.0
1.31k stars 109 forks source link

post-release-replacements and hooks #768

Open tisonkun opened 5 months ago

tisonkun commented 5 months ago

My scenario:

So that my main branch will use "latest" automatically instead of requiring manually edition.

I'd firstly seek for a consensus and would try to implement it if desired. I suppose it's similar to the pre-release ones.

epage commented 5 months ago

Could you give an example of where you use latest that you need this kind of behavior?

tisonkun commented 5 months ago

https://github.com/korandoru/hawkeye/blob/v5.1.0/release.py

@epage Currently I wrap the logic in a simple script. The logic is almost file content replacement.

Another issue is that the replacement/hook search path is always from package root which is not quite suitable for workspace case. But this is not a blocked for me since the action is idempotent and I can use "../xxx"

tisonkun commented 5 months ago

The original motivation vanished because I change image: ...[{{version}}|latest] to image: Dockerfile.

But this issue may be still relevant.

UPDATE - No. Pull is much faster and build in place.

epage commented 5 months ago

So in your case, you have a github action that references a docker image on dockerhub. Within the tagged release, you want to reference the tagged docker image. Outside of the tagged release, you want to reference an edge image.

Did I get that right?

tisonkun commented 5 months ago

Yes.