Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve release action #284

Merged
merged 5 commits into from
Oct 29, 2021
Merged

Improve release action #284

merged 5 commits into from
Oct 29, 2021

Conversation

EdJoPaTo
Copy link
Contributor

  • include completions in release binary
  • create binary for raspberry pi zero / 1
  • create binary for M1 / arm64 macOS
  • always build and only release on tags. All commits and PRs are also tested this way to ensure builds are working for the various platforms.
  • Artifacts are always created which is helpful for testing branches and not yet released versions.

Minor Improvements:

  • Dont define targets twice in matrix. This is less error prone
  • generate version via git describe. This also includes versions in between releases (in artifacts).
  • use-cross is done via function and not hardcoded
  • GitHub Releases are done at the end of each job which simplifies the logic.
  • dont use --color=always as actions-rs/cargo provides better GitHub integrations without the colors enabled.

This is heavily inspired by the workflows I use in my projects: My template, Example.
cargo fmt, cargo clippy and cargo test are also included in my workflows but they seem to be included in the ci.yml one which is a bit obscure to me currently.

- include completions in release binary
- create binary for raspberry pi zero / 1
- create binary for M1 / arm64 macOS
- always build and only release on tags.
  All commits and PRs are also tested this way to ensure builds are
  working for the various platforms.
- Artifacts are always created which is helpful for testing branches and
  not yet released versions.

Improvements:
- Dont define targets twice in matrix. This is less error prone
- generate version via `git describe`.
  This also includes versions in between releases (in artifacts).
- use-cross is done via function and not hardcoded
- GitHub Releases are done at the end of each job which
  simplifies the logic.
- dont use --color=always as actions-rs/cargo provides better
  GitHub integrations without the colors enabled.
.github/workflows/ci.yml Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
@ajeetdsouza
Copy link
Owner

dont use --color=always as actions-rs/cargo provides better GitHub integrations without the colors enabled.

What exactly breaks when using --color=always? We should create an issue on their tracker regarding this.

cargo fmt, cargo clippy and cargo test are also included in my workflows but they seem to be included in the ci.yml one which is a bit obscure to me currently.

I'd be happy to clarify any doubts you have.

CI on macOS and Linux is done using a package manager called Nix, which specializes in reproducible builds. I specify all the CI logic in an xtask. Due to this, I'm able to run CI locally using the exact same environment as GitHub Actions, and if it succeeds locally, it succeeds on the server as well.

@EdJoPaTo
Copy link
Contributor Author

dont use --color=always as actions-rs/cargo provides better GitHub integrations without the colors enabled.

What exactly breaks when using --color=always? We should create an issue on their tracker regarding this.

Without the colors the Hints where exactly some errors happen aren't there. Warnings might not be caught and get lost from the GitHub Interface. But you have a good point there: Analyze it more in depth and create an issue about it.

cargo fmt, cargo clippy and cargo test are also included in my workflows but they seem to be included in the ci.yml one which is a bit obscure to me currently.

I'd be happy to clarify any doubts you have.

CI on macOS and Linux is done using a package manager called Nix, which specializes in reproducible builds. I specify all the CI logic in an xtask. Due to this, I'm able to run CI locally using the exact same environment as GitHub Actions, and if it succeeds locally, it succeeds on the server as well.

My main hope would be that lock files and cargo test / clippy should work the same on different locations (locally / GHA). But I definitely support the "what runs locally has to run the same on CI and the other way around" way of doing it!

@ajeetdsouza ajeetdsouza force-pushed the main branch 9 times, most recently from b45f0cc to 279e393 Compare October 28, 2021 20:52
@ajeetdsouza
Copy link
Owner

@EdJoPaTo I made a few changes, in case you'd like to review them.

Copy link
Contributor Author

@EdJoPaTo EdJoPaTo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for allowing me to review your changes! I adopted some of them for myself: EdJoPaTo/rust-binary-metafile-template@e5abad2

.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Show resolved Hide resolved
.github/workflows/release.yml Show resolved Hide resolved
.github/workflows/release.yml Show resolved Hide resolved
@ajeetdsouza ajeetdsouza merged commit 679b337 into ajeetdsouza:main Oct 29, 2021
@ajeetdsouza
Copy link
Owner

Thanks for this PR @EdJoPaTo, this is really great!

ajeetdsouza pushed a commit that referenced this pull request Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants