Skip to content

Commit c283e76

Browse files
authored
Merge pull request #26 from crowdsecurity/bump-versions
bump versions
2 parents 514ab4d + 3a3b63c commit c283e76

File tree

7 files changed

+36
-42
lines changed

7 files changed

+36
-42
lines changed

.githooks/pre-commit

-27
This file was deleted.

composer-install.sh

-3
This file was deleted.

composer.json

-8
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,5 @@
4040
"symfony/var-dumper": "^5.2",
4141
"phpunit/phpunit": "8.5.13",
4242
"clean/phpdoc-md": "^0.19.1"
43-
},
44-
"scripts": {
45-
"post-install-cmd": [
46-
"./post-install.sh"
47-
],
48-
"post-update-cmd": [
49-
"./post-install.sh"
50-
]
5143
}
5244
}

docs/contribute.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,6 @@ After the merge, don't forget to delete to branch.
8888
```bash
8989
git checkout main && git pull
9090
git describe --tags `git rev-list --tags --max-count=1` # to verify what is the current tag
91-
gh release create --draft vx.x.x --title vx.x.x
91+
export NEW_GIT_VERSION=v #...X.X.X
92+
./scripts/publish-release.sh
9293
```

post-install.sh

-2
This file was deleted.

scripts/publish-release.sh

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
3+
if [ -z "${NEW_GIT_VERSION}" ]; then
4+
echo "No \$NEW_GIT_VERSION env var found. Exiting."
5+
exit 1
6+
fi
7+
8+
platform='unknown'
9+
unamestr=`uname`
10+
if [[ "$unamestr" == 'Linux' ]]; then
11+
platform='linux'
12+
elif [[ "$unamestr" == 'FreeBSD' ]]; then
13+
platform='freebsd'
14+
elif [[ "$unamestr" == 'Darwin' ]]; then
15+
platform='osx'
16+
fi
17+
18+
git_base_dir=`git rev-parse --show-toplevel`
19+
20+
if [[ $platform == 'linux' ]]; then
21+
sed -i -E "s/v[0-9]+\.[0-9]+\.[0-9]/$NEW_GIT_VERSION/" `git rev-parse --show-toplevel`/src/Constants.php
22+
else
23+
sed -i "" -E "s/v[0-9]+\.[0-9]+\.[0-9]/$NEW_GIT_VERSION/" `git rev-parse --show-toplevel`/src/Constants.php
24+
fi
25+
git add `git rev-parse --show-toplevel`/src/Constants.php
26+
27+
28+
git add $git_base_dir/src/Constants.php
29+
git commit -m "bump version to $NEW_GIT_VERSION"
30+
echo "Note: new commit \"bump version to $NEW_GIT_VERSION\""
31+
git tag $NEW_GIT_VERSION
32+
git push origin $NEW_GIT_VERSION
33+
gh release create --draft $NEW_GIT_VERSION --title $NEW_GIT_VERSION

src/RestClient.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ private function convertHeadersToString(array $headers): string
6767
/**
6868
* Send an HTTP request using the file_get_contents and parse its JSON result if any.
6969
*
70-
* @throws BouncerException when the reponse status is not 2xx.
70+
* @throws BouncerException when the reponse status is not 2xx
7171
*/
7272
public function request(
7373
string $endpoint,

0 commit comments

Comments
 (0)