From 3def18fc2100e61f07a7f6c707765c445c20443e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20L=C3=B6nnemark?= Date: Tue, 5 Dec 2023 20:42:04 +0100 Subject: [PATCH] Include version number in release archive names (#9002) ## 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](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 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. --- .github/workflows/release.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2ec8ef052f..86eac6ebcd 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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 tar czvf $ARCHIVE_FILE -C target/x86_64-apple-darwin/release ruff shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256 - name: "Upload binary" @@ -125,7 +125,7 @@ jobs: path: dist - name: "Archive binary" run: | - ARCHIVE_FILE=ruff-aarch64-apple-darwin.tar.gz + ARCHIVE_FILE=ruff-${{ inputs.tag }}-aarch64-apple-darwin.tar.gz tar czvf $ARCHIVE_FILE -C target/aarch64-apple-darwin/release ruff shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256 - name: "Upload binary" @@ -177,7 +177,7 @@ jobs: - name: "Archive binary" shell: bash run: | - ARCHIVE_FILE=ruff-${{ matrix.platform.target }}.zip + ARCHIVE_FILE=ruff-${{ inputs.tag }}-${{ matrix.platform.target }}.zip 7z a $ARCHIVE_FILE ./target/${{ matrix.platform.target }}/release/ruff.exe sha256sum $ARCHIVE_FILE > $ARCHIVE_FILE.sha256 - name: "Upload binary" @@ -224,7 +224,7 @@ jobs: path: dist - name: "Archive binary" run: | - ARCHIVE_FILE=ruff-${{ matrix.target }}.tar.gz + ARCHIVE_FILE=ruff-${{ inputs.tag }}-${{ matrix.target }}.tar.gz tar czvf $ARCHIVE_FILE -C target/${{ matrix.target }}/release ruff shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256 - name: "Upload binary" @@ -291,7 +291,7 @@ jobs: path: dist - name: "Archive binary" run: | - ARCHIVE_FILE=ruff-${{ matrix.platform.target }}.tar.gz + ARCHIVE_FILE=ruff-${{ inputs.tag }}-${{ matrix.platform.target }}.tar.gz tar czvf $ARCHIVE_FILE -C target/${{ matrix.platform.target }}/release ruff shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256 - name: "Upload binary" @@ -343,7 +343,7 @@ jobs: path: dist - name: "Archive binary" run: | - ARCHIVE_FILE=ruff-${{ matrix.target }}.tar.gz + ARCHIVE_FILE=ruff-${{ inputs.tag }}-${{ matrix.target }}.tar.gz tar czvf $ARCHIVE_FILE -C target/${{ matrix.target }}/release ruff shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256 - name: "Upload binary" @@ -399,7 +399,7 @@ jobs: path: dist - name: "Archive binary" run: | - ARCHIVE_FILE=ruff-${{ matrix.platform.target }}.tar.gz + ARCHIVE_FILE=ruff-${{ inputs.tag }}-${{ matrix.platform.target }}.tar.gz tar czvf $ARCHIVE_FILE -C target/${{ matrix.platform.target }}/release ruff shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256 - name: "Upload binary"