Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Commit bdfdb77

Browse files
dhuangnmdhuangdhuang
authored
Generate tarball along with wheel build, and upload both in a package to GH (#138)
1. Generate nm-vllm tar.gz file along with wheel generation 2. Upload both tar.gz and .whl in a package to GH A run will look like this: https://github.com/neuralmagic/nm-vllm/actions/runs/8359879522 --------- Co-authored-by: dhuang <dhuang@MacBook-Pro-2.local> Co-authored-by: dhuang <dhuang@ip-192-168-198-30.ec2.internal>
1 parent 25bd431 commit bdfdb77

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

.github/actions/nm-build-vllm-whl/action.yml

+15-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ outputs:
1414
whl:
1515
description: 'basename for generated whl'
1616
value: ${{ steps.whl.outputs.whl }}
17+
tarball:
18+
description: 'basename for generated tarball'
19+
value: ${{ steps.whl.outputs.tarball }}
20+
artifact:
21+
description: 'artifact name'
22+
value: ${{ steps.whl.outputs.artifact }}
1723
runs:
1824
using: composite
1925
steps:
@@ -24,11 +30,19 @@ runs:
2430
source $(pyenv root)/versions/${{ inputs.python }}/envs/${VENV}/bin/activate
2531
SUCCESS=0
2632
pip3 wheel --no-deps -w dist . || SUCCESS=$?
27-
echo "status=${SUCCESS}" >> "$GITHUB_OUTPUT"
2833
ls -alh dist/
2934
BASE=$(./.github/scripts/convert-version ${{ inputs.python }})
3035
WHL_FILEPATH=$(find dist -iname "*nm_vllm*${BASE}*.whl")
3136
WHL=$(basename ${WHL_FILEPATH})
3237
echo "whl=${WHL}" >> "$GITHUB_OUTPUT"
38+
# generate .tar.gz
39+
(exit $SUCCESS) && (python3 setup.py sdist) || SUCCESS=$?
40+
ls -alh dist/
41+
TARBALL_FILEPATH=$(find dist -iname "*nm-vllm*.tar.gz")
42+
TARBALL=$(basename ${TARBALL_FILEPATH})
43+
echo "status=${SUCCESS}" >> "$GITHUB_OUTPUT"
44+
echo "tarball=${TARBALL}" >> "$GITHUB_OUTPUT"
45+
ARTIFACT=`echo "${WHL}" | sed 's/.whl//g'`
46+
echo "artifact=${ARTIFACT}" >> "$GITHUB_OUTPUT"
3347
exit ${SUCCESS}
3448
shell: bash

.github/actions/nm-whl-summary/action.yml

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ inputs:
1616
whl:
1717
description: 'whl file tested'
1818
required: true
19+
tarball:
20+
description: 'tar.gz file tested'
21+
required: true
1922
runs:
2023
using: composite
2124
steps:
@@ -34,4 +37,5 @@ runs:
3437
echo "| branch name: | '${{ github.ref_name }}' |" >> $GITHUB_STEP_SUMMARY
3538
echo "| python: | ${{ inputs.python }} |" >> $GITHUB_STEP_SUMMARY
3639
echo "| whl: | ${{ inputs.whl }} |" >> $GITHUB_STEP_SUMMARY
40+
echo "| tarball: | ${{ inputs.tarball }} |" >> $GITHUB_STEP_SUMMARY
3741
shell: bash

.github/workflows/build-whl.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,12 @@ jobs:
121121
python: ${{ inputs.python }}
122122
venv: ${{ env.VENV_BUILD_BASE }}
123123

124-
- name: upload whl
124+
- name: upload dist
125125
uses: actions/upload-artifact@v4
126126
if: success() || failure()
127127
with:
128-
name: ${{ steps.build_whl.outputs.whl }}
129-
path: dist/${{ steps.build_whl.outputs.whl }}
128+
name: ${{ steps.build_whl.outputs.artifact }}
129+
path: dist/
130130
retention-days: 15
131131

132132
- name: summary
@@ -137,6 +137,7 @@ jobs:
137137
testmo_run_url: https://neuralmagic.testmo.net/automation/runs/view/${{ steps.create_testmo_run.outputs.id }}
138138
python: ${{ inputs.python }}
139139
whl: ${{ steps.build_whl.outputs.whl }}
140+
tarball: ${{ steps.build_whl.outputs.tarball }}
140141

141142
- name: complete testmo run
142143
uses: ./.github/actions/nm-testmo-run-complete/

0 commit comments

Comments
 (0)