Skip to content

Release script #5372

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

Merged
merged 2 commits into from
Feb 19, 2020
Merged

Release script #5372

merged 2 commits into from
Feb 19, 2020

Conversation

pks-t
Copy link
Member

@pks-t pks-t commented Jan 30, 2020

The current release process is not documented in any way. As a result,
it's not obvious how releases should be done at all, like e.g. which
locations need adjusting.

To fix this, let's introduce a new script that shall from now on be used
to do all releases. As input it gets the tree that shall be released,
the repository in which to do the release, credentials to
authenticate against GitHub and the new version. E.g. executing the
following will create a new release v0.32:

$ ./script/release.py 0.32.0 --user pks-t --password ****

While the password may currently be your usual GitLab password, it's
recommended to use a personal access token intead.

The script will then perform the following steps:

1. Verify that "include/git2/version.h" matches the new version.

2. Verify that "docs/changelog.md" has a section for that new
   version.

3. Extract the changelog entries for the current release from
   "docs/changelog.md".

4. Generate two archives in "tar.gz" and "zip" format via "git
   archive" from the tree passed by the user. If no tree was passed,
   we will use "HEAD".

5. Create the GitHub release using the extracted changelog entries
   as well as tag and name information derived from the version
   passed by the used.

6. Upload both code archives to that release.

This should cover all steps required for a new release and thus ensures
that nothing is missing that shouldn't be.


Note that it seems to be impossible to turn off GitHub's auto-generated archives, so I find it questionable whether it makes sense to upload our own code archives. We can control them better though, which would allow us to fix e.g. #5343. On the other hand, users might be confused when there's seemingly multiple downloads for the same thing.

We could probably counteract that by giving proper names. Right now they're the same as the default generated ones. See https://github.com/pks-t/test/releases for some examples of releases done via that script.

Anyway, even if we end up not generating our own tarballs I feel like having this script is a good step.

@ethomson
Copy link
Member

ethomson commented Feb 1, 2020

This looks good to me overall. I wonder if we might want to change the name of the release that we upload, away from "Source code" to disambiguate it from the GitHub-generated ones...

Maybe "Release source: libgit2-x.y.z.tar.gz"? Or "Official release source code: ..." or something like that?

'VER_MINOR': [ str(version.minor), None ],
'VER_REVISION': [ str(version.revision), None ],
'VER_PATCH': [ '0', None ],
'SOVERSION': [ str(version.minor), None ],
Copy link
Member

Choose a reason for hiding this comment

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

What should our strategy for soversion here be in a post-1.0 world? We have a couple of choices - we could just keep it monotonically increasing and it doesn't have to have anything to do with the actual version numbers. But I don't actually love that.

We could track it against the major/minor version numbers, which is consistent with what we've been doing - eg 0.29 -> 29, 1.0 -> 100, 1.1 -> 101. This is the strategy that I'd advocate for.

@pks-t
Copy link
Member Author

pks-t commented Feb 1, 2020

Maybe "Release source: libgit2-x.y.z.tar.gz"? Or "Official release source code: ..." or something like that?

Everything's better than what I currently have, and I think "Release source: libgit2-x.y.z.tar.gz" is good. Wouldn't it need to be "Release sources", though (plural)?

We could track it against the major/minor version numbers, which is consistent with what we've been doing - eg 0.29 -> 29, 1.0 -> 100, 1.1 -> 101. This is the strategy that I'd advocate for.

I see other projects use something like "libgiblib.so.1.0.6", "libgio-2.0.so.0.6000.7", "libgirara-gtk3.so.3.1" etc. So we could change our pattern to "libgit2.so.$MAJOR.$MINOR" with a SOVERSION of "$MAJOR.$MINOR"?

@pks-t
Copy link
Member Author

pks-t commented Feb 1, 2020

I see other projects use something like "libgiblib.so.1.0.6", "libgio-2.0.so.0.6000.7", "libgirara-gtk3.so.3.1" etc. So we could change our pattern to "libgit2.so.$MAJOR.$MINOR" with a SOVERSION of "$MAJOR.$MINOR"?

Or go all the way to "libgit2.so.$MAJOR.$MINOR.$REVISION", where systems provide the typical symlinks from "libgit2.so.$MAJOR" -> "ligit2.so.$MAJOR.$MINOR" -> "libgit2.so.$MAJOR.$MINOR.$REVISION" so applications can choose how specific to be.

@ethomson
Copy link
Member

ethomson commented Feb 2, 2020

Yeah, that's a good idea. I updated the soversion to major.minor in 2827c8a

@pks-t pks-t force-pushed the pks/release-script branch 4 times, most recently from 03a97d7 to 2ae45bc Compare February 7, 2020 14:05
pks-t added 2 commits February 7, 2020 15:06
Python's PEP 8 specifies that one shall use spaces instead of tabs as
coding style, and we actually honor that currently. Our EditorConfig
does not special-case Python scripts, though, which is why we end up
with our C coding style and thus with tabs.

Special-case "*.py" files to override that default with spaces to fix
this.
The current release process is not documented in any way. As a result,
it's not obvious how releases should be done at all, like e.g. which
locations need adjusting.

To fix this, let's introduce a new script that shall from now on be used
to do all releases. As input it gets the tree that shall be released,
the repository in which to do the release, credentials to
authenticate against GitHub and the new version. E.g. executing the
following will create a new release v0.32:

    $ ./script/release.py 0.32.0 --user pks-t --password ****

While the password may currently be your usual GitLab password, it's
recommended to use a personal access token intead.

The script will then perform the following steps:

    1. Verify that "include/git2/version.h" matches the new version.

    2. Verify that "docs/changelog.md" has a section for that new
       version.

    3. Extract the changelog entries for the current release from
       "docs/changelog.md".

    4. Generate two archives in "tar.gz" and "zip" format via "git
       archive" from the tree passed by the user. If no tree was passed,
       we will use "HEAD".

    5. Create the GitHub release using the extracted changelog entries
       as well as tag and name information derived from the version
       passed by the used.

    6. Upload both code archives to that release.

This should cover all steps required for a new release and thus ensures
that nothing is missing that shouldn't be.
@ethomson ethomson mentioned this pull request Feb 18, 2020
3 tasks
@pks-t pks-t merged commit b31cd05 into libgit2:master Feb 19, 2020
@pks-t pks-t deleted the pks/release-script branch February 19, 2020 10:25
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