meta icon indicating copy to clipboard operation
meta copied to clipboard

Support a release action

Open cyplo opened this issue 4 years ago • 12 comments

Hi ! Thanks for all the actions :)

Would be amazing to have a release action that would

  1. build and test everything
  2. bump the version
  3. tag in git
  4. publish to crates.io but also to github releases

https://github.com/sunng87/cargo-release does most of the above

What do you think ?

cyplo avatar Sep 23 '19 12:09 cyplo

Some kind of "release" Action would be nice, but there are few questions that should be considered before.

For example, would second point mean that all sub-crates in a workplace will get the version bumped? Should such Action parse sources and bump versions in there too, like in the html_root_url attribute? On what event should Action be triggered if it should tag the sources also?

So far I could imagine auto-cargo publish on a new git tags, but the whole "make me a release" process creates too many questions :)

svartalf avatar Sep 23 '19 14:09 svartalf

Hi! It would be great to have some kind of "simple" release action what can be run on:

on:
  release
    types: [published, created, edited]

That will publish to crates.io and to Github releases

stepankuzmin avatar Sep 29 '19 15:09 stepankuzmin

@stepankuzmin on: release trigger means that Github release were created already, I'm not following what should be published to the Github releases then?

As for crates.io release, it should be quite easy without any additional Action to do that, smth like this should do the job:

- steps:
  - uses: actions/checkout@v1
  - run: cargo login ${CRATES_IO_TOKEN}
    env:
      CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
  - run: cargo publish

svartalf avatar Sep 30 '19 07:09 svartalf

Hey @svartalf, thanks for the reply! The idea was then user tags a commit — CI builds assets and publishes them on Github release page.

stepankuzmin avatar Sep 30 '19 08:09 stepankuzmin

@stepankuzmin yeah, that's actually is an open question for me: would it be possible to make an Action which will cover usual needs for a release process.

For example, what do you mean by "assets"? Is your crate is a binary crate and you want to attach the pre-built binaries to the GH release page? Or maybe your crate is generating .h files for an FFI via cbindgen?

I'm not against the "Release" Action, obviously, but at this point I do not understand what should it do exactly, so I would love to hear opinions and workflow descriptions from various projects first.

svartalf avatar Sep 30 '19 09:09 svartalf

Is your crate is a binary crate and you want to attach the pre-built binaries to the GH release page?

Exactly this! Right now a difficulty is figuring out a way to build multiple targets with cross and succinctly releasing each of them in a single GitHub release, despite being separate jobs.

Azure Pipelines achieves this nicely with their GitHub Release task, which creates a release with the first artifact that is generated, and all parallel jobs eventually add their artifacts to that created release. It also auto-generates a release message containing a commit log, but automated changelogs using conventional commit messages would be extra nice!

matchai avatar Sep 30 '19 15:09 matchai

I've spent some time and come with this solution based on softprops/action-gh-release. It's a bit ugly, but it works 🤷‍♂️

https://github.com/urbica/martin/blob/master/.github/workflows/ci.yml

stepankuzmin avatar Sep 30 '19 16:09 stepankuzmin

I am working on some release automation at the moment for our Rust projects. As part of that, I wrote an action which allows you to set the version of a Cargo.toml manifest to a new one.

https://github.com/thomaseizinger/set-crate-version

YMMV but I've found small and focused GitHub actions more useful than larger ones. For example, this GitHub action doesn't make a commit for you but doing so is trivial via:

- name: Make a commit
  run: |
    git add Cargo.toml
    git commit --message "Bump versions for upcoming release"

thomaseizinger avatar Feb 20 '20 12:02 thomaseizinger

What about uploading binaries built to github for each release?

pickfire avatar May 13 '20 16:05 pickfire

I think the method of rust-analyzer is worthy of reference, using the schedule for release.

jmjoy avatar May 22 '20 02:05 jmjoy

https://github.com/awslabs/aws-lambda-rust-runtime/pull/235/files

brainstorm avatar Jul 02 '20 05:07 brainstorm

In my project there are multiple file I want to bump automatically in multiple file such as cargo.toml, cargo.lock, redme.md and so on. is there any way to do this.

samigiit avatar Aug 04 '21 06:08 samigiit