Skip to content

Commit 9bd14e1

Browse files
committed
pass variables correctly between jobs
1 parent 9854b49 commit 9bd14e1

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

.github/workflows/python-release.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,12 @@ on:
3939
jobs:
4040
validate-inputs:
4141
runs-on: ubuntu-latest
42+
outputs:
43+
VERSION: ${{ steps.validate-inputs.outputs.VERSION }}
44+
RC: ${{ steps.validate-inputs.outputs.RC }}
4245
steps:
4346
- name: Validate and Extract Version and RC
47+
id: validate-inputs
4448
run: |
4549
if [ "$GITHUB_EVENT_NAME" = "push" ]; then
4650
echo "Workflow triggered by tag push."
@@ -71,8 +75,8 @@ jobs:
7175
fi
7276
7377
# Export variables for future steps
74-
echo "VERSION=$VERSION" >> $GITHUB_ENV
75-
echo "RC=$RC" >> $GITHUB_ENV
78+
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
79+
echo "RC=$RC" >> $GITHUB_OUTPUT
7680
7781
- name: Display Extracted Version and RC
7882
run: |
@@ -98,7 +102,7 @@ jobs:
98102
99103
- name: Validate current pyiceberg version
100104
env:
101-
VERSION: ${{ env.VERSION }}
105+
VERSION: ${{ needs.validate-inputs.outputs.VERSION }}
102106
run: |
103107
# Extract the current version from Poetry
104108
current_pyiceberg_version=$(poetry version --short)
@@ -178,10 +182,10 @@ jobs:
178182
- name: Merge Artifacts
179183
uses: actions/upload-artifact/merge@v4
180184
env:
181-
VERSION: ${{ env.VERSION }}
182-
RC: ${{ env.RC }}
185+
VERSION: ${{ needs.validate-inputs.outputs.VERSION }}
186+
RC: ${{ needs.validate-inputs.outputs.RC }}
183187
with:
184-
name: "svn-release-candidate-${VERSION}-rc${RC}"
188+
name: "svn-release-candidate-${{ env.VERSION }}-rc${{ env.RC }}"
185189
pattern: svn-release-candidate*
186190
delete-merged: true
187191

@@ -214,9 +218,9 @@ jobs:
214218

215219
- name: Set version with RC
216220
env:
217-
VERSION: ${{ env.VERSION }}
218-
RC: ${{ env.RC }}
219-
run: python -m poetry version "${VERSION}-rc${RC}"
221+
VERSION: ${{ needs.validate-inputs.outputs.VERSION }}
222+
RC: ${{ needs.validate-inputs.outputs.RC }}
223+
run: python -m poetry version "${{ env.VERSION }}-rc${{ env.RC }}"
220224

221225
# Publish the source distribution with the version that's in
222226
# the repository, otherwise the tests will fail
@@ -258,9 +262,9 @@ jobs:
258262
- name: Merge Artifacts
259263
uses: actions/upload-artifact/merge@v4
260264
env:
261-
VERSION: ${{ env.VERSION }}
262-
RC: ${{ env.RC }}
265+
VERSION: ${{ needs.validate-inputs.outputs.VERSION }}
266+
RC: ${{ needs.validate-inputs.outputs.RC }}
263267
with:
264-
name: "pypi-release-candidate-${VERSION}-rc${RC}"
268+
name: "pypi-release-candidate-${{ env.VERSION }}-rc${{ env.RC }}"
265269
pattern: pypi-release-candidate*
266270
delete-merged: true

0 commit comments

Comments
 (0)