Skip to content

Commit d6cb7eb

Browse files
authored
CI: Fix Nightly PyPi GitHub Action (apache#1683)
This was broken because we now import the version: apache#1380 (comment) The build has been broken for a while: https://github.com/apache/iceberg-rust/actions/workflows/release_python_nightly.yml Tested locally: ``` ➜ iceberg-rust git:(fd-fix-version) ✗ export TIMESTAMP=123 CURRENT_VERSION=$(python3 -c "import toml; print(toml.load('bindings/python/Cargo.toml')['package']['version'])") export NEW_VERSION="${CURRENT_VERSION}.dev${TIMESTAMP}" ➜ iceberg-rust git:(fd-fix-version) ✗ echo $NEW_VERSION 0.7.0.dev123 ➜ iceberg-rust git:(fd-fix-version) ✗ python3 -c " import toml import os config = toml.load('bindings/python/Cargo.toml') new_version = os.environ['NEW_VERSION'] config['package']['version'] = new_version with open('bindings/python/Cargo.toml', 'w') as f: toml.dump(config, f) print(f'Updated version to: {new_version}') " Updated version to: 0.7.0.dev123 ``` ## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes apache#123` indicates that this PR will close issue apache#123. --> - Closes #. ## What changes are included in this PR? <!-- Provide a summary of the modifications in this PR. List the main changes such as new features, bug fixes, refactoring, or any other updates. --> ## Are these changes tested? <!-- Specify what test covers (unit test, integration test, etc.). If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? -->
1 parent bad8e4e commit d6cb7eb

File tree

1 file changed

+8
-7
lines changed
  • .github/actions/overwrite-package-version

1 file changed

+8
-7
lines changed

.github/actions/overwrite-package-version/action.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,15 @@ runs:
3838
env:
3939
TIMESTAMP: ${{ inputs.timestamp }}
4040
run: |
41-
CURRENT_VERSION=$(python -c "import toml; print(toml.load('bindings/python/pyproject.toml')['project']['version'])")
42-
NEW_VERSION="${CURRENT_VERSION}.dev${TIMESTAMP}"
43-
NEW_VERSION=$NEW_VERSION python -c "
41+
CURRENT_VERSION=$(python -c "import toml; print(toml.load('bindings/python/Cargo.toml')['package']['version'])")
42+
export NEW_VERSION="${CURRENT_VERSION}.dev${TIMESTAMP}"
43+
python -c "
4444
import toml
4545
import os
46-
config = toml.load('bindings/python/pyproject.toml')
47-
config['project']['version'] = os.environ['NEW_VERSION']
48-
with open('bindings/python/pyproject.toml', 'w') as f:
46+
config = toml.load('bindings/python/Cargo.toml')
47+
new_version = os.environ['NEW_VERSION']
48+
config['package']['version'] = new_version
49+
with open('bindings/python/Cargo.toml', 'w') as f:
4950
toml.dump(config, f)
50-
print(f'Updated version to: {config[\"project\"][\"version\"]}')
51+
print(f'Updated version to: {new_version}')
5152
"

0 commit comments

Comments
 (0)