lbonn / rofi

Rofi: A window switcher, run dialog and dmenu replacement - fork with wayland support
Other
943 stars 37 forks source link

ci: generate tarballs #26

Closed ram02z closed 2 years ago

ram02z commented 3 years ago

So far the tarballs generated build properly (I have tested it locally).

Current issues:

Personally, I think the release process shouldn't be automated since rofi project doesn't have many releases.

Most recent run: https://github.com/ram02z/rofi/actions/runs/1245970354 (1.29mb for both tar.gz and tar.xz)

eli-schwartz commented 2 years ago
  • Also, since I am not using meson to generate the tarballs (don't think there is an equivalent to EXTRA_DIST ),

Hmm, as far as I can tell you are only trying to avoid including some files from the git repo. By default, meson includes all files from the repo. However, you can customize that by using meson.add_dist_script() to run a script on the staging directory which meson dist creates, before it is turned into a tarball. This script can be used to delete files (or, heck, add them).

In meson-git master, it will use git archive in the dist process, so by default any files which are marked in .gitattributes as "export-ignore" will not be included in the dist archive -- or in github's autogenerated tarballs either.

ram02z commented 2 years ago

Hmm, as far as I can tell you are only trying to avoid including some files from the git repo. By default, meson includes all files from the repo. However, you can customize that by using meson.add_dist_script() to run a script on the staging directory which meson dist creates, before it is turned into a tarball. This script can be used to delete files (or, heck, add them).

Thanks, I have opted to use meson.add_dist_script()

ram02z commented 2 years ago

Now that meson 0.59.2 is out, we could use the approach described above (shown below) from @eli-schwartz.

In meson-git master, it will use git archive in the dist process, so by default any files which are marked in .gitattributes as "export-ignore" will not be included in the dist archive -- or in github's autogenerated tarballs either.

This means that the minimum version could be dropped back to 0.47.0, since we don't expect users to run meson dist and pip should have the latest meson version.

lbonn commented 2 years ago

@ram02z nice! So yes, you want to update your PR to add a .gitattributes file and run meson dist --include-subprojects? This will indeed look nicer than the current script.

Also, the requirements for meson 0.47.0 is quite arbitrary, and changing it to something more reasonable should be fine.

eli-schwartz commented 2 years ago

Now that meson 0.59.2 is out, we could use the approach described above (shown below) from @eli-schwartz.

Sorry. :( The .2 release is a bugfix release with manually backported fixes for stability and thus doesn't have the meson dist changes. Those will be available in meson 0.60

However, you can pip install git+https://github.com/mesonbuild/meson/ in CI to take advantage of that improvement, and also as a side effect, in the unfortunate chance that meson has a bug which affects you, you will quickly notice it so you can complain to us and make sure it gets fixed before release. :D

Relying on meson from git master for running meson dist should also be fine since as you say, end users aren't expected to run that command.

lbonn commented 2 years ago

@eli-schwartz Ah I see, thanks for the clarification!

For CI, until the feature is released in a version, I would use a pinned git commit, as pip also supports it.

e.g:

pip install git+https://github.com/mesonbuild/meson@e58b3adc7044980bbddca1ad9674ac7b0c5bac0a
lbonn commented 2 years ago

I have merged the PR and made additional changes on top. Tarballs will only be built on releases and CI will test build combinations with optional wayland and xcb backends.

Thanks a lot for helping out!