Skip to content

Commit

Permalink
fix: scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
npldevfr committed Jan 30, 2024
1 parent 2c9ae11 commit b270479
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 58 deletions.
114 changes: 60 additions & 54 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,57 +1,63 @@
{
"name": "npldevfr/liquipedia-client",
"description": "A PHP client for the Liquipedia v3 API",
"keywords": ["php", "liquipedia", "mediawiki", "api", "client"],
"license": "MIT",
"version": "0.0.5",
"authors": [
{
"name": "npldev",
"email": "nplvdev@kcn.gg"
}
],
"require": {
"php": "^8.2.0",
"guzzlehttp/guzzle": "^7.0"
},
"require-dev": {
"laravel/pint": "^1.13.7",
"pestphp/pest": "^2.28.1",
"phpstan/phpstan": "^1.10.50",
"rector/rector": "^0.19.2",
"symfony/var-dumper": "^6.4.0|^7.0.0"
},
"autoload": {
"psr-4": {
"Npldevfr\\Liquipedia\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "stable",
"prefer-stable": true,
"config": {
"sort-packages": true,
"preferred-install": "dist",
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"scripts": {
"refacto": "rector",
"lint": "pint",
"test:refacto": "rector --dry-run",
"test:lint": "pint --test",
"test:types": "phpstan analyse --ansi",
"test:unit": "pest",
"test": [
"@test:refacto",
"@test:lint",
"@test:types",
"@test:unit"
]
"name": "npldevfr/liquipedia-client",
"description": "A PHP client for the Liquipedia v3 API",
"keywords": [
"php",
"liquipedia",
"mediawiki",
"api",
"client"
],
"license": "MIT",
"version": "1.2.0",
"authors": [
{
"name": "npldev",
"email": "nplvdev@kcn.gg"
}
],
"require": {
"php": "^8.2.0",
"guzzlehttp/guzzle": "^7.0"
},
"require-dev": {
"laravel/pint": "^1.13.7",
"pestphp/pest": "^2.28.1",
"phpstan/phpstan": "^1.10.50",
"rector/rector": "^0.19.2",
"symfony/var-dumper": "^6.4.0|^7.0.0"
},
"autoload": {
"psr-4": {
"Npldevfr\\Liquipedia\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "stable",
"prefer-stable": true,
"config": {
"sort-packages": true,
"preferred-install": "dist",
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"scripts": {
"refacto": "rector",
"lint": "pint",
"test:refacto": "rector --dry-run",
"test:lint": "pint --test",
"test:types": "phpstan analyse --ansi",
"test:unit": "pest",
"test": [
"@test:refacto",
"@test:lint",
"@test:types",
"@test:unit"
]
}
}
12 changes: 8 additions & 4 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ if [ $# -eq 0 ]; then
fi

# Get the current version from your composer.json
currentVersion=$(jq -r .version composer.json)
composerJson="./composer.json"
currentVersion=$(jq -r .version "$composerJson")

# Function to increment the version in the format 0.0.0
incrementVersion() {
Expand All @@ -28,13 +29,16 @@ incrementVersion() {

# Use the provided version or increment the current version
if [[ $1 =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
newVersion="v$1"
newVersion="$1"
else
newVersion="v$(incrementVersion "$currentVersion")"
newVersion="$(incrementVersion "$currentVersion")"
fi

# Update the version in composer.json
jq ".version = \"$newVersion\"" "$composerJson" > "$composerJson.tmp" && mv "$composerJson.tmp" "$composerJson"

# Display the new version
echo "Creating a new release for $(jq -r .name composer.json)..."
echo "Creating a new release for $(jq -r .name "$composerJson")..."
echo "Current version: $currentVersion"
echo "New version: $newVersion"

Expand Down

0 comments on commit b270479

Please sign in to comment.