Skip to content

Commit 7859468

Browse files
authored
Merge pull request #28 from crowdsecurity/fix-releast-process
fix release process
2 parents d473fa2 + 7423e75 commit 7859468

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

docs/contribute.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ git push origin :<old-name> && git push origin <new-name>
8383
gh pr create --fill
8484
```
8585

86-
After the merge, don't forget to delete to branch.
86+
> Note: after the merge, don't forget to delete to branch.
8787
8888
#### New release
8989

9090
```bash
91-
git checkout main && git pull
91+
git checkout main && git pull && git co -
9292
git describe --tags `git rev-list --tags --max-count=1` # to verify what is the current tag
9393
export NEW_GIT_VERSION=v #...X.X.X
9494
./scripts/publish-release.sh

scripts/publish-release.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#!/bin/bash
22

3+
# Check state.
34
if [ -z "${NEW_GIT_VERSION}" ]; then
45
echo "No \$NEW_GIT_VERSION env var found. Exiting."
56
exit 1
67
fi
78

9+
# Initilize
810
platform='unknown'
911
unamestr=`uname`
1012
if [[ "$unamestr" == 'Linux' ]]; then
@@ -14,9 +16,9 @@ elif [[ "$unamestr" == 'FreeBSD' ]]; then
1416
elif [[ "$unamestr" == 'Darwin' ]]; then
1517
platform='osx'
1618
fi
17-
1819
git_base_dir=`git rev-parse --show-toplevel`
1920

21+
# Update version everywhere (add and commit changes)
2022
if [[ $platform == 'linux' ]]; then
2123
sed -i -E "s/v[0-9]+\.[0-9]+\.[0-9]/$NEW_GIT_VERSION/" `git rev-parse --show-toplevel`/src/Constants.php
2224
else
@@ -27,7 +29,11 @@ git add `git rev-parse --show-toplevel`/src/Constants.php
2729

2830
git add $git_base_dir/src/Constants.php
2931
git commit -m "bump version to $NEW_GIT_VERSION"
32+
git push
3033
echo "Note: new commit \"bump version to $NEW_GIT_VERSION\""
34+
35+
# Tag and release
36+
git checkout main
3137
git tag $NEW_GIT_VERSION
3238
git push origin $NEW_GIT_VERSION
3339
gh release create --draft $NEW_GIT_VERSION --title $NEW_GIT_VERSION

src/Constants.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Constants
1818
public const CAPI_URL = 'https://api.crowdsec.net/v2/';
1919

2020
/** @var string The last version of this library */
21-
public const VERSION = 'v0.7.0';
21+
public const VERSION = 'v0.8.0';
2222

2323
/** @var string The user agent used to send request to LAPI or CAPI */
2424
public const BASE_USER_AGENT = 'PHP CrowdSec Bouncer/'.self::VERSION;

0 commit comments

Comments
 (0)