OSGeo / grass

GRASS GIS - free and open-source geospatial processing engine
https://grass.osgeo.org
Other
855 stars 310 forks source link

CI: create versioned directory name of extracted tarball #4659

Closed nilason closed 2 weeks ago

nilason commented 2 weeks ago

Extracting the tarball will with this create a containing directory named 'grass-x.y.z', where x, y, z stands for major, minor, micro/patch version.

Previously, the tarball created by CI was extracted to a directory named 'grass', which was a regression to accustomed and expected behaviour.

nilason commented 2 weeks ago

Now, I'm not sure whether this need to be backported at all. Isn't it the file in main that is triggered by addition of a tag?

neteler commented 2 weeks ago

Extracting the tarball

Just for clarification: where (in the CI?) is the tarball created? Because the release tarballs contain the version in the directory name.

nilason commented 2 weeks ago

Extracting the tarball

Just for clarification: where (in the CI?) is the tarball created? Because the release tarballs contain the version in the directory name.

The tarball is created in CI and added to the Assets section of a release (e.g. https://github.com/OSGeo/grass/releases/tag/8.4.0). That tarball is/was named correctly, e.g. grass-8.4.0.tar.gz, but the same tarball extracted a containing directory named only grass (because of the git repo name is "grass"). With this change the container directory will be named grass-8.4.0.

This/these tarballs may (or rather should, as include/VERSION_GIT file is generated into it) be uploaded to the osgeo download server manually (in the future possibly automatically).

See discussion in GRASS-dev ML.

neteler commented 2 weeks ago

See discussion in GRASS-dev ML.

Oh, I had completely forgotten about this one... and it would affect the upcoming GRASS GIS 8.4.1.

nilason commented 2 weeks ago

See discussion in GRASS-dev ML.

Oh, I had completely forgotten about this one... and it would affect the upcoming GRASS GIS 8.4.1.

I didn't :-), and yes, that's why I hurried up with this now.

nilason commented 2 weeks ago

I cannot really judge the code but full trust.

To test this locally, try:

# Assuming grass repo directory name is 'grass'
cd to_grass_repo
cd ..

GRASS_V=grass-8.4.2

# before
tar -cvf ${GRASS_V}.tar --exclude=".gi*" --exclude=".tr*" --show-transformed-names grass

# with this change
tar -cvf ${GRASS_V}.tar --exclude=".gi*" --exclude=".tr*" --transform s/grass/${GRASS_V}/ --show-transformed-names grass

With the --show-transformed-names option the tar command only prints out the outcome instead of creating the tar archive too. (I added it here for testing purposes only).