Skip to content

Support RustlerPrecompiled release#3

Merged
zachdaniel merged 2 commits intoash-project:mainfrom
shahryarjb:main
Dec 29, 2024
Merged

Support RustlerPrecompiled release#3
zachdaniel merged 2 commits intoash-project:mainfrom
shahryarjb:main

Conversation

@shahryarjb
Copy link
Collaborator

@shahryarjb shahryarjb commented Dec 25, 2024

In this pull request, I attempted to implement the example I created for testing (linked here) on igniter_js as well.

The goal is to have a precompiled release so users won't need to install Rust and perform a full build.

A few considerations must be addressed:

  1. GitHub Actions Settings:
    Navigate to:
    Settings > Actions > General > Workflow permissions
    Enable the option "Read and write permissions".

  2. Release and Tag Naming:
    Always start the release and tag name with v. For example: v0.1.1.

  3. Publishing the Package on Hex.pm:
    You need to generate the checksum once, but this should only be done after the release and build process on GitHub is complete.

To build locally, use the following command:

IGNITERJS_BUILD=1 mix rustler_precompiled.download IgniterJs.Native --only-local

After generating the file, you can compare it with the version on GitHub:

mix rustler_precompiled.download IgniterJs.Native --all --print

Once verified, you can proceed to publish the package on Hex.pm.


The first release might encounter issues. I’ve tried to be very careful to ensure nothing is missed, but please review it as well, and then run a test on the repo to make sure everything works as expected.

Please, if you’ve fully tested it and are willing, squash this pull request. I’d prefer my commits to be merged in one commit.

Thanks in advance!


Refs:

@shahryarjb shahryarjb added enhancement New feature or request dependencies Pull requests that update a dependency file labels Dec 25, 2024
@zachdaniel
Copy link
Contributor

zachdaniel commented Dec 28, 2024

  • 1 is done

  • 2 is already what we do anyway so thats good 👍

  • 3 This will require some change. Ideally we can automate this checksum generation and release process on GitHub CI, is that possible? But what we will need to do is disable the automatic mix hex.publish which happens on v* tags in the other ci file.

So for number 3 first a PR needs to be made to the core Ash repository that will add an option to skip the default hex publish that we do:

https://github.com/ash-project/ash/blob/main/.github/workflows/ash-ci.yml#L307

Then, we can pass that in here on this PR, and potentially automate mix hex.publish in a different way. If it has to be manual thats fine.

@shahryarjb
Copy link
Collaborator Author

shahryarjb commented Dec 29, 2024

Dear @zachdaniel ,
I’ve been exploring the library I mentioned earlier (link attached) and reviewed many of its configurations, but I couldn’t find anything that automatically handles this task. However, for generating the checksum, you can use the following command either in CI or on the developer's system.

Since Ash’s top-level structure is a bit complex, I believe some additional adjustments might be necessary. Here's the command:

IGNITERJS_BUILD=1 mix rustler_precompiled.download IgniterJs.Native --only-local

It should be noted, the IGNITERJS_BUILD=1 is necessary for creating new one or local Rust part changing

This can create and place the checksum locally within the CI as well. For example, I found the following release process in their repository:

# How to release a new version of Wasmex

* Make sure CI is green and `CHANGELOG.md` is up to date
* Increase the package version in `mix.exs`, `README.md`, and `Cargo.toml` - best grep for the current version and replace it
* Commit the version bump and push it
* Tag the commit with the new version number `git tag -a v0.8.0` - copy the changelog into the tag message
* Push the tag `git push --tags`
* Wait for the CI to create the GitHub release and precompiled binaries
* Edit the GitHub release with the `CHANGELOG.md` content
* Download the precompiled binaries with `mix rustler_precompiled.download Wasmex.Native --all --ignore-unavailable --print`
* Inspect the output and the checksum-Elixir.Wasmex.Native.exs file
* Continue with `mix hex.publish`

One note to mention: Over the next few days, I will be actively working on implementing this in the UI library. If possible, it would be fantastic to release a few initial versions manually in the repository.
Alternatively, if it’s better to fully integrate it into Ash for complete automation, it would require some effort on your end to handle the setup.

Once this process is in place, I can test the integration directly with the repository, which would provide more realistic feedback.

Thank you for considering this, and I appreciate your support!

Best regards,
Shahryar

@zachdaniel zachdaniel merged commit c0b53f4 into ash-project:main Dec 29, 2024
25 of 27 checks passed
@zachdaniel
Copy link
Contributor

I will be making some changes to the CI stuff in follow ups, but easier to do post merge.

Thank you for all your hard work!

🚀 Thank you for your contribution! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments