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

Include version number in release archive names #9002

Merged
merged 1 commit into from
Dec 5, 2023

Conversation

tobbez
Copy link
Contributor

@tobbez tobbez commented Dec 5, 2023

Summary

Add a release's version number to the names of archives containing binaries that are attached to that GitHub release.

This makes it possible for users to easily tell archives from different downloaded releases apart.

See also: #8961

Test Plan

The workflow was tested in my fork. The example release can be found at: https://github.com/tobbez/ruff/releases/tag/v0.1.7.

To allow the workflow run to succeed in the fork while testing, I had to use a small commit to prevent interaction with external services (ghcr, PyPI, and the ruff-pre-commit repository):

diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 86eac6ebc..56b9fa908 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -463,10 +463,12 @@ jobs:
       id-token: write
     steps:
       - uses: actions/download-artifact@v3
+        if: false
         with:
           name: wheels
           path: wheels
       - name: Publish to PyPi
+        if: false
         uses: pypa/gh-action-pypi-publish@release/v1
         with:
           skip-existing: true
@@ -517,6 +519,7 @@ jobs:
           tag_name: v${{ inputs.tag }}
 
   docker-publish:
+    if: false
     # This action doesn't need to wait on any other task, it's easy to re-tag if something failed and we're validating
     # the tag here also
     name: Push Docker image ghcr.io/astral-sh/ruff
@@ -575,6 +578,7 @@ jobs:
   # After the release has been published, we update downstream repositories
   # This is separate because if this fails the release is still fine, we just need to do some manual workflow triggers
   update-dependents:
+    if: false
     name: Update dependents
     runs-on: ubuntu-latest
     needs: publish-release

Those workflow jobs are however not modified by this PR, so they should not be affected.

This makes it possible to easily tell archives from different releases
apart.

Closes astral-sh#8961.
@charliermarsh
Copy link
Member

This looks reasonable to me and seems to match the scheme that @BurntSushi uses in ripgrep. I really appreciate that you went through the effort of actually testing this, and have included the example release link in the PR.

@charliermarsh charliermarsh added the release Related to the release process label Dec 5, 2023
@@ -86,7 +86,7 @@ jobs:
path: dist
- name: "Archive binary"
run: |
ARCHIVE_FILE=ruff-x86_64-apple-darwin.tar.gz
ARCHIVE_FILE=ruff-${{ inputs.tag }}-x86_64-apple-darwin.tar.gz
Copy link
Member

Choose a reason for hiding this comment

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

Above, tag says "The version to tag, without the leading 'v'. If omitted, will initiate a dry run (no uploads)." Do you know if that's still true? Can it be omitted? And, if it is omitted, what happens here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It can still be omitted, in which case ${{ inputs.tag }} expands to an empty string. That specific example would result in ruff--x86_64-apple-darwin.tar.gz in dry-run mode. You can see an example in this workflow run.

Copy link
Member

Choose a reason for hiding this comment

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

It'd be nice to omit the second dash, but that's just a debugging workflow so not critical.

@BurntSushi
Copy link
Member

One note to consider here is whether there are any docs anywhere that walk someone through downloading and extracting a release archive. Those might need to be updated to reflect the name change.

@tobbez
Copy link
Contributor Author

tobbez commented Dec 5, 2023

One note to consider here is whether there are any docs anywhere that walk someone through downloading and extracting a release archive. Those might need to be updated to reflect the name change.

The installation instructions don't mention these archives at all, and a grep for zip and tar.gz in the repository found nothing relevant.

@charliermarsh charliermarsh merged commit 3def18f into astral-sh:main Dec 5, 2023
40 checks passed
@charliermarsh
Copy link
Member

Thanks @tobbez! Great PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release Related to the release process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants