|
2 | 2 |
|
3 | 3 | set -eu -o pipefail |
4 | 4 |
|
| 5 | +# Check that we're not on the main branch |
| 6 | +current_branch=$(git branch --show-current) |
| 7 | +if [ "$current_branch" = "main" ]; then |
| 8 | + echo "Error: Releases should not be done directly on the main branch." |
| 9 | + echo "Please create a release branch and run this script from there." |
| 10 | + exit 1 |
| 11 | +fi |
| 12 | + |
| 13 | +# Fetch latest changes and check that we're not behind origin/main |
| 14 | +echo "Fetching from origin..." |
| 15 | +git fetch origin |
| 16 | + |
| 17 | +if ! git merge-base --is-ancestor origin/main HEAD; then |
| 18 | + echo "Error: Current branch is behind origin/main." |
| 19 | + echo "Please merge or rebase with origin/main before releasing." |
| 20 | + exit 1 |
| 21 | +fi |
| 22 | + |
5 | 23 | phar='minfraud.phar' |
6 | 24 |
|
7 | 25 | changelog=$(cat CHANGELOG.md) |
@@ -47,10 +65,10 @@ php composer.phar update --no-dev |
47 | 65 | perl -pi -e "s/(?<=const VERSION = ').+?(?=';)/$tag/g" src/MinFraud/ServiceClient.php |
48 | 66 | perl -pi -e "s{(?<=php composer\.phar require maxmind\/minfraud:).+}{^$version}g" README.md |
49 | 67 |
|
50 | | -box_phar_hash='aa0966319f709e74bf2bf1d58ddb987903ae4f6d0a9d335ec2261813c189f7fc box.phar' |
| 68 | +box_phar_hash='f98cf885a7c07c84df66e33888f1d93f063298598e0a5f41ca322aeb9683179b box.phar' |
51 | 69 |
|
52 | 70 | if ! echo "$box_phar_hash" | sha256sum -c; then |
53 | | - wget -O box.phar "https://github.com/box-project/box/releases/download/4.6.6/box.phar" |
| 71 | + wget -O box.phar "https://github.com/box-project/box/releases/download/4.6.10/box.phar" |
54 | 72 | fi |
55 | 73 |
|
56 | 74 | echo "$box_phar_hash" | sha256sum -c |
@@ -95,10 +113,10 @@ if [ -n "$(git status --porcelain)" ]; then |
95 | 113 | fi |
96 | 114 |
|
97 | 115 | # Using Composer is possible, but they don't recommend it. |
98 | | -phpdocumentor_phar_hash='5223cc8455d53c51fcd5a3d4ac7817acdbec3f3e325981688d345f2468097230 phpDocumentor.phar' |
| 116 | +phpdocumentor_phar_hash='aa00973d88b278fe59fd8dce826d8d5419df589cb7563ac379856ec305d6b938 phpDocumentor.phar' |
99 | 117 |
|
100 | 118 | if ! echo "$phpdocumentor_phar_hash" | sha256sum -c; then |
101 | | - wget -O phpDocumentor.phar https://github.com/phpDocumentor/phpDocumentor/releases/download/v3.7.1/phpDocumentor.phar |
| 119 | + wget -O phpDocumentor.phar https://github.com/phpDocumentor/phpDocumentor/releases/download/v3.8.1/phpDocumentor.phar |
102 | 120 | fi |
103 | 121 |
|
104 | 122 | echo "$phpdocumentor_phar_hash" | sha256sum -c |
|
0 commit comments