@@ -10,14 +10,10 @@ inputs:
10
10
description : " Publish the distribution to the pypi.org"
11
11
required : true
12
12
13
- built_type :
14
- description : " Applies a set of rules depending on the environment. Available values: (dev|release|nightly|custom )"
13
+ build_type :
14
+ description : " Applies a set of rules depending on the environment. Available values: (dev|release|nightly)"
15
15
required : true
16
16
17
- custom_package_name :
18
- description : " Custom package name could be used along wtih the 'custom' build_type"
19
- required : false
20
-
21
17
outputs :
22
18
whlname :
23
19
description : " wheel filename"
36
32
echo "Error: At least one of 'publish_pypi' or 'publish_pypi_internal' must be set to 'true'"
37
33
exit 1
38
34
fi
39
- if [ "${{ inputs.built_type }}" == "custom" ] && [ "${{ inputs.custom_package_name }}" == "" ]; then
40
- echo "Error: If 'built_type' is set to 'custom' the 'custom_package_name' must be specified"
41
- exit 1
42
- fi
43
35
44
36
- name : Install tox
45
37
run : python3 -m pip install --user tox build
49
41
run : |
50
42
python3 -m tox -e build
51
43
52
- # suffixes dispatcher
53
- SUFFIX=""
54
- case ${{ inputs.built_type }} in
55
- "dev")
56
- SUFFIX="-dev-${{ github.event.pull_request.number }}"
57
- ;;
58
- "nightly")
59
- SUFFIX="-nightly-$(date +%Y%m%d)"
60
- ;;
61
- "staging")
62
- ;;
63
- "release")
64
- ;;
65
- "custom")
66
- if [[ -z ${{ inputs.custom_package_name }} ]]; then
67
- echo "Error: Custom build_type requires a custom_package_name input"
68
- exit 1
69
- fi
70
- SUFFIX=""
71
- ;;
72
- *)
73
- echo "Invalid build_type: ${{ inputs.built_type }}"
74
- exit 1
75
- esac
76
-
77
- echo "::set-output name=suffix::$SUFFIX"
78
-
79
- - name : Rename build artifacts
80
- run : |
81
- # Retrieve package name from previous step
82
- PACKAGE_NAME="${{ inputs.custom_package_name || 'guidellm' }}"
83
-
84
- # Extract version from distribution file name (e.g., guidellm-1.2.3-dev.whl)
85
- VERSION=$(find dist -name "*.whl" | cut -d '-' -f 2)
86
-
87
- # Generate final file name based on build_type and package name
88
- NEW_NAME="${PACKAGE_NAME}${SUFFIX}-${VERSION}.whl"
89
- TAR_NAME="${PACKAGE_NAME}${SUFFIX}-${VERSION}.tar.gz"
90
-
91
- mv dist/* dist/$NEW_NAME
92
- cp dist/$NEW_NAME dist/$TAR_NAME
93
-
94
- # Set outputs for subsequent steps
95
- echo "::set-output name=whlname::$NEW_NAME"
96
- echo "::set-output name=tarname::$TAR_NAME"
97
-
98
44
- name : Authenticate to GCP
99
45
uses :
google-github-actions/[email protected]
100
46
with :
0 commit comments