-
Notifications
You must be signed in to change notification settings - Fork 42
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 #422 from freedomofpress/update-pypi-on-pr
update pip mirror update policy, build deb package on each PR to verify policy is adhered to
- Loading branch information
Showing
3 changed files
with
86 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
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,31 @@ | ||
#!/bin/bash | ||
## Usage: ./update_version.sh <version> | ||
|
||
set -e | ||
|
||
readonly NEW_VERSION=$1 | ||
|
||
if [ -z "$NEW_VERSION" ]; then | ||
echo "You must specify the new version!" | ||
exit 1 | ||
fi | ||
|
||
# Get the old version from securedrop_client/__init__.py | ||
old_version_regex="^__version__ = '(.*)'$" | ||
[[ "$(cat securedrop_client/__init__.py)" =~ $old_version_regex ]] | ||
OLD_VERSION=${BASH_REMATCH[1]} | ||
|
||
if [ -z "$OLD_VERSION" ]; then | ||
echo "Couldn't find the old version: does this script need to be updated?" | ||
exit 1 | ||
fi | ||
|
||
# Update the version in securedrop_client/__init__.py and setup.py | ||
if [[ "$OSTYPE" == "darwin"* ]]; then | ||
# The empty '' after sed -i is required on macOS to indicate no backup file should be saved. | ||
sed -i '' "s@$(echo "${OLD_VERSION}" | sed 's/\./\\./g')@$NEW_VERSION@g" securedrop_client/__init__.py | ||
sed -i '' "s@$(echo "${OLD_VERSION}" | sed 's/\./\\./g')@$NEW_VERSION@g" setup.py | ||
else | ||
sed -i "s@$(echo "${OLD_VERSION}" | sed 's/\./\\./g')@$NEW_VERSION@g" securedrop_client/__init__.py | ||
sed -i "s@$(echo "${OLD_VERSION}" | sed 's/\./\\./g')@$NEW_VERSION@g" setup.py | ||
fi |