|
7 | 7 | workflow_dispatch: # Allows manual trigger of the workflow |
8 | 8 | inputs: |
9 | 9 | custom_version: # Optional input for a custom version |
10 | | - description: 'Custom version to publish (e.g., v1.2.3) -- only edit if you know what you are doing' |
| 10 | + description: 'Custom version to publish (e.g., v1.2.3 or v1.2.3.dev4) -- only edit if you know what you are doing' |
11 | 11 | required: false |
12 | 12 | type: string |
| 13 | + checkout_ref: |
| 14 | + description: 'Git ref to checkout before building wheels. Defaults to the release version.' |
| 15 | + required: false |
| 16 | + type: string |
| 17 | + build_docker_images: |
| 18 | + description: 'Build Docker images as part of release verification.' |
| 19 | + required: true |
| 20 | + default: true |
| 21 | + type: boolean |
13 | 22 | token: |
14 | 23 | description: 'Personal Access Token' |
15 | 24 | required: true |
|
18 | 27 | workflow_call: |
19 | 28 | inputs: |
20 | 29 | custom_version: # Optional input for a custom version |
21 | | - description: 'Custom version to publish (e.g., v1.2.3) -- only edit if you know what you are doing' |
| 30 | + description: 'Custom version to publish (e.g., v1.2.3 or v1.2.3.dev4) -- only edit if you know what you are doing' |
| 31 | + required: false |
| 32 | + type: string |
| 33 | + checkout_ref: |
| 34 | + description: 'Git ref to checkout before building wheels. Defaults to the release version.' |
22 | 35 | required: false |
23 | 36 | type: string |
| 37 | + build_docker_images: |
| 38 | + description: 'Build Docker images as part of release verification.' |
| 39 | + required: false |
| 40 | + default: true |
| 41 | + type: boolean |
24 | 42 | token: |
25 | 43 | description: 'Personal Access Token' |
26 | 44 | required: true |
@@ -48,17 +66,20 @@ jobs: |
48 | 66 | - id: get-version |
49 | 67 | uses: ./.github/actions/get-semantic-release-version |
50 | 68 | with: |
51 | | - custom_version: ${{ github.event.inputs.custom_version }} |
52 | | - token: ${{ github.event.inputs.token }} |
| 69 | + custom_version: ${{ inputs.custom_version }} |
| 70 | + token: ${{ inputs.token }} |
53 | 71 | - name: Checkout version and install dependencies |
54 | 72 | env: |
55 | 73 | VERSION: ${{ steps.get-version.outputs.release_version }} |
| 74 | + CHECKOUT_REF: ${{ inputs.checkout_ref }} |
56 | 75 | PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} |
57 | 76 | run: | |
58 | 77 | git fetch --tags |
59 | | - git checkout ${VERSION} |
| 78 | + git checkout "${CHECKOUT_REF:-$VERSION}" |
60 | 79 | python -m pip install build |
61 | 80 | - name: Build feast |
| 81 | + env: |
| 82 | + SETUPTOOLS_SCM_PRETEND_VERSION: ${{ steps.get-version.outputs.version_without_prefix }} |
62 | 83 | run: python -m build |
63 | 84 | - uses: actions/upload-artifact@v4 |
64 | 85 | with: |
|
68 | 89 | # We add this step so the docker images can be built as part of the pre-release verification steps. |
69 | 90 | build-docker-images: |
70 | 91 | name: Build Docker images |
| 92 | + if: ${{ inputs.build_docker_images }} |
71 | 93 | runs-on: ubuntu-latest |
72 | 94 | needs: [ build-python-wheel ] |
73 | 95 | strategy: |
|
96 | 118 | - id: get-version |
97 | 119 | uses: ./.github/actions/get-semantic-release-version |
98 | 120 | with: |
99 | | - custom_version: ${{ github.event.inputs.custom_version }} |
100 | | - token: ${{ github.event.inputs.token }} |
| 121 | + custom_version: ${{ inputs.custom_version }} |
| 122 | + token: ${{ inputs.token }} |
101 | 123 | - name: Build image |
102 | 124 | env: |
103 | 125 | VERSION_WITHOUT_PREFIX: ${{ steps.get-version.outputs.version_without_prefix }} |
@@ -162,21 +184,22 @@ jobs: |
162 | 184 | - id: get-version |
163 | 185 | uses: ./.github/actions/get-semantic-release-version |
164 | 186 | with: |
165 | | - custom_version: ${{ github.event.inputs.custom_version }} |
166 | | - token: ${{ github.event.inputs.token }} |
| 187 | + custom_version: ${{ inputs.custom_version }} |
| 188 | + token: ${{ inputs.token }} |
167 | 189 | - name: Validate Feast Version |
168 | 190 | env: |
169 | 191 | VERSION_WITHOUT_PREFIX: ${{ steps.get-version.outputs.version_without_prefix }} |
170 | 192 | run: | |
171 | 193 | feast version |
172 | | - if ! VERSION_OUTPUT=$(feast version); then |
173 | | - echo "Error: Failed to get Feast version." |
174 | | - exit 1 |
175 | | - fi |
176 | | - VERSION_REGEX='[0-9]+\.[0-9]+\.[0-9]+' |
177 | | - OUTPUT_REGEX='^Feast SDK Version: "$VERSION_REGEX"$' |
178 | | - VERSION=$(echo $VERSION_OUTPUT | grep -oE "$VERSION_REGEX") |
179 | | - OUTPUT=$(echo $VERSION_OUTPUT | grep -E "$REGEX") |
| 194 | + if ! VERSION_OUTPUT=$(feast version); then |
| 195 | + echo "Error: Failed to get Feast version." |
| 196 | + exit 1 |
| 197 | + fi |
| 198 | + VERSION_OUTPUT=$(printf '%s\n' "$VERSION_OUTPUT" | python -c 'import re, sys; print(re.sub(r"\x1b\[[0-9;]*[A-Za-z]", "", sys.stdin.read()).strip())') |
| 199 | + VERSION_REGEX='[0-9]+\.[0-9]+\.[0-9]+(\.dev[0-9]+)?' |
| 200 | + OUTPUT_REGEX="^Feast SDK Version: \"${VERSION_REGEX}\"$" |
| 201 | + VERSION=$(echo "$VERSION_OUTPUT" | grep -oE "$VERSION_REGEX") |
| 202 | + OUTPUT=$(echo "$VERSION_OUTPUT" | grep -E "$OUTPUT_REGEX") |
180 | 203 | echo "Installed Feast Version: $VERSION and using Feast Version: $VERSION_WITHOUT_PREFIX" |
181 | 204 | if [ -n "$OUTPUT" ] && [ "$VERSION" = "$VERSION_WITHOUT_PREFIX" ]; then |
182 | 205 | echo "Correct Feast Version Installed" |
|
0 commit comments