-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from delvtech/matt-pylint-fixes
- Loading branch information
Showing
4 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
TWINE_USERNAME=pypi_username | ||
TWINE_PASSWORD=pypi_password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
# Source the .env file to export the TWINE_USERNAME and TWINE_PASSWORD | ||
if [ -f ".env" ]; then | ||
export $(cat .env | xargs) | ||
else | ||
echo ".env file not found" | ||
exit 1 | ||
fi | ||
|
||
# Navigate to the dist directory | ||
cd dist || exit 1 | ||
|
||
# Find the latest version of the package, assuming the naming convention is 'pypechain-VERSION' | ||
# This will extract the version numbers, sort them, and get the highest version | ||
latest_version=$(ls pypechain-*.tar.gz | sort -V | tail -n 1 | sed -E 's/pypechain-(.*)\.tar\.gz/\1/') | ||
|
||
# Check if latest_version is not empty | ||
if [[ -z "$latest_version" ]]; then | ||
echo "No distribution files found for upload." | ||
exit 1 | ||
fi | ||
|
||
# Use twine to upload all packages for the latest version | ||
# The * after the version number is important to match all files for the version | ||
twine upload "pypechain-${latest_version}"* | ||
|
||
# Navigate back to the original directory | ||
cd - |