-
Notifications
You must be signed in to change notification settings - Fork 10
Generate tarball along with wheel build, and upload both in a package to GH #138
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,12 @@ outputs: | |
whl: | ||
description: 'basename for generated whl' | ||
value: ${{ steps.whl.outputs.whl }} | ||
tarball: | ||
description: 'basename for generated tarball' | ||
value: ${{ steps.whl.outputs.tarball }} | ||
artifact: | ||
description: 'artifact name' | ||
value: ${{ steps.whl.outputs.artifact }} | ||
runs: | ||
using: composite | ||
steps: | ||
|
@@ -24,11 +30,19 @@ runs: | |
source $(pyenv root)/versions/${{ inputs.python }}/envs/${VENV}/bin/activate | ||
SUCCESS=0 | ||
pip3 wheel --no-deps -w dist . || SUCCESS=$? | ||
echo "status=${SUCCESS}" >> "$GITHUB_OUTPUT" | ||
ls -alh dist/ | ||
BASE=$(./.github/scripts/convert-version ${{ inputs.python }}) | ||
WHL_FILEPATH=$(find dist -iname "*nm_vllm*${BASE}*.whl") | ||
WHL=$(basename ${WHL_FILEPATH}) | ||
echo "whl=${WHL}" >> "$GITHUB_OUTPUT" | ||
# generate .tar.gz | ||
$SUCCESS || python3 setup.py sdist || SUCCESS=$? | ||
ls -alh dist/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if this is intentional. Using the same There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The sdist argument is to generate source distribution, i.e. the tar.gz file. It'll be generated under the same folder as the wheel which is generated in an earlier step, i.e. dist/. This is the default output folder for generated packages. We want to keep them under dist/ since we'll upload them both to GH in one step by just providing the dist/ path to an upload action. |
||
TARBALL_FILEPATH=$(find dist -iname "*nm-vllm*.tar.gz") | ||
TARBALL=$(basename ${TARBALL_FILEPATH}) | ||
echo "status=${SUCCESS}" >> "$GITHUB_OUTPUT" | ||
echo "tarball=${TARBALL}" >> "$GITHUB_OUTPUT" | ||
ARTIFACT=`echo "${WHL}" | sed 's/.whl//g'` | ||
echo "artifact=${ARTIFACT}" >> "$GITHUB_OUTPUT" | ||
exit ${SUCCESS} | ||
shell: bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Dan. The
$SUCCESS ||
in$SUCCESS || python3 setup.py sdist || SUCCESS=$?
isn't doing what is intended. I seein https://github.com/neuralmagic/nm-vllm/actions/runs/8359879522/job/22884186408
I think it is safe to remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Varun, the $SUCCESS in$SUCCESS || python3 setup.py sdist || SUCCESS=$ ? is to keep the value in SUCCESS if the previous wheel generation step failed. It'll only run the tarball generation only if $SUCCESS=0, i.e. the wheel generation step is successful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated command so it'll work as intended, good catch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Dan.