Skip to content

Commit 6fe6b81

Browse files
committed
Change required version of PHP and Laravel
1 parent 6d679ba commit 6fe6b81

File tree

4 files changed

+105
-3
lines changed

4 files changed

+105
-3
lines changed

.php-cs-fixer.cache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"php":"7.4.24","version":"3.2.1:v3.2.1#13ae36a76b6e329e44ca3cafaa784ea02db9ff14","indent":" ","lineEnding":"\n","rules":{"blank_line_after_opening_tag":true,"braces":{"allow_single_line_anonymous_class_with_empty_body":true},"class_definition":{"space_before_parenthesis":true},"compact_nullable_typehint":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_braces":true,"no_blank_lines_after_class_opening":true,"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"imports_order":["class","function","const"],"sort_algorithm":"none"},"return_type_declaration":true,"short_scalar_cast":true,"single_blank_line_before_namespace":true,"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline"},"no_break_comment":true,"no_closing_tag":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true},"hashes":{"src\/CrayFacade.php":658000382,"src\/helpers.php":2404740814,"src\/Console\/Contracts\/GeneratorCommand.php":3271945560,"src\/Console\/Commands\/ControllerMakeCommand.php":4042857790,"src\/Console\/Commands\/FactoryMakeCommand.php":1607996099,"src\/Console\/Commands\/MigrateMakeCommand.php":1506098991,"src\/Console\/Commands\/PolicyMakeCommand.php":2209460841,"src\/Console\/Commands\/ViewMakeCommand.php":2250427302,"src\/Console\/Commands\/ModelMakeCommand.php":3967734620,"src\/Console\/Commands\/Cray.php":2242609463,"src\/Console\/Commands\/RequestMakeCommand.php":2837614710,"src\/Console\/Kernel.php":2770827135,"src\/CrayServiceProvider.php":238705023,"src\/Traits\/RedirectsWithFlash.php":960161663,"src\/Cray.php":2689254458,"tests\/TestCase.php":917229093,"tests\/Feature\/RequestMakeCommandTest.php":1617733910,"tests\/Feature\/CrayCommandTest.php":2988800731,"tests\/Feature\/FactoryMakeCommandTest.php":3769800031,"tests\/Feature\/ViewMakeCommandTest.php":1789111302,"tests\/Feature\/ModelMakeCommandTest.php":3762202767,"tests\/Feature\/ControllerMakeCommandTest.php":381068903,"tests\/ExampleTest.php":2870283813,"config\/config.php":2693021656}}

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
}
2121
],
2222
"require": {
23-
"php": "^7.2",
24-
"doctrine/dbal": "^3.0",
25-
"laravel/framework": "^6.0|^7.0|^8.0"
23+
"php": ">=7.2|>=8.0",
24+
"doctrine/dbal": "^3.3.4",
25+
"laravel/framework": "^6.0|^7.0|^8.0|^9.0"
2626
},
2727
"require-dev": {
2828
"orchestra/testbench": "^4.0|^5.0|v6.0.0",

release.sh

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
Red='\e[0;31m'
6+
Green='\e[0;7;32m'
7+
Yellow='\e[0;33m'
8+
Purple='\e[0;35m'
9+
NC='\e[0m' # No Color
10+
11+
current_version=''
12+
13+
bump_revision() {
14+
ver=$current_version
15+
major=$(echo $ver | cut -d. -f1)
16+
minor=$(echo $ver | cut -d. -f2)
17+
revision=$(echo $ver | cut -d. -f3)
18+
meta=$(echo $ver | cut -d- -f4)
19+
20+
next_release="$major.$minor.$revision"
21+
}
22+
23+
start_prompt() {
24+
while [[ ! "${response,,}" =~ ^y|yes|n|no$ ]]; do
25+
read -p "This will create a new release and deploy to production. Continue(y|yes/n|no)?" response
26+
if [[ "${response,,}" =~ ^y|yes$ ]]; then
27+
echo -e "Starting release process..."
28+
echo ""
29+
elif [[ "${response,,}" =~ ^n|no$ ]]; then
30+
echo "Exiting..."
31+
exit 1
32+
fi
33+
done
34+
}
35+
36+
set_changelog() {
37+
if [[ $# -eq 0 ]]; then
38+
release_message="# In this release
39+
$(git log --oneline $current_version..@ --pretty=format:"- %s (%h)" --abbrev-commit | sort)"
40+
echo -e "$release_message"
41+
echo ""
42+
fi
43+
}
44+
45+
version_prompt() {
46+
echo -e "Current released version is:\e[2;7;33m $current_version ${NC}"
47+
echo ""
48+
read -p "$(echo -e "Enter next version number. Ctrl+C to cancel. Enter to Continue. [Detected: ${Green} $next_release ${NC}]: ")" user_entered_version
49+
50+
if [[ ! -z "${user_entered_version// /}" ]]; then
51+
next_release=$user_entered_version
52+
fi
53+
}
54+
55+
check_version_format() {
56+
if [[ $next_release != v* ]]; then
57+
next_release="v$next_release"
58+
fi
59+
60+
if [[ $next_release =~ ^v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)$ ]]; then
61+
if [[ "$should_continue" == true ]]; then
62+
echo -e "${Yellow}Next release version will be $next_release${NC}"
63+
fi
64+
version_format_ok=true
65+
else
66+
version_format_ok=false
67+
echo -e "${Red}Error: Please make sure version follows semver${NC}"
68+
fi
69+
}
70+
71+
start_prompt
72+
73+
current_version="$(git tag --sort=v:refname | tail -1)"
74+
75+
next_release=''
76+
77+
version_format_ok=false
78+
79+
should_continue=false
80+
81+
set_changelog
82+
83+
bump_revision
84+
85+
version_prompt
86+
87+
check_version_format
88+
89+
if [ "$version_format_ok" = true ]; then
90+
vendor/bin/pest
91+
92+
git release -m"$release_message" -v"$next_release"
93+
94+
echo""
95+
echo "Please check your GitHub actions for more information about the status of the release."
96+
fi

tools/php-cs-fixer/composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"require": {
3+
"friendsofphp/php-cs-fixer": "^3.2"
4+
}
5+
}

0 commit comments

Comments
 (0)