25
25
version :
26
26
description : ' Version'
27
27
type : string
28
+ required : true
28
29
rc :
29
- description : ' RC '
30
+ description : ' Release candidate (RC) '
30
31
type : string
31
-
32
+ required : true
32
33
33
34
jobs :
34
35
validate-inputs :
@@ -47,11 +48,42 @@ jobs:
47
48
if [[ ! "${{ github.event.inputs.rc }}" =~ ^rc[0-9]+$ ]]; then
48
49
echo "Error: rc must be in the format rc<number>"
49
50
exit 1
51
+ fi
50
52
51
53
- name : Release Version
52
54
run : |
53
55
echo "Running Release Version: ${{ github.event.inputs.version }}${{ github.event.inputs.rc }}"
54
56
57
+ validate-library-version :
58
+ runs-on : ubuntu-latest
59
+ steps :
60
+ - uses : actions/checkout@v4
61
+ with :
62
+ fetch-depth : 0
63
+
64
+ - uses : actions/setup-python@v5
65
+ with :
66
+ python-version : 3.12
67
+
68
+ - name : Install Poetry
69
+ run : |
70
+ pip install poetry
71
+
72
+ - name : Validate current pyiceberg version
73
+ run : |
74
+ # Extract the current version from Poetry
75
+ current_pyiceberg_version=$(poetry version --short)
76
+ echo "Detected Poetry version: $current_pyiceberg_version"
77
+
78
+ # Compare the input version with the Poetry version
79
+ input_version="${{ github.event.inputs.version }}"
80
+
81
+ # Check if the input version matches the Poetry version
82
+ if [[ "$input_version" != "$current_pyiceberg_version" ]]; then
83
+ echo "Error: Input version ($input_version) does not match the Poetry version ($current_pyiceberg_version)"
84
+ exit 1
85
+ fi
86
+
55
87
build_svn_artifacts :
56
88
name : Build artifacts for SVN on ${{ matrix.os }}
57
89
runs-on : ${{ matrix.os }}
@@ -133,7 +165,7 @@ jobs:
133
165
name : " release-svn-${{ matrix.os }}"
134
166
path : ./svn_wheelhouse/*
135
167
136
- build_pypi_artifacts : # pypi `tag` as version
168
+ build_pypi_artifacts :
137
169
name : Build artifacts for PyPi on ${{ matrix.os }}
138
170
runs-on : ${{ matrix.os }}
139
171
strategy :
@@ -156,8 +188,8 @@ jobs:
156
188
- name : Install poetry
157
189
run : pip install poetry
158
190
159
- - name : Set version
160
- run : python -m poetry version "${{ github.event.inputs.version }}${{ github.event.inputs.rc }}" # CHANGE TO current TAG
191
+ - name : Set version with RC
192
+ run : python -m poetry version "${{ github.event.inputs.version }}${{ github.event.inputs.rc }}"
161
193
162
194
# Publish the source distribution with the version that's in
163
195
# the repository, otherwise the tests will fail
0 commit comments